Introduction: DIY Alarm Clock
Step 1: Material
- Arduino or Arduino standalone
- RTC DS1307 or DS3231
- 20x4 LCD I2C
- 4 buttons
- Diodo led
- 1 Resistor 220 ohm
- Piezzo Buzzer (from Arduino starter kit)
Step 2: Schematics
Compared to the "Clock Set Date Time" I added a Piezzo buzzer, an LED diode, a resistor of 220 ohm,one button, and as mentioned before, I have listened the suggestion to "maewert" and I removed the resistances to "pull down".
Step 3: Arduino Code
- Wire.h :by Arduino IDE
- Code: https://create.arduino.cc/editor/Tittiamo/66248b63-6d32-4ca9-929c-517de0c676c3/preview
To remove the "pull down" resistances I had to make a change to the code.
Use the pullup resistors of arduino, and reverse the code logic conditions.
Step 4: The Alarm Code
The activation and deactivation of the alarm clock is controlled by the "P4" button, line 444 "void Alarm()".
To enter the alarm settings, you must use the "P3" "P2" buttons together, line 81 "if((digitalRead(P2)== LOW)&&(digitalRead(P3)== LOW))".
When the alarm is not set, the bottom of the display will show "Alarm Off" when the alarm is active, it shows the time that has been set.
At the scheduled time, the display flashes, the LED lights up, and the buzzer sounds two tones.
To turn off the alarm, you have to act on the P4 button, or, after a minute, it turns off alone
Step 5: Work in Progress
I'm working to put it all in my "Weather Clock"