It was my first time using Arduino so I wanted to know what I will do in the final project, and make the primary function which was the dim light, and a small screen to be more interactive. Hope you like it
Tinker cad to simulate and build Arduino code
Arduino ide to upload code to the board
Small breadboard to connect all components solderless
Some jumpers
Resistor to adjust the voltage and current
3mm led
Arduino UNO r3 to control all the components with code
LDR module
16*2 lcd with I2C module
First I made a LDR module that I found on the internet
using photoresistor and 4.7k ohm resistor
Second, I put 2 LEDs and a 220-ohm resistor to modify the volt to 3V
and connect the anode to Arduino using port 3~ to send an analog and digital signal
note: that's not the optimal way to turn 2 LEDs, you should connect one resistor to each of the LEDs, but my purpose is to have a bright light only
then build the code using the blocks, it was simply if the analog signal coming from LDR is greater than 750 (getting dark)
turn on in 3 to the mapping analog signal
if not then close the led
Then I decided to put a screen to be more interactive
I put SCL on A5 , SDA on A4
and GND and VCC to GND and 5V
Finally, modify the code to include the screen and print some words you can see in the next video it's talking It's A LIFFFEEE 🤩🤩
First I connect the 3mm LED like tinker cad
Put the anode to 3~
Second was to connect the LDR VCC and GND
and connect the analog signal to A0
that's the circuit without the screen
finally I connected the LCD
GND and VCC on the breadboard
and SCL on A5 , SDA on A4
that's the circuit with the screen
Copied the code from Tinkercad
Past and upload the code to Arduino with Arduino ide
and worked as expected
The First challenge was that tinker cad doesn't have LDR module so I google it and find a way to make it on Instructables
Second challenge was that it was my first time using LCD so I had to read a full article about it and the i2c module and how to connect and code it with liquid crystal i2c library
If it is your first time using the LCD like me I highly recommend this tutorial on last minute engineers
The project doing it's purpose perfectly, when the light is off the LDR sense the dark and turn on the LED (the LED is fading on and off with the incoming data from LDR, at is getting darker the LED going brighter)
and the LCD print "It's dark here, getting light on" to be more user friendly and give you a feedback
and when the light is on the LDR sense it and turn off the LED
and the LCD print "Don't need me, light off"
It was fun and smart, hope you like it ❤️