When an object moves into the room it passes through IR sensor 1 first and then IR sensor 2, this makes the microcontroller understand that something has moved into the room. In this situation it makes the LED to glow.On the other hand when the last object moves out of the room it has to pass through IR sensor 2 first and then IR sensor 1, this situation helps the microcontroller to understand that no one is present in the room now, thus it glows off the LED. In the coding part, I have used a variable “count” to count the number of objects present in the room. Count increments itself by one for every entry and decrements by one for every exit.