Automatic Room Light Controller with Bidirectional Visitor Counter

Share This

Hello friends! Welcome back to ElectroDuino. This blog is based on the Automatic Room Light Controller with Bidirectional Visitor Counter System. Here we will discuss Introduction to Automatic Room Light Controller with Bidirectional Visitor Counter, Project Concept, Block Diagram, Components Required, Circuit Diagram, Working Principle, and Arduino Code.

Introduction

All over the world, the consumption of electricity is increasing day by day. But the main problem is the wastage of electricity is also increasing. Every day we waste electricity in different ways somewhere. One of them is sometimes we have left out our room, office, or classroom and forget to turn off the light, fan, and other electric appliances.

To overcome this problem here we will be going to learn how to make an Automatic Room Light Controller with a Bidirectional Visitor Counter system using Arduino. This system continuously monitors how many visitors entering in the room and how many exiting from the room. And when it detects no visitors inside the room, it turns off the light and fan of that room. In this way, this system can save lots of electricity.

Project Concept/Overview

This project is based on Arduino, few major components are needed to build this project. These components are Arduino, two IR sensors, an OLED display, and 2 channel relay module. The Arduino board is used as the main microcontroller that controls this system. Two IR sensors are used to detect the visitor from both directions, i.e., one sensor detects the number of entering visitors and the other one the number of exiting visitors. The OLED display is used to show the total number of entering visitors and the total number of exiting visitors. Also shows the total number of visitors currently present inside the room. The 2-channel relay module is used to control two electric home appliances like light and fan.

Block Diagram of  Automatic Room Light Controller with Bidirectional Visitor Counter System using Arduino

Automatic Room Light Controller with Bidirectional Visitor Counter Block Diagram, Introduction to Automatic Room Light Controller with Bidirectional Visitor Counter, Project Concept, Components Required, Circuit Diagram, Working Principle, and Arduino Code.
Automatic Room Light Controller with Bidirectional Visitor Counter Block Diagram

Components Required

Components NameQuantity
Arduino NANO1
IR Sensor Module2
16×2 LCD Display Module1
220 ohm Resistor (R1, R2)2
10K ohm Potentiometer (VR1)1
2-Channel Relay Module1
5v Buzzer1
9v Power Supply1
Rocker Switch1
PCB board1
Connecting wiresAs required in the circuit diagram

Tools Required

Tools NameQuantity
Soldering Iron1
Soldering wire1
Soldering flux1
Soldering stand1
Multimeter1
Desoldering pump1
Wirecutter1

Software Required

Arduino IDE (Integrated Development Environment)

Arduino IDE (Integrated Development Environment)

 

Required Library

We need to add 2 libraries in Arduino IDE software. These are:

  • Download the Adafruit_GFX.h library here: CLICK
  • Download the Adafruit_SSD1306.h library here: CLICK

Circuit Diagram of Automatic Room Light Controller with Bidirectional Visitor Counter System using Arduino

Circuit Diagram of Automatic Room Light Controller with Bidirectional Visitor Counter, Introduction to Automatic Room Light Controller with Bidirectional Visitor Counter, Project Concept, Block Diagram, Components Required, Working Principle, and Arduino Code.
Circuit Diagram of Automatic Room Light Controller with Bidirectional Visitor Counter

Working Principle of Automatic Room Light Controller with Bidirectional Visitor Counter

When a visitor enters the room the sensor-1 detects the visitor (obstacle) and produces a Low (0) output value from its Output Pin. Then the Arduino read this output value from the sensor-1 and counts 1+ using the code. Similarly, When this sensor-1 detects another visitor, the Arduino increment the counting by +1. In this way every time the Arduino adds +1 in the count when the sensor-1 detects visitors and calculates the total number of visitors entering the room.

In the same way, when a visitor leaves the room, the IR sensor-2 detects the visitor (obstacle) and produces a Low (0) output value from the Output Pin. Then the Arduino read this value and counts 1+ using the code. Similarly, every time the Arduino adds +1 in the count when a visitor leaves the room and calculates the total number of exiting visitors.

Every time the Arduino Subtracts the total number of entering visitors from the total number of exiting visitors and calculates the total number of visitors currently present inside the room.

When the Arduino detects the presence of 1 or more than 1 visitors inside the room. Then it grounded (LOW/0V) the input pins (IN1 and IN2) of the 2-Channel Relay Module to active the Relays and turns ON the Light and Fan automatically.
When the Arduino detects No visitor present inside the room. Then it sends a High (5V) voltage to the input pins (IN1 and IN2) of the 2-Channel Relay Module to deactivate the Relays and turns OFF the Light and Fan automatically.

The OLED display shows the total number of entering visitors, the total number of exiting visitors, and the total number of visitors currently present inside the place. And also shows the Light and Fan status (ON/OFF).

Arduino Code for Automatic Room Light Controller with Bidirectional Visitor Counter

 

Share This

Leave a Reply

Your email address will not be published.