Arduino Relay Activated Lamp

by Hadi_jass in Circuits > Arduino

1338 Views, 2 Favorites, 0 Comments

Arduino Relay Activated Lamp

Screen Shot 2020-05-20 at 4.41.25 PM.png

In this tutorial you will be able to make a relay activated lamp using code.

We will be using tinkercad for this project and the following devices will be needed:

-LDR

-Relay

-Light bulb

-Power source

-Arduino

-Breadboard

Set Up the Breadboard

Screen Shot 2020-05-20 at 4.40.06 PM.png

Copy the image above as it will allow you to add in more features such as the LDR and relay.

Add in the LDR and 1k Resistor

Screen Shot 2020-05-20 at 4.40.46 PM.png

Add in the LDR and resistor into the circuit and wire it properly.

Add in the Relay

Screen Shot 2020-05-20 at 4.41.02 PM.png

You will now need to add in the relay into the circuit as shown in the image. Make sure the wires line up with the right point on the relay.

Add in the Light Bulb

Screen Shot 2020-05-20 at 4.41.18 PM.png

Add the light bulb into the circuit as shown in the image. It should be connected to the point on the relay

Add in the Power Source

Screen Shot 2020-05-20 at 4.41.25 PM.png

Add in the last component to complete the circuit. Make sure the entire circuit is wired properly.

Code

Screen Shot 2020-05-20 at 5.04.10 PM.png

The code shown in the image is what you will need to make your project work effectively. The light bulb will only turn on when the LDR sensor determines that it is dark.