This week's idea is from the attached website, with a change from me
To increase and improve the components of the idea
The idea is that when the light goes out
A white LED lights up and a beep occurs
This means that there is a light sensor that senses degrees of illumination
And at a degree less than 490, it lights a white bulb (LED).
And a warning sound occurs by means of the buzzer
This idea is a personal interest I like it and useful for my project .
Components used:
Arduino UNO
LDR sensor module
LED light
220 ohm resistor
Buzzer
Breadboard
jumper wires
Usb cable for Arduino
Softwares :
I used Arduino IDE Software .
Tinkercad
The smart circuit :
contains an input unit light sensor (LDR sensor)
it is connected to the breadboard the board
and jumper wire connection with Arduino by wires
Vcc to Arduino 5v
Gnd to Arduino GND
A0 to Arduino A0 (analog pin )
And an output unit:
a white LED connected by breadboard with a resistance of 220 ohm to GND
and the other connected to Arduino digital pin
And an output unit:
the buzzer connected to the board and the ground on and the other end is connected to the Arduino digital pin
Total connections are 10 jumpers .
Programming by Code Blocks :
I used - If else - conditionals
And I wrote If it reads the analog pin (input unit - LDR sensor ) greater than or = 250
Then make the LED and Buzzer HIGH or make them working (ON) and wait for one second and make it off (pin LOW)
Frequently
it's inside the void loop
else make them off
After all the above
I copied the Code Blocks as text from Tinkercad
And paste it into the Arduino IDE program
I tested the code Then upload it to Arduino by USB cable
At the same time, I used the breadboard put the white LED , LDR sensor and Buzzer by jumpers
connecting to Arduino
Then
I turn off the light, so the sensor & Buzzer worked
And I tried it several times and the result was correct .
and the circuit is functional .
The first challenge
Tinkercad program I did not find the LDR Sansor .
After searching on Google and asking colleagues
I found the alternative ( photoresistor ) to use it and implement the rest of the steps
The second challenge
The Blocks code doesn't work but When I upload to Arduino it was working
And after seeing the attached file and getting advice from the instructor
I found that I was setting up the sensor reading analog pin 490 it's wrong
but when i use 250 it's working
I knew from the attached files
The LDR sensor reading changes from sunlight and closed room light
Certainly, training create a smart circle
consisting of inputs such as the LDR sensor
And outputs such as LED and Buzzer
Writing codes with Code Blocks Tankercad
And the use The ( IF , Else ) Condition
Good experience I will use in the final project
Title of Media