Project to create night lamp

Interfacing Light Dependent Resistor (LDR) and LED, displaying automatic night lamp.

List of the items to be required.
  1. Arduino Uno.
  2. Relay Module.
  3. LDR.
  4. 12 V led light.
  5. Resistors pack.
  6. 12v adapter.
  7. 5V adapter for Arduino.
The following three purposes are performed by a nightlight:
  1. Lighting: All lights have the ability to provide illumination. A night light often features strong and weak gears as well as opening and closing gears that allow users to control the brightness. A night light's gentle lighting makes it convenient for mothers to breastfeed their children at night, and many individuals select it to dispel darkness and promote better sleep.
  2. Decoration: A gorgeous night light can be chosen to beautify a room because they come in a variety of shapes and colors.
  • Gather components like Arduino, relay module, LDR, 10 K ohm resistor, 12 V led light, adapter, wooden sticks to make lamp.
  • First of all make a night lamp using ply board sticks as shown in video.
  • Take a rectangular ply board and make a stand of the night lamp.
  • Place Arduino and relay module inside the stand of lamp.
  • Upload the below given code in the Arduino.
  • Connect 12 V led light and do connections from the circuit diagram.
  • Now stand is completed.
Code:-
const int relayPin = 13;  
const int ldrPin = A0;  

void setup() {

  Serial.begin(9600);
  pinMode(relayPin, OUTPUT); 
  pinMode(ldrPin, INPUT);   
}

void loop() {

  int ldrStatus = analogRead(ldrPin);  
  

   if (ldrStatus <=400) {

    digitalWrite(relayPin, LOW);               
    Serial.println("LDR is DARK, LED is ON");
    
   }
  else {

    digitalWrite(relayPin, HIGH);         
    Serial.println("---------------");
  }
}

Youtube For Videos Join Our Youtube Channel: Join Now

Post a Comment

Previous Post Next Post