Night Light

1,006

15

2

About: I live in Pakistan . I am 16 year old and I am passionate about electronics since my childhood. I have a hobby to design and implement science projects involving electronics and I am working on instructables...

Nightlight is a very simple project for beginners. It is set of lights which will be light up when there is no light in the room.

Products you would need.

1. ARDUINO BOARD

2. LIGHT SENSOR

3. LEDS

4. WIRES

You can found all these products on amazon.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Making a Led Strip

Make a LED strip. Just connect the leds in parallel connection and use long wire for connections. I have used four white LEDs and gave a distance of almost 1 foot between each LED. I have used thin wire to connect all the cathodes and anodes of all LEDs.

Step 2: Connections

The connections are simple.

  1. Positive terminal of LED strip to digital pin "12" of Arduino.
  2. "gnd" terminal of LED strip to "gnd" pin of Arduino.
  3. "gnd" terminal of sensor goes to "gnd" of Arduino.
  4. Positive terminal of sensor to 5v of Arduino.
  5. "do" pin of sensor to digital pin "11" of Arduino.
  6. 5v of adapter to "vin" pin of Arduino.
  7. "gnd" terminal of adapter to gnd of Arduino.

Step 3: Programing

Just plug your arduino with your computer and download "IDE SOFTWARE" of arduino. Then upload the code to arduino. The code is given below:

void setup() 
{
pinMode (12,OUTPUT);
pinMode (11,INPUT);
int buttonstate=0;
}

void loop()
{
  if(buttonstate==HIGH)
        {
        digitalwrite(12,HIGH);
        }
  else
       {
       digitalwrite(12,LOW);
       }  
}

Step 4: Ending

Just put every thing in a container. I used a project box. Make sure the LDR (Light Dependent Resistor) is out of the box so that light can reach it.

Microcontroller Contest 2017

Participated in the
Microcontroller Contest 2017

Lights Contest 2017

Participated in the
Lights Contest 2017

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    2 Discussions

    Nice idea for a night light. I like how it could look like fireflies in a jar. My kids would love to have something like this in their rooms.

    1 reply