Arduino Night Light

by alisaliang in Living > Decorating

197 Views, 0 Favorites, 0 Comments

Arduino Night Light

Arduino night light
IMG20191103193145.jpg

The original publisher of this project is: ENG249GroupProject

and this is the link of the original publisher's website

This night light is use for people who are afraid of darkness and it won't be too dazzling.

I added a yellow LED to make the night light looking not that boring.

Another change I made is I made the lamp bigger, so it can cover the breadboard.

Step 1: Tools and Materials

IMG20191103191430.jpg
fullsizeoutput_3e1.jpeg

Tools

a computer with USB port

pencil

ruler

scissors

box cutter

Materials

x1 Arduino board with a USB connection cable

x1 Breadboard

x1 common anode RGB LED

x3 220 Ohm resistors

8 wires

thick opaque paper

thin translucent paper (graph paper)

glue

Step 2: Making the Lamp

IMG20191103190906.jpg
fullsizeoutput_3e2.jpeg
IMG20191103190830.jpg
IMG20191103190853.jpg
IMG20191103205543.jpg

Rectangle paper

Take a A4 size paper and cut the paper into a rectangle of length 30 widths 15.

Fold in half and cut a little triangle at the line you just fold.

Measure 12cm at the side of 15cm, fold in the 1.5cm in each side.

Last, cut off four small triangle in each corner.

Triangle paper

Take another paper and cut it into a triangle with two sides being 14.5cm and the other side of 20cm. (you need two of this, so make two)

Draw two smaller triangle on the triangle you just cut off.

Take the white (note paper) and cut it into a triangle that is a little smaller than the thick paper. (you need two)

Stick them together

Combine the Rectangle and Triangle paper

Ding! You made it !

Code

fullsizeoutput_3df.jpeg

https://create.arduino.cc/editor/AlisaLiang/d992f9...

Arduino night light code

const int redLEDPin = 9;

const int greenLEDPin = 10;

const int blueLEDPin = 11;

const int redValue = 255;

const int greenValue = 0;

const int blueValue = 0;

void setup() {

pinMode( 12, OUTPUT); 改

pinMode(redLEDPin, OUTPUT);

pinMode(greenLEDPin, OUTPUT);

pinMode(blueLEDPin, OUTPUT);

}

void loop() {

digitalWrite( 12, HIGH ); 改

analogWrite(redLEDPin, redValue);

analogWrite(greenLEDPin, greenValue);

analogWrite(blueLEDPin, blueValue);

}