Clock in a Box

A gift real special, so take off the top / Take a look inside--it's my clock in a box

Similar projects worth following
Very simple digital clock built with some stuff I had laying around. Will run off of 9-12VDC or a 9V battery. I used an Arduino Pro Mini because I didn't want to think too hard about running two I2C devices on an ATtiny85-based device.

I'll post some sort of schematic or Fritz later if someone cares.

This clock is made to run on either 9-12V DC input. It features a battery backup.

The two 1N4007 diodes are run from the positive voltage of each input to the VIN in of the Arduino. Whichever input has the highest voltage "wins". The 1N4007 will work fine at 1A, but probably not a good idea to try a stronger current w/ these diodes. A 0.1uF ceramic cap between VIN and GND is for protection when one of the power sources is removed.

There are no batteries in the pictures at the moment, because seemingly you need a bit more than 6V to run both the Arduino and the LED display--I only had one 2x CR2032 battery holder on hand and was too lazy to wire up a 3rd coin cell in series.

You could use a 9V battery coupled with a 12V DC input if your box is large enough. I'm not sure exactly what voltage is necessary to make this work, except that 6V is not enough and anything over 12V is too much.

The source code is on GitHub at boneskull/arduino-clock-in-a-box. I've made some modifications to it that haven't been tested, so it may need some tweaking. A caveat to note is that 12:01 AM will display as "1"--need to spend more time with the Adafruit_LEDBackpack lib and figure out how to pad with 0's.

Software Libraries


  • Soldering iron
  • Drill press
  • Wire cutters
  • Wire strippers

  • 1 × A000088 Arduino Pro Mini 5v 16MHz
  • 1 × DS3231SN Module Clock and Timer ICs / Real-Time Clocks
  • 1 × ADA881 Electronic Adafruit 0.56" 4-Digit 7-Segment Display w/I2C Backpack - RedComponents / Misc. Electronic Components
  • 2 × 1N4007 Discrete Semiconductors / Diodes and Rectifiers
  • 1 × 0.1μF Ceramic Capacitor

View all 12 components

View project log

  • 1
    Step 1

    The inner dimensions of the box I used: 64mm x 50mm x 44mm with roughly 8mm leeway when adding the top. I probably could have used a smaller box, but it's especially difficult to cram everything in there when including batteries and a holder. So, your mileage may vary.

    The first step should be to take the board, Arduino, headers (maybe affix them with some Scotch tape), display, module, and whatever battery you will use (if any), and see if you can jam them in the box you want to use. Remember, there will also be some wires which can get in the way, so leave a little room for fudging.

  • 2
    Step 2

    In order to access A4 and A5 of the Arduino, you will need to solder two (2) headers onto the board (at least on my version). I used male right-angle headers to save space.

  • 3
    Step 3

    To Be Cont'd

View all 3 instructions

Enjoy this project?



davedarko wrote 05/31/2015 at 18:21 point

Your git link has an i in the box.

What are the diodes for?

  Are you sure? yes | no

Christopher Hiller wrote 05/31/2015 at 21:51 point

Thanks for the heads-up.  I added an explanation in the project details about the function of the diodes.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates