Sleep Light, by Ian and Barrett

by PHS_Engineering in Circuits > Arduino

123 Views, 0 Favorites, 0 Comments

Sleep Light, by Ian and Barrett

Relay Arduino Project (Dec 7, 2021 at 1_39 PM).png

This project will allow you to change the color of a sleeping light using an Arduino relay. It can be done by anyone so you should give it a try!

Supplies

You will need:

Wires

Alligator clips

Diode

Transistor

Relay

1K Ohm resistor

Arduino Uno board

Lamb Sleep Light

Build the Circuit

Fianal wire diagram.png

The first step is to make the circuit on your bread board and then connect it to the Arduino. Follow this circuit diagram to crate it.

Open the Toy

Relay Arduino Project (Dec 7, 2021 at 1_36 PM).png

The next step is to open the toy and connect it to the Arduino. You will first need to cut the lamb part off of the toy. Then open it and cut the wire that connects to the light button. In this case it is the red wire.

Conect It to the Arduino

Relay Arduino Project (Dec 7, 2021 at 1_34 PM).png

Next you need to connect it to the Arduino. Cut and strip the wire that connects to the light button. Then clip them with the alligator clips to the circuit. It does not matter witch wire they clip to.

The Code

Screenshot 2021-12-07 2.28.32 PM.png

The last step is to upload the code and watch the light change. Make sure your circuit is built correctly before you upload the code.

int Relay = 13;

// the setup routine runs once when you press reset:

void setup() {

// initialize the digital pin as an output.

pinMode(Relay, OUTPUT);

}

// the loop routine runs over and over again forever:

void loop() {

digitalWrite(Relay, HIGH);

delay(1000);

digitalWrite(Relay, LOW);

delay(1000);