Introduction: Automatic Room Light and Fan Controller With Bidirectional Visitor Counter

Often we see visitor counters at stadium, mall, offices, class rooms etc. How they count the people and turn ON or OFF the light when nobody is inside? Today we are here with automatic room light controller project with bidirectional visitor counter by using Arduino Uno. It is very interesting project for hobbyists and students for fun as well as learning.

The project of “Digital visitor counter” is based on the interfacing of some components such as sensors, motors etc. with Arduino microcontroller. This counter can count people in both directions. This circuit can be used to count the number of persons entering a hall/mall/home/office in the entrance gate and it can count the number of persons leaving the hall by decrementing the count at the same gate or exit gate and it depends upon sensor placement in mall/hall. It can also be used at gates of parking areas and other public places.

Step 1: Components Required:

  • Arduino UNO
  • Resisters
  • Buzzer
  • Dc motor as a fan
  • ultrasonic sensor module
  • 16x2 LCD display
  • Bread Board
  • Connecting Wires
  • Led
  • BC547 Transistor

Step 2: Circuit Diagram:

Wastage of electricity is one of the main problems which we are facing nowadays. In our home, school, colleges or industry we see that fan/lights are kept on even if there is nobody in the room or area/passage. This happens due to negligence or because we forgot to turn lights off or when we are in a hurry. To avoid all such situations I have designed this project called “Automatic room light controller with visitor counter”. And in a reverse way, person count will be decremented if somebody leaves the room. When the number of persons inside the room is zero, lights and fan inside the room are turned off.

For connections please visit:

For LCD connections please visit:

Step 3: Code:

For credit, please follow my following accounts.

For more interesting projects connect with me on:


Facebook page:


Arduino Contest 2020

Participated in the
Arduino Contest 2020