Light-sensed Arduino Alarm

by George1817 in Circuits > Arduino

249 Views, 0 Favorites, 0 Comments

Light-sensed Arduino Alarm

IMG_6430.JPG

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

Materials.JPG
Lights.JPG

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

Cable.JPG

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

Screen Shot 2021-04-13 at 2.00.32 AM.png

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:

https://create.arduino.cc/editor/george1817/6c993c...

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.

Finalize and Place the Arduino in a Box.

IMG_6430.JPG
Box outside 2.JPG
Box outside.JPG

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