Varun_Sontakke
Published © GPL3+

Smart Room – Automatic Light Control and Visitor Counter

Smart Room is an automated system that controls electrical appliances based on the number of people inside a room.

IntermediateFull instructions provided7 hours105
Smart Room – Automatic Light Control and Visitor Counter

Things used in this project

Hardware components

ATmega328
Microchip ATmega328
×1
IR Proximity Sensor
Digilent IR Proximity Sensor
×2
I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
×1
Seeed Studio 5V Relay module (digital) Electronic Brick
×2
Linear Regulator (7805)
Linear Regulator (7805)
×1
Low Voltage Transformer, Class II
Low Voltage Transformer, Class II
×1
Bridge Rectifier Diode, Single Phase
Bridge Rectifier Diode, Single Phase
×1
Grove - Piezo Buzzer
Seeed Studio Grove - Piezo Buzzer
×1
Fan Accessory, AC Motor
Fan Accessory, AC Motor
×1
LED Light Bulb, Frosted GLS
LED Light Bulb, Frosted GLS
×1
Capacitor 1000 µF
Capacitor 1000 µF
×1
Custom PCB
Custom PCB
×1
Jumper wires (generic)
Jumper wires (generic)
×15

Software apps and online services

Arduino IDE
Arduino IDE
Autodesk EAGLE
Autodesk EAGLE

Hand tools and fabrication machines

Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Tape, Double Sided
Tape, Double Sided
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Circuit diagram

Code

Maincode

Arduino
#include<LiquidCrystal.h>

LiquidCrystal lcd( 2, 4, 5, 6, 7, 8);

#define in 9
#define out 10
#define ar 12
#define br 11
#define buzz 3

int count=0;

void IN()
{
    count++;
    lcd.clear();
    digitalWrite(buzz,HIGH);
    delay(1000);
    digitalWrite(buzz,LOW);
    lcd.print("Person In Room:");
    lcd.setCursor(0,1);
    lcd.print(count);
    delay(1000);
}

void OUT()
{
    count--;
    lcd.clear();
    digitalWrite(buzz,HIGH);
    delay(1000);
    digitalWrite(buzz,LOW);
    lcd.print("Person In Room:");
    lcd.setCursor(0,1);
    lcd.print(count);
    delay(1000);
}

void setup()
{
  lcd.begin(16,2);
  lcd.print("WELCOME TO");
  lcd.setCursor(0,1);
  lcd.print("SMART ROOM");
  delay(2000);
  pinMode(in, INPUT);
  pinMode(out, INPUT);
  pinMode(ar, OUTPUT);
  pinMode(br, OUTPUT);
  pinMode(buzz, OUTPUT);
  lcd.clear();
  lcd.print("Person In Room:");
  lcd.setCursor(0,1);
  lcd.print(count);
}

void loop()
{  
  
  if(digitalRead(in))
  IN();
  if(digitalRead(out))
  OUT();
      
  if(count<=0)
  {
    lcd.clear();
    digitalWrite(ar, LOW);
    digitalWrite(br, LOW);
    lcd.clear();
    lcd.print("Nobody In Room");
    lcd.setCursor(0,1);
    lcd.print("Light Is Off");
    delay(100);
  }
  
  else
    digitalWrite(ar, HIGH);
    digitalWrite(br, HIGH);
 }

Credits

Varun_Sontakke
2 projects • 4 followers
MBSE SysML v2 & GenAI at TCS | M.Tech (IoT) | EdgeAI & Robotics Maker | Applying Design Thinking to Hardware & Space Tech | Systems Engineer

Comments