A provided smart switch called Occupant Counter Control Switch, or OCCS,
basically comprises of a motion sensor PIR, a photo sensor, an amplifier
with band-pass filter, a microprocessor, a digital display, and a relay
or triac to drive electrical appliances such as lights. The PIR sensor
detects heat from a human body moving across it and generates a
distinctive signal that is, unique to each of the two directions, further
processed by the microprocessor for counting and thereby controlling the
relay. Installed at the entrance of a room replacing the regular switch
(see FIG. 1), the OCCS counts up, displaying a digit great than zero,
upon detecting a person entering the room and turns on the lights if
sensing insufficient ambient light. OCCS constantly energizes the lights
during the room is occupied and immediately switches them off upon
counting down to zero when detecting the last person exiting the room.