The great adventure that is building clocks continues. Points of interest in this build is that it was the first chance I got to play with the dot matrix display I picked up over winter break, and it’s the first time I’ve soldered and used a surface mount package (albeit I soldered it to a DIP breakout board so that I could plug it into a breadboard; I know, very meta).
This clock displays all of its values in binary, which means that each row, from bottom to top, is worth one, two, four, eight, 16, and 32, and as each LED is lit, you add them together to get the final value. From left to right is the current month, current day of the month, hour (twelve hour based with PM indicator top center), minutes and seconds. There is currently no way to set the time short of plugging the board into a computer over a serial port to talk to the ATMega, but since these clocks rarely last longer than a few weeks, this isn’t of much concern. Feel free to add buttons to set the date and time manually.
The time is kept by a DS3232, which is a very cool chip in that it has a built in temperature sensor, which it uses to compensate the crystal to try and keep better time, and the crystal itself is built into the package, which is an advantage since I’m using this on a breadboard, and crystals don’t seem to like the stray capacitance on the boards that much. This chip is quite a bit more expensive than the DS1307 I’ve usually been using for these projects, but both use the same address over I2C, so replacing one with the other is simply a matter of connecting the correct pins.
Also new in this project is a time lapse video of start to finish! This is me assembling all of the parts on a pair of breadboards, as well as me writing all of the source code to get it running. Total work time was approximately two hours, with a break in the middle which was edited out. Enjoy!
- ATMega168 (or any other AVR) running the Arduino bootloader ($4.32 Digikey)
- 16MHz crystal + 2 22pF caps or ceramic resonator ($0.54 Digikey) I skimped and just used a 16MHz crystal I salvaged by itself.
- 10k resistor for reset ($0.064 Digikey)
- push button for reset ($0.23 Digikey)
- DS3232 ($7.63 Digikey)
For more detail: Dot Matrix Arduino Clock using ATMega168