Automatic room light and fan controller with bidirectional visitor counter

26.7k
Automatic room light and fan controller with bidirectional visitor counter

Components Used

Powered byMouser Electronics

Introduction

We built an IoT based system which can automatically switch ON room lights and fan when at least one person is present in the room. If room is empty, the lights and fan will automatically get switch off. It also displays count of persons present in the room.

We build this system using Arduino and IR sensor module.

Hardware used

  • Two IR Sensors
  • Arduino UNO
  • Relay module
  • Dc motor with propeller
  • Bulb
  • LCD display
  • Breadboard
  • Battery (9 V)
  • Jumper wires

Project Overview

For building this application we have used arduino along with IR sensors and relay module.

  • We have used two IR sensors one for detecting person entering into the room and 
    other for detecting person leaving (exit) the room.
  • Also these IR sensors are also used to count the person entering and leaving the room. This person counting will help to automate the room's fan and light. That means when the room is empty, the room's light and fan will remain off. But if someone enters the room then the room's light and fan will get turned ON automatically with person count displayed on LCD.
Project Setup

Working of IR sensor

The basic concept of IR sensor is to transmit an infrared signal, this signal bounces back from the surface of an object and signal is received at the infrared receiver.

IR Sensor Working Principle

Project Implementation

When person enters the room infrared signal bounces back and get received by infrared receiver which is considered as entry.

Therefore count is incremented. 

if (digitalRead(In) == LOW) 
   {  
   count++;  
   }  

 Similarly for person leaving the room, count is decremented on detection.

else if (digitalRead(Out) == LOW) 
  {  
   count--;  
  }  

When count is more than zero,Relay gets high therefore room lights and fan turn on  
and for count less than or equal to zero relay gets low, so light and fan will get turn off.

else if (count > 0)  
 {  
   digitalWrite(relay, HIGH);  
 }  
 
 else if(count <= 0){  
   digitalWrite(relay, LOW);  
 }  

Connection Diagram

Hardware Connection

Design Steps

  • Now to design this circuit we have to interface 16x2 LCD with Arduino UNO as shown in diagram.
  • Two IR sensors are connected to digital input pin 4 and 5 of Arduino UNO. (Pin 4 is for entry and pin 5 is for exit.)
  • Relay module is connected to GPIO pin of Arduino UNO.
  • Bulb and DC motor with propeller are connected in series with relay.
Project's Hardware
  • Upload the code to the Arduino UNO.

 

Video

Comments16

Join the discussion — share a question or tip.

  • abhishekyalla66
    abhishekyalla66

    1.How to make bidirectional home automation without display 2.how to join both bidirectional home automation and Google or Alexa home automation using blunk app Plsss reply brook... Plss...

  • AP
    appooveena

    Is this relay module single channel or double channel

  • abhinikalje258
    abhinikalje258

    Plz send detail circuit connections along with bread board because i am a beginner

    • abhinikalje258
      abhinikalje258

      Plz properly send detail circuit connections along with bread board because i am a beginner

  • abhinikalje258
    abhinikalje258

    Plz send detail circuit connections along with bread board because i am a beginner

  • druvateja7777
    druvateja7777

    Plz send the complete code

  • druvateja7777
    druvateja7777

    Plz send detail circuit connections along with bread board because i am a beginner

  • druvateja7777
    druvateja7777

    Bro plz help me

  • alole36
    alole36

    https://www.startupjobsportal.com/ nice project

  • jeevanew
    jeevanew

    Hai I done all the process step by step but led don't show any message and sensor are not operate correct lu pls help me I several time told cost include 6000 rupees

  • vikasyadav12101999

    Hey can you please tell me which relay module you have used in the project. (Give the link if possible )

    • PR
      pratiksha

      5V Single Pole - Double Throw (SPDT) relay is used in this project as a switch

  • kaustubhpatil2109
    kaustubhpatil2109

    I want this aurdino program

    • lokeshc
      lokeshc

      You can find code in attachment

    • kaustubhpatil2109
      kaustubhpatil2109

      Replying to @lokeshc

      I can't able to open the attachment file. Can you please send me that file.

    • lokeshc
      lokeshc

      Replying to @kaustubhpatil2109

      you can download that file from below link too, https://www.electronicwings.com/users/abhilasha/codes/automated_room_light_and_fan