technoesolution
Published © CC BY-NC-ND

Motion Activated Automatic Room Light Using Mini PIR Sensor

In this project, I'm going to make my room light automatic, when someone enters the room the light gets automatically turn on.

IntermediateFull instructions provided1 hour278
Motion Activated Automatic Room Light Using Mini PIR Sensor

Things used in this project

Hardware components

Arduino Nano
×1
Mini PIR Sensor
×1
1-Channel Relay Module
×1
Breadboard
×1
Jumper Wires
×1
AC Load (Lamp)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram

Follow the circuit diagram for making a connection. I make this circuit in Easy EDA software.

Code

Arduino Code

C/C++
Simply copy the following code & upload it to your Arduino IDE software.
/*
 * Hello Friends Welcome To Techno-E-Solution
 * Here is the Code For Automatic Room Light Using Arduino
 * Here is the complete making video :- https://youtu.be/p72c1JZ1oIE
 */
 
#define PIR 4
#define Relay 6

void setup() 
{
 Serial.begin (9600);
 pinMode (PIR, INPUT_PULLUP);
 pinMode (Relay, OUTPUT); 
}

void loop() 
{
  int motion = digitalRead (PIR);
  if (motion)
  {
    Serial.println ("Motion Detected");
    digitalWrite (Relay,HIGH);
  }
  else 
  {
    Serial.println ("All Stable");
    digitalWrite (Relay,LOW); 
  }
  delay (100);
  }<br>

Credits

technoesolution

technoesolution

23 projects • 15 followers
Youtuber | Electrical Engineer | Electronics Lover | Article Writer | Project Developer |

Comments