DIY Alarm Clock

by tittiamo68 in Circuits > Arduino

22019 Views, 53 Favorites, 0 Comments

DIY Alarm Clock

Alarm Clock
AlarmClock - Copia.jpg

After designing the "Clock Set Date Time" and hearing the suggestion of "maewert" I thought it would be a good idea and also useful, add a "wake-up alarm."

A small change to the code and adding a few components: Here's "the Alarm Clock"

Material

IMG_2145.JPG
IMG_2144.JPG
IMG_2147.JPG
20170128_014816 - Copia.jpg
Led.jpg
  • 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)
  • Wires

Schematics

Alarm Clock.jpg
Allarm clock_bb.jpg

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".

Downloads

Arduino Code

Allarm Code.JPG

Link libraries:

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.

pinMode(P1,INPUT_PULLUP);

pinMode(P2,INPUT_PULLUP);

pinMode(P3,INPUT_PULLUP);

pinMode(P4,INPUT_PULLUP);

if(digitalRead(P1)==LOW)

{

menu=menu+1;

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

Work in Progress

MakerTino_bb.jpg

I'm working to put it all in my "Weather Clock"