Introduction: Arduino Light Intensity Lamp
Hey everyone! This tutorial is going to be about how to make an Arduino Light Intensity Lamp using Tinkercad.
- LDR (1)
- Arduino micro controller (1)
- Light bulb (1)
- 1 K ohms resistor (1)
- Relay (1)
- A power source (1)
- Breadboard (1)
Step 1: Construction
We will start off with constructing the circuit in Tinkercad. To see the connection of the LDR, refer to the image above. One end is connected to the resistor, and one is connected to ground using a jumper wire. Using a jumper wire, connect A0 to the end of the LDR which is connected to the resistor.
Step 2: Power Connection
To connect the power to the light bulb, simply connect the positive end of the power source to terminal 2 of the light bulb. Attach the relay to the breadboard so you can connect the power source to it. Then, connect the negative end of the battery to terminal 1 of the relay. Refer to the image above for a more visual representation. With the help of a jumper wire, connect terminal 8 of the relay to ground.
Step 3: Arduino to Breadboard Connections
1. Make sure your Arduino is connected to ground on the breadboard
2. Pin 4 should be connected to terminal 5 on relay
3. A0 should be connected to one end of the resistor
4. Power is connected to the breadboard
Refer to the image above for a deeper understanding
Step 4: Coding
In the setup block of the code you would write A0, input which is the pin from which the circuit is taking input from. The other pin mode would be what the circuit is suppose to do, which would be (4, OUTPUT). 4 is the pin number and the output is saying what the circuit should do. Void loop is how you want the behavior of the circuit to be like. There is an if and else statement involved here. It is saying when analog read(A0) is greater than 500 then turn the light off otherwise turn it on. The final line just tells the delay time. Refer to image above for a deeper understanding.
Step 5: Tutorial
Click on the link above for a tutorial