I will show you here how to easily make a simple digital clock by hacking Meggy Jr RGB. This is an Arduino-programmable device, featuring an 8x8 RGB LED matrix, a few buttons and a buzzer. Ideal candidate for an alarm clock.
The clock will use the ubiquitous DS1307 as RTC (real-time-clock). This chip can be bought on ebay or digikey/mouser for about $1.
You will ask why we need an RTC chip at all. Why can't we just count the seconds and calculate the minute, hour, day, week, month and year with the on-board ATmega328? Of course we can. We would only need to write and test a bunch of functions. But who is going to record the passing of time when the processor is not powered? DS1307 does all these for us: for only $1 or so, it counts the seconds for as along as the coin battery lasts (which is a few years) and increments the minutes, hours, days etc., and even keeps track of leap years. All we need to do to get the current time is to ask the little frugal RTC chip for it.
Here are the requirements (or the few issues to think about):
1. build a small RTC breakout board ("BOB"), according to the datasheet (basically connecting the crystal and coin backup battery to the DS1307 chip);
2. make the RTC BOB fit somewhere nicely over the Meggy Jr board;
3. connect this RTC BOB to the Meggy Jr board, as cleanly as possible, with no wires soldered to the Meggy Jr board.
This tutorial will show how I solved these minor challenges.
In the end, the Meggy Jr clock will look and work as shown in this video:
Remove these ads by
Signing UpStep 1The Parts
- DS1307 and a 8-pin socket;
- crystal (32768Hz);
- coin battery (CR1220) and a holder for it;
- a small piece of prototyping board;
- 2 pieces of 6-pin female header;
- 6-pin right-angle male header;
- a few wires.
| « Previous Step | Download PDFView All Steps | Next Step » |
2
comments
|
Add Comment
|
WyoJustin
says:
florinc (author)
says:
![]() |
Add Comment
|










































