This document describes a home automation system using Internet of Things (IoT) technology to control lighting in smart rooms. The system uses a pair of infrared sensors and an Arduino chip to detect the number of people entering or leaving a room. When a person enters, the light turns on. It remains on while people are detected in the room. When the count reaches zero, meaning no people are detected, the light turns off. This system aims to conserve energy by automatically turning lights off in unoccupied rooms. It provides an energy-efficient model that could be used in homes, schools, offices and other settings.