This is an illustration of my idea to switch ON/OFF the lights or other appliances in the room depending on the number of people in the room. If the room is empty, the appliances (light in this case) are automatically turned OFF, Otherwise it switches ON. Visit this link for complete details regarding this project: http://www.deekshith.in/2012/07/automaic-room-light-controller-with.html
I have used an AVR microcontroller and programmed in embedded C using Win-AVR. It is programmed to count the number of visitors entering and leaving the room. It has a counter which increments when a person enters the room and decrements when he leaves. The count value is used to decide if the lights should be turned ON or OFF. Care is taken in the sensor arrangement to reduce the probability of false counts. After making this project, I have searched the net to see if anything better is done anywhere. I felt this approach is better than any previous implementations.