Binary Clock V1.0

by pdio in Circuits > Arduino

772 Views, 1 Favorites, 0 Comments

Binary Clock V1.0

IMG_20180620_174900.jpg
IMG_20180620_174906.jpg
IMG_20180620_174409.jpg
IMG_20180620_174431.jpg

Everybody loves binary clocks, especially the nerdy makers like me. In this instructable I will show you, how you can make your own binary clock using off-the-shelf and perfboard modules.

I was not satisfied with the design of the ready made binary clocks from ebay or other sources, so I made my own. It uses only one colour, and the faceplate is symmetric, which makes it look much nicer.

Supplies

Components:

  • Arduino Nano (any controller with 18 outputs and I2C)
  • DS1307 module (DS3231 can also be used)
  • 18 pcs 5mm super bright LED (I used blue ones)
  • 18 pcs 10kOhm resistor (I used SMD)
  • 18 pcs 100kOhm resistor (I used SMD)
  • 18 pcs generic diode
  • DC jack connector
  • 12V power supply
  • Small wooden box
  • Wires
  • Heat-shrink tubes (optional)
  • Perfboard

Tools:

  • Soldering iron and solder
  • Electric drill
  • Hot glue gun
  • Basic tools

Soldering the LED Board

IMG_20180621_193507.jpg

First of all you have to choose the size of your clock. Once it is clear you have to select the piece of perfboard with appropriate size. You can easily cut it to shape by marking it with a utility knife a few times and snapping it. You have to solder the LEDs in place in five columns. The columns number 1, 3 and 5 will contain 4 LEDs, while the column number 2 and 4 will contain 3 pieces. The LEDs on the perfboard should look something like this:

O--------O--------O
O---O---O---O---O
O---O---O---O---O
O---O---O---O---O

The Os represent the LED positions.

The first column shows the hours from 0 to 12 in binary. The lowest LED is the LSB and the highest LED is the MSB. The second column is the tens of minutes from 0 to 5. The third column is the remainder of the minutes from 0 to 9. The rest shows the seconds the same way as the minutes work. The next figures show the time, where Os are OFF and Xs are ON:

O--------O--------O
O---O---O---O---O
O---O---O---O---O
X---X---O---O---X
The time is 1:10:01

X--------O--------X
O---O---O---X---O
O---X---X---O---O
O---O---X---O---X
The time is 8:23:49

The connection for the LEDs is in the step pictures. All the LEDs have the same GND and VCC on their connections. For VCC you can use 5V (or 3.3V). With the 100kOhm resistor the LEDs will be very dim. If you turn the LED on with the Arduino output, the current goes trough a smaller resistance (10kOhm) and the LED will be brighter. If there is not enough difference between the dim and bright LED, you can connect the LED board VCC to 3.3V. The diode is needed in the circuit, so if your output is pulled low, the current still flows trough the LED. I hope it is clear for everybody.

To have a relatively small face I used SMD resistors on the back of the perfboard. You can use regular (THD) resistors, if you have enough space for them. Also I had to solder the diodes on a separate perfboard piece, again, because of the space. You can use SMD diodes if you have, so everything can go to one board.

Solder wires to the GND and VCC lines of the board and also to every regular diode anode. If you also want to make a separate diode board, make connections between the diode cathodes and the 10kOhm resistors.

The wires from the diode anodes will go to the Arduino outputs.

Making the Box

IMG_20180404_205144.jpg

After making the LED board of our clock, we have to choose a container for it. I chose a small jewellery box. Actually I chose the box first and made the LED board afterwards, you can do that too.

You have to mark the position of the LEDs on the front of your box. You can calculate the positions or you can use another piece of perfboard to help you. The distance between the little holes is 2.54mm, or 1/10 inch.

After marking the 18 positions on the front of the box, you have to drill the holes. I made 4mm holes, so the LEDs don't peek out, but you can make 5mm holes, so the LEDs will also be visible from side-view. You also have to drill an 8mm hole to the back of the box for the DC connector.

You can use paint or varnish on the wooden box now. You might want to remove the hinges and the lock from the box before that. Once you are satisfied with the looks, screw back the hinges and the lock.

Connecting Things Up

You will need a few wires and some soldering for this step.

You have to connect the DC connector to Arduino VIN and GND. If you will use a stabilized 5V power supply you can connect it to Arduino 5V instead of VIN.

The RTC module has 4 pins: GND, 5V, SDA and SCL. Connect GND and 5V to Arduino GND and 5V. Connect SDA to Arduino A4 and SCL to Arduino A5. If you use other microcontroller, make sure to check the I2C pins.

Connect the LED board VCC to 5V or 3.3V and GND to Arduino GND. Connect the anodes of the diodes as the following:

H1 D0
H2 D1
H4 D2
H8 D3

M10 D4
M20 D5
M40 D6

M1 D7
M2 D8
M4 D9
M8 D10

S10 D11
S20 D12
S40 D13

S1 A0
S2 A1
S4 A2
S8 A3

H1 means the least significant bit of the hours column. It is the bottom left LED. S8 represents 8 seconds, this is the top right LED.

Programming

Binary clock 1.0 halfway there

Before uploading anything, you will have to download the RTC library and my program code. After download move the RTC library to the Arduino libraries folder and the project to your projects folder. You have to start or restart the IDE after this.

Before uploading my program code, we have to write the correct time data into the RTC chip. Make sure to have a charged battery before doing this. Open the "Set time and display" example from the RTC library. Fill in the correct time values. We do not really care about the date, you can leave it as it is, or maybe fill that in too. The time values will be written to the RTC chip when we upload the code and our Arduino starts. It is important to not reset the controller. Also you can set the time one minute ahead, so your clock will not delay with the time of uploading and starting time.

Make sure to select the right port and board type before hitting the upload button.

After uploading the RTC example, you have to upload my sketch without plugging out the Arduino, as every reset will set the time given in the example. Once you upload my program, the time should appear on the LEDs. Check if everything works correctly (it should). If everything is okay, you can start putting everything together.

Finish It Up

Binary clock 1.0
IMG_20180620_174954.jpg
IMG_20180620_174913.jpg
IMG_20180620_174918.jpg
IMG_20180620_174923.jpg
IMG_20180620_174422.jpg
IMG_20180620_174957.jpg

Once you disconnect your Arduino, the clock will not forget the time until the battery of the RTC runs out of energy. You can now secure everything in place. Use hot glue, epoxy, double sided tape, screws, bolts or anything you wish.

Connect your clock to 12V (or the voltage you use) and watch it and love it. I also added a refractive layer from a monitor on the front, so the looks are better. You can also add a piece of paper, or something to achieve a different visual effect. Please share with me your ideas.

I hope you liked this instructable, and maybe somebody will find it useful. Feel free to ask questions in the comments. This instructable is in for the Colours of the Rainbow contest with its bright blue colour.