Light-sensed Arduino Alarm
This is an Alarm which you can place near the window, which sun can shine onto it in the morning. The Alarm is triggered through a light sensor, which will be activated in the morning when sunlight shines on it.
The credit goes to:
https://www.instructables.com/Arduino-Drawer-AlarmDiet-Helper/
Gather the Materials
In order to make the alarm, you will need the following.
>a photoresistor
> a 10kΩ resistor
>a piezo buzzer
>a 9v battery and battery clip with dc header
>an Arduino board (I use a Uno)
>a Breadboard
>Jumper wires
>Box
>LED lights x2
Wire the Board
GND and 5V > Negative and Positive part on the bread board.
Buzzer:
positive > D2
negative > negative
light sensor:
connect to 5V, A2 , and the resister to the negative
LED:
positive > D3
negative > negative
Battery:
connect to dc port on the board
Write the Code
After you finishing writing the code, connect your Arduino board to you computer and upload it.
#change the dark's variable according to the light condition of your room to prevent false alarms.
#the LED light is there to make sure the alarm is on
Code link:
Downloads
Testing
Remember to test with changing the light condition in your room to make sure it works before you place it into the box.
Downloads
Finalize and Place the Arduino in a Box.
After testing and Finalizing, place the whole alarm into the box you prefer. (size does not matter as long as the Arduino fits inside) Make sure the LED lights and the light sensor is on the outside of the box, and can receive light.
See the Results