Introduction: Automatic Induction Night Light

This Automatic Induction Night Light is base on https://www.instructables.com/id/Arduino-Light-Th... I changed the number of the LED and the requirement of the brightness that makes the LED light up. I also adding more LEDs with different colors.

Code Link: https://create.arduino.cc/editor/liuliu0112/ccad18...

Arduino YT Link: https://www.youtube.com/watch?v=e8ujd8CNkvg

Step 1: Introduction and Materials

Use a photoresistor to determine the brightness of the environment. There are only two different parts. If it is dark, more LEDs will light up; if it is bright, fewer LEDs will light up.

The items needed to create this Automatic Induction Night Light

  • Arduino
  • Computer or charging
  • LED (white, green, yellow, red)
  • Photoresistance
  • Resistor
  • Tape
  • Cardboard
  • Wire

Step 2: First Section of the Process

You're going to prepare 7 LED (2 White, 2 Green, 2 Yellow, and 1 Red), 23 wires, and 8 Resistors, and 1 Photoresistor.

  1. Placing 7 LEDs in the Arduino in order. From left to right is White, Green, Yellow, Red.
  2. Placing 7 Resistors in corresponding LEDs.
  3. Placing 7 wires in corresponding LEDs to the Digital Pins. From left to right is D8,D7,D6,D5,D4,D3,D2
  4. Adding 1 Photoresistor on the right, also add one blue Resistor, Positive Electrode to A5, Negative Electrode to A0)

Step 3: Coding Part 1

For coding, we first make the part of the LED to the Digital Pins. That we know which LED is connect to the Digital Pin, and we can set up basic on these codes. And we also set up the input and output of each LED.

Step 4: Coding Part 2

After we set up the LED and other basic information and code. Our purpose of this work is to induction the lightness or the darkness from the environment base on the Photoresistor because I have a total of 7 LEDs, that we will change the requirement of each LED to light up. From the environment of brightest to darkest, is from the White LEDs, Green LEDs, Yellow LEDs, and last Red LED.

Step 5: Combine the Coding Together

After finishing the coding and connect all parts, we combine it's together and try if it can work or not. And making shell and packaging to look it better.