Master Clock

mainMasterClock

About

This is a project for anyone that wants a nice big clock that’s viewable from 12 meters away or up close. You can make it as big as you want. It also incorporates a built in alarm clock that can be used as an event handler, say for a automated watering system for a garden or to remind you about that weekly meet up your meant to go to, or anything else you can connect to a relay.

Advertisment


You Will Need:

Freetronics DMD Display
•— Real Time Clock Module for Arduino (Like this one)
•— Buzzer (Optional – something loud enough to wake you up in the morning)
• Momentarily-on push button
• 2x On-Off buttons (Power one is optional)
•— Arduino UNO or Arduino compatible board
•— Proto-shield for Arduino (optional)
•— Power supply for Arduino
•— A 5VDC regulated power supply capable of 4 – 30 Amps (Optional for high brightness – Not needed for normal operation)

Construction:

diagramMasterClock

Part 1 – Electronics:

Step 1: Connect the buzzer, silence button and alarm set switch to the breadboard
Step 2: Wire one of each switches pins to ground and the buzzers GND pin to the GND pin on the Arduino (As shown in the diagram)
Step 3: Wire the other pin of the alarm set switch to D2, the silence pin to D3 and the buzzer to D4
Step 4: Connect your RTC module to the Arduino according to its type (read manufacture data – follow diagram in most cases)
Step 5: Connect the DMDCON to Arduino and plug in DMD
Step 6: For full brightness of DMD connect a 5V source to the High Brightness terminals
Step 7: If you wish to make this on a proto shield solder all parts to the shield and connect appropriately

Part 2 – Software:

First you need to install the DMD library available from here and install it in your libraries folder.
The software can be downloaded from the downloads page. This contains the basic operations for the Master Clock.
To set the time on the RTC module find lines 117 to 124 and adjust these to the current time. Now uncomment line 124 and upload to the Arduino. Now comment line 124 again and upload again. If this is not done the RTC will stay the same time.
On line 593 and 594 you set the time and days you want the alarm to occur. Line 593 is the day of week you wish it to occur. The days correspond to the numbers as follows:
1 = Sunday
2 = Monday
3 = Tuesday
4 = Wednesday
5 = Thursday
6 = Friday
7 = Saturday

Then on line 594 the set the time the alarm goes off in 24-hour time.

Advertisment


Going Further:

Adding more displays:
You can add more DMD displays the make the clock bigger. Read this for more information.
Adding more alarms:
To add more alarm add the following lines of code to the sketch:
void CheckAlarm() {
AlarmSet = digitalRead(AlarmSetPin);
Snooze = digitalRead(SnoozePin);
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year);
/* Only Trigger Alarm If it is a day listed below. This can be changed by changing the numbers to any of the following:
1 = Sunday
2 = Monday
3 = Tuesday
4 = Wednesday
5 = Thursday
6 = Friday
7 = Saturday
*/
if(dayOfWeek == 2 || dayOfWeek == 3 || dayOfWeek == 4 || dayOfWeek == 5 ||dayOfWeek == 6) { //This is days ALLOWED to ring alarm
if(hour == 18 && minute == 05 ) { //Set Time Here (In 24 hour Time)
if(AlarmSet == LOW) { //If alarm pin is on
Snooze = digitalRead(SnoozePin);
while(Snooze == HIGH)
{
Snooze = digitalRead(SnoozePin);
//Add what happens here
}
}
}
}

1 Comment for “Master Clock”

Leave a Reply

Your email address will not be published. Required fields are marked *