# Big Digit Backwards Counting Bluetooth Clock

13,112

122

8

Published

## Introduction: Big Digit Backwards Counting Bluetooth Clock

Why?
I wanted to make my own big 7-segment digits for a long time now. I had some ideas how to do them differently. During the process I came to the conclusion that the standard 7-segment display isn't that bad :) . I did have to change something so I ended up with a 29-segment digit.
I am really happy how it turned out.

What?
To play with the digits, I made myself a clock that can also be used as a timer. I want to use it as a "TED-talk" timer. For this it should count down from 18 minutes.
For an other project I need a clock that can count backwards, so this clock must also be able to do that.
Finally it would also be nice when I can use this as a normal clock. Because I couldn't figure out how and where to put the buttons, I decided to make an android app to set the clock through a bluetooth connection.

What makes this special?
I think the digits look really nice, much nicer than normal 7 segment digits. Besides the numbers from 0 to 9, this digits can also display a lot of letters:
abcdefghijklnopqrstuxyz
It can't display:
mvw
So you can create a lot of words as long as they aren't longer than the amount of digits in the clock. In my case that would be max. four letters.
The app and the bluetooth connection give it great potential for different functions and placement at out of reach locations.

Special tools
To make the digits I used a 3D-printer. I can't think of an easy way to make them by hand. With a CNC, you could probably also make them. 3D printers are not so expensive anymore. I bought mine for less than 500,- and there is a printer in development for less then 100,- (the peachy printer)
For the lenses a laser cutter would have been great, but because I don't have one, I made them by hand.
You also will need a smartphone for the Android app to set the clock.

Text vs pictures
In the text I try to explain all the steps, but you probably will understand most of the process by looking at the pictures and reading the comments in the pictures. Be sure to read those! Most of the time they explain more than the text alone.

Skills
Before you try to make this clock, you should have some basic soldering skills. (you will need to solder like 250 wires and some components) You should be able to understand a simple electronic schematic. This shouldn't be your first ever Arduino project. Some experience in 3D-drawing and printing would also be nice. When you want to ad your own functions it is helpful when you have some experience in MIT app inventor or some other skills in building Android apps.

## Step 1: You Will Need

Materials:

Electronics
• 120 3mm LED's (I used blue ones)
• 120 resistors (to go with the LED's)
• 16 shift registers (like a HEF4094BP or a74HC595)
• Wire
• Arduino
• Experiment PCB's (perfboard)
• 8 1uf capacitors
• Bluetooth module
• 10 k resistor
• 20 k resistor (or two 10 k resistors)
• some small heat shrink tubing
• 6 5mm LED's (I used 3 red, 1 yellow, 1 green and 1 green)
• 6 resistors (to go with the 6 LED's
• Buzzer
Optional
• 44 female headers
• loads of male headers
• Push button that is normally on

Digits
• Fillament for 3d-printer
• 2mm transparant acryl

Housing
• Wood
• Plastic
• screws

Bluetooth app
• Android smartphone
• MIT app inventor account

Tools
• 3d printer
• hobby-knife
• guide
• sharpy
• snipper
• drill(press)
• 3 mm drill
• computer with Arduino and 3d software
• sand paper
• file
• needle nose pliers
• soldering iron
• 5 volt power
• (hot) glue

## Step 2: The Design

I made a couple of designs. My final design is an open 8-design to safe material end print-time. I tried a design that looked nicer with rounder corners, but I couldn't get the lenses curved.

I have drawn my design in a downloaded version of 123d-design. This is free software to make 3d drawings: http://www.123dapp.com/create
I am not really a fan of the online version of this software, but the downloaded version is great. It is to bad that you need at least Mac-OS 10.7 to run the software on a Mac.

Here you can find my design:
http://www.123dapp.com/smb-123D_Design/Dgit3/2230352

It is probably more fun to make your own design, or just tweak my design.

Print the 3d STL-file on a 3d printer.
For a 4 digit clock, you will need to print the file four times.

## Step 3: The Lenses

The lenses are made from 2 mm clear acrylic.

To make the lenses
• mark a 8 mm strip of acrylic
• scour the acrylic with a sharp hobby knife
• break the 8 mm strip from the acrylic
• sand one side matt
• mark how long the lens needs to be
• scour the length
• break the lens from the 8 mm strip
• check the size
• file or sand shorter when needed
• mark where the LED will go
• snip off the corners opposed to the matt side of the lens
• push the lens in its place
• use glue if needed
The cut off corners will reflect the light from the LED upwards to light up the whole lens.

To make the corner lenses
• make a lens like shown above (make it het length of the widest side)
• sand off the corners 45 degrees (I used a belt sander but a file or sandpaper will also work)

Repeat this for al 29 lenses

## Step 4: Dril in the LED's

Drilling the holes

When you finished all the lenses and they are all in place, it is time to drill holes in the lenses so the lights can fit in this holes. The light off the LED's can spread to the snipped off corners.

It is really easy to drill this holes. Use a sharp 3mm steel drill bit.
• Turn the digit with the lenses in it, up side down
• Drill a few mm in a lens through one of the holes in the back of the 3D printed digit
• Take out dust
• Drill the same hole again to clean it out
• Push the lens out to check the hole
• Repeat this for all the holes

## Step 5: Placing the LED's

Push in the LED's

The 3mm LED's should fit nicely in the 3mm holes. Some LED's might need some extra convincing with a plier.
• Put het 29 LED's in the holes with the negative leads on the outside. (the short wire)
• Bend all the negative leads towards each other (in a big GND ring)
• Bend the negative leads from the LED's that are not on the outside also towards the other negative leads
• Be careful not to touch the positive leads with the negative leads
• Bend the leads around the corners at the corners
• Bend the four leads from the LED's in the middle part also to they follow the ring.
• The four corner LED leads and the two leads of the LED's in the middle must stick out at this moment (not the one exactly in the middle)
• Solder all the negative leads together
• Be sure that all negative leads are soldered together

This is a nice moment to check all your LED's
• Connect a ground source to one of the negative leads sticking out
• Put a resistor that goes with your LED's on a 5V power source
• Touch every positive lead, one by one with the other end of the resistor
• Check if the LED lights up and how the lens looks
• Check for dirt in the lens

## Step 6: The PCB's

Prepare the PCB's

I used the green (expensive) perfboard for this. The PCB is not difficult enough to design and etch a PCB for it so the perfboard works fine. The green perfboard is a different material from the yellow/brown one and works much better. Totally worth the extra money in my view.
The PCB will be visible in the finished product so it is also important how the PCB looks.
• Cut the perfboard just a little bit bigger than the holes in the digits
• Mark with a sharpy the hole on the perfboard
• Cut the corners (I used tongs to snip them of)
• Make sure they fit

## Step 7: The Shift Registers

The PCB design

The design of the PCB is made in free software from Fritzing. (the 123D circuit software looks promising but is as of now (4-2014) not very useful for me yet. It can's do single sided boards and I still miss a lot of parts)

Shift registers

I am using shift registers (74HC595) to address al the 116 LED's with an Arduino with only 14 digital outputs. The shift register will take a serial input over one data pin and put it out as a 8 bit parallel output. So with one shift register you can address 8 LED's. The other cool part about shift registers is that you can chain them. So with only one data out on the arduino (and a latch and a clock) I could drive all the LED's! To make it a little easier on the programming side, I didn't do that. I gave every digit their own string of four shift resistors.

Boarding the board

Now it is time to put in the electronics.
Please look at the pictures that go along with this step.
• Put a shift register in the perfboard (I used 74HC595) keep 2 or 3 holes on the bottom and 4 or 5 holes on the left
• Put the other shift register up side down above the other one. Keep 2 holes in between the two and put it 1 hole to the right from the other (this is a little deviation from my design)
• Turn the board around
• Bend all the legs from the IC's outwards
• Put in the small blue, small yellow and most right red wire
• Solder them to the legs of the IC that is directly next to them
• Put the resistor over the red wire
• Add the red wire that goes al the way to the left
• Add the resistor that goes over this red wire
• Solder this parts in place (make sure not to make a short between the resistors and the wires)
• Put in the green and the long bleu wire
• bridge the green wire on the back to the IC-pins of BOTH IC's
• Add two ground wires (the black)
• Put in the other two red 5V wires
• Bend one wire of all 14 resistors all the way back
• Put the resistors standing up with the short wire next to the IC
• Solder the long wires
• Cut the short wire short and bend it to the IC legs
• Notice that you solder 7 resistors per IC (one leg stays clear)
• Put in the last 2 black ground wires

## Step 8: Wire the Back of the PCB

Place the PCB's in the digits.
• Fit the two PCB's in their place
• Make sure that the ground of both PCB's in on the same side
• Glue the PCB's to the digit with some globs of (hot)glue

Wiring the back
• solder a (blue) wire from the still not connected IC-pin on the top PCB to the blue wire (on the front) of the bottom PCB
• solder a (green) wire from the green wire from (the front) of the top PCB to the green wire on (the front) of the bottom PCB
• solder a (yellow) wire from the third pin from the bottom IC of the top PCB to the third pin of the bottom IC of the bottom PCB
• connect an extra (yellow) wire to one of those pins. The other end of this yellow wire will go to the Arduino
• connect two (green) wires to the top end of the green wire. One wire will go to the previous digit and one to the next (or the Arduino)
• connect two (blue) wires to the top of the blue wire. One wire will go to the previous digit and the other to the next (or the Arduino)
• connect the (red) power wires from the frond of the top PCB to those of the bottom PCB
• solder on an extra (red) wire to the power wire to connect to the power of the previous digit or the Arduino

## Step 9: Wire the LED's

LED 1 to 8
• solder LED 2 to LED 5 directly to resistor 2 to 5
• put a piece of heat shrink tubing over the lead of resistor 3 if you think it might touch something
• cut the lead from resistor 1 short
• cut the lead from LED 1 short
• solder a wire from resistor 1 to LED 1
• You can directly connect resistor 6 to LED 6. A heat shrink tubing might be needed
• cut the lead from resistor 7 and 8 short
• cut the lead from LED 7 and 8 short
• solder a wire from resistor 7 to LED 7 and from resistor 8 to LED 8

LED 9 to 16
• solder a wire from resistor 9 to LED 9. Let it run around the other LED's
• solder the lead of resistor 16 to the lead of LED 16
• solder the lead of resistor 15 to the lead of LED 15. Heat shrink tubing might be useful
• cut the lead of resistor 10 - 14 short
• solder 5 wires to resistor 10 to 14
• solder the 5 wires to their LED

LED 17 to 24
• cut the leads from resistor 17 and LED 17 short
• solder a wire from resistor 17 to LED 17 and from resistor 18 to LED 18
• solder the lead from resistor 20 to the lead of LED 20
• solder the lead from resistor 19 over the leads from 20 to the lead from LED 19
• connect the lead of resistor 21 to the lead from LED 21
• cut the leads from resistor and LED 22, 23 and 24 short
• solder wires from resistors 22, 23 and 24 to LED 22, 23 and 24

LED 25 to 29
• cut the leads from resistor 30, 31 and 32 short
• bend the leads from resistor 30, 31 and 32 out of the way. We don't need these.
• connect the lead from resistor 29 to the lead from LED 29
• connect the lead from resistor 28 to the lead from LED 28
• I also connected the lead from resistor 26 to the lead from LED 26, but using a wire might also be a good idea
• cut the leads from resistor and LED 25 and 27 short
• solder a wire from resistor 25 to LED 25
• solder a wire from resistor 27 to LED 27

## Step 10: Try the Digit

Test the Digit
To test the first digit, I wired up the digit and wrote a short Arduino sketch to try it out. (this little sketch became the big sketch so it doesn't exist anymore) You can use the final sketch to test the digit. You just have to wait 10 minutes to go though all the numbers.
• The red wire goes to power
• The black wire goes to ground
• The blue wire goes to the data pin of the Arduino (pin 2 in my case)
• The white wire goes to the latch pin of the Arduino (pin 3)
• The yellow wire goes to the clock pin of the Arduino (pin 4) (if you use the final sketch to test you might want to use pin 5. Pin 4 will only go through 0 to 5 and takes 50 minutes to do so)
There are a lot of wires to connect so there is a reasonable change that I did something wrong somewhere. This is a nice moment to find and fix the mistakes.

Repeat
Now everything works it is time to make three more. So production can start!

## Step 11: The : In-between

Points in-between the digits

To make the clock complete, I designed a little part to go in-between the hours and the minutes.
The design was again made in 123D-design:

http://www.123dapp.com/123D_Design/Dgit-points/2310259

I wanted to add the usual : to the clock.
Next to that I also added a + , - , T and A.
The idea here is to use the + and - to indicate whether the clock is running normal or backwards.
The A is used to indicate the alarm is on.
The T indicates the Counter (sorry Counter is "Teller" in Dutch)

I used LED's in different colors for the different symbols. Here we use normal, simple 5 mm LED's
Simply stick them in the holes in the back
Connect the ground leads together (the short leads)

## Step 12: Connect the Digits

Put the digits in order
• When all the parts are printed and wired I putt the digits in the right order: 2 digits, the separating points and 2 digits again.
• Now we can solder the ground leads from the LED's that stick out, together with the ground leads from the digit next to it.

Connect the wires
• First connect the green wires on top together with the green wires from the digit next to it
• Do the same for the blue wires
• Do this for all the digits
• Also connect all the (red) power wires from all the digits
Adding headers
To make it a little easier to sort all the wires out I used headers for the wires
I soldered on male headers to the digits. I soldered them on is this order:
1. blue
2. green
3. yellow4
4. yellow3
5. yellow2
6. yellow1

## Step 13: Connecting PCB

Make a connecting PCB

To make a connection between the Arduino, the bluetooth module and the digits, I added one more PCB. This PCB is also some extra space for the resistors for the 6 LED's that are in-between the digits, the buzzer, the push button and the resistors for the voltage divider for the data going to the bluetooth module.

The voltage divider is only needed when your bluetooth module needs 3.3V instead of 5V. If you can take 5V on the RX of your bluetooth module, you can just forget the 10k and 20k resistors and make a direct connection across the board.

I used a standard 7 x 5 cm perfboard. This gives more than enough space for all the parts.

The push button
The Arduino uses the same serial port for the bluetooth module as for programming the Arduino. Normally you will need to disconnect the bluetooth module before you can upload a new sketch. To make this easier I added the push button that will disconnect the bluetooth wire when the button is pushed. To upload a new sketch I simply push the button while the computer is uploading.

Fill the perfboard
• First I placed the female headers (this is optional. You can also solder the wires directly to the board) I used two 2x12 headers 2x11 is big enough. The two headers are both on the opposites sides from each other and one hole shifted.
• Put in the resistors for the LED's in between the headers. The top two resistors are connected on the Arduino side.
• Solder the resistors on both sides to the headers.
• Connect all the header-pins that are next to each other.
• Solder the red (positive) wire from the buzzer to the sixth header on the arduino-side
• Solder the black (ground) wire from the buzzer to the seventh header pin on the arduino-side
• Put the 20k resistor away from the headers in the perfboard
• Solder a wire from the ground (seventh header pin) to one side of the 20k resistor
• Make a connection from the ground pin tho the header on the other side
• Solder the other side of the resistor to header pin nine
• Solder a 10k resistor from header pin nine to the header on the other side
• Solder a wire from header pin eight on the arduino side over the ground wire to pin seven on the other side
• I glued a microswitch to the side of the buzzer
• Solder a wire from pin ten on the arduino side to the switch (or other push button that is normally on)
• Solder a wire from the other side of the switch to pin eleven on the other side
• Connect pin eleven on the arduino side to pin nine on the other side

## Step 14: Wire the 6 In-between LED's

The 6 LED's that are in the piece in-between the hours and the minutes are not wired yet.
• Cut the leads for all 6 LED's short
• Solder a long wire to the positive wires of the digit next to the in-between part
• Solder a long wire to the ground wires of the digit on the other side next to the in-between part
• Solder long wires to the six LED's
• Solder the six wires from the LED's and the power and ground wires to a male header in this order:
1. ground
2. power
3. orange
4. green
5. red
6. yellow
7. grey
8. grey

## Step 15: The Bluetooth Module

Wire up the Bluetooth module

I bought a bit of a cheap module that was not on a breakout board. The TX of the module must be connected to the RX on the Arduino (pin 0) and the RX on the module to the TX on the Arduino (pin 1).
The module I have needs 3.3V of power.  This is why I made the voltage divider on the RX line.
• Solder a wire to the RX, the TX, the power and the ground pins on the bluetooth module
• Solder a male header on the other side of the wires in this order:
1. Blue (TX)
2. White (RX)
3. Red (3.3V)
4. Black (GND)

## Step 16: External Power

This clock can't be powered through the Arduino. There will come smoke out of your Arduino if you do. Trust me, I've tried.

You will need at least a 2A, 5V external power.

I used a 2A USB loader. Just cut off a USB cable and measure what is the power and what is the ground. Solder a male header to the 5V and ground wire.

## Step 17: Wire Everything Together

Wire the different parts together

The headers on the digits will go directly to the Arduino and will be put in pin 2 till 7 on the arduino. The blue wire from the digits will go in pin 2, green in 3 and the yellow in 4, 5, 6 and 7.

Make a cable with headers on both sides to connect the PCB to the Arduino.
On the PCB side the cable is wired in a different order than on the Arduino side (sorry).

On the PCB side:
1. Black (GND)
2. Purple (buzzer)
3. Orange (LED)
4. Green (LED)
5. Red (LED)
6. Yellow (LED)
7. Grey (LED's)

On the Arduino side
1. Purple (pin 8)
2. Red (Pin 9)
3. Green (Pin 10)
4. Orange (Pin 11)
5. Yellow (Pin 12)
6. Grey (Pin 13)
7. Black (GND)

The bluetooth module

The header on the bluetooth module can be put in the PCB header.

External power

Put the external power header with the ground pin next to the ground pin going to the Arduino.

Serial communication and power

To get the power and the bluetooth signal to the Arduino we need one more cable. This cable will have four leads on the PCB side and splits into two separate headers on the Arduino side.

On the PCB-side:
1. Red (5V to the Arduino)
2. White (RX from bluetooth)
3. Blue (TX from bluetooth)
4. Orange (3.3V from the Arduino)

Arduino side 1:
1. Blue (pin 0 RX)
2. White (pin 1 TX)

Arduino side 2:
1. Red (Vin)
2. Orange (3.3v)

## Step 18: Housing

Make the housing

You can make the housing however you like. I just post some pictures from how I did it, but I will not go into detail with this part.
• I cut out four planks that would surround the digits.
• I routed a groove to slide the digits in
• Painted it
• Cut a piece of acrylic to put in front of the digits
• I used perforated aluminum for the backplate
• Bolted the Arduino to the backplate
• Drilled hole for the USB-cable

## Step 19: Put It All Together

Now all parts come together
• Put the PCB and the Arduino in your housing
• Make sure there is a hole above the push-button (if you placed one) so you can use something like a pencil to push the button from the outside of the housing
• Slide in the digits and window
• When the digits are half way in, you put the cable from the in-between LED's in the header on the PCB
• Slide the digits all the way in
• Put the cable coming from the digits in the Arduino
• Test the clock
• Close the housing

## Step 20: The Arduino Sketch

This code isn't perfect yet, but works pretty good. If you made a better code, please send it to me!

To upload the sketch you need to disconnect the bluetooth module or push the button on the clock while uploading.

The file contains a folder that you should put in the "Arduino" folder in your "documents" folder.
Then you should restart (or start) your Arduino software. You can find the sketch (program) in the "sketchbook" under the pulldown "file" menu.

Some binary
To make the numbers and letters on the clock you need to do some binary-calculating:
void twee(int clockPin){
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 2);
shiftOut(dataPin, clockPin, MSBFIRST, 232);
shiftOut(dataPin, clockPin, MSBFIRST, 62);
shiftOut(dataPin, clockPin, MSBFIRST, 18);
digitalWrite(latchPin, HIGH);
}

This is the code to make one number. In this case it is a two. The numbers: 18, 62, 232, 2 make the digits. They are put in backwards.

The digits are build up like this:

_  _  _              1     2     3
|/         \|      18 22          23 4
|           |      17                     5
|\_ _ _/|      16 25          24 6
|/         \|           19   20   21
|           |      15 26          27 7
|\_ _ _/|      14                     8
13 29          28 9
12  11  10

These 29 LED's are divided in 4 bytes from 8 LED's each.
The first byte is LED 1, 2, 3, 4, 5, 6, 7, 8
The second is LED 9, 10, 11, 12, 13, 14, 15, 16
The third is LED 17, 18, 19, 20, 21, 22, 23, 24
The last is LED 25, 26, 27, 28, 29

To make a digit we need to see witch LED's we want to turn on.
For the 2 this is LED 2, 5, 10, 11, 12, 13, 14, 20, 22, 23, 24, 26

So in the first byte this is LED 2 and 5. We have to write this in binary:
01001000
The first bit is worth 1 the second 2 the third 4 the fourth 8 and so on. The bits will be worth:
1 2 4 8 16 32 64 128
So if we add the worth of the 2th en the 5th bit, this will be 2+16
The number to enter will be 18
They will be entered in the chips backwards so you can see in the code that 18 is the last value pushed to the chips.

## Step 21: Android App

Build an App to set and control the clock

I used App inventor 2 to build the App. This program is easy to learn.

If you try to use the app while the USB-cable is connected with your computer, you first need to open the [serial monitor] first for the app to work.

The files attached are the APK file that you can upload to your smartphone and the AIA file that you can change yourself in MIT app inventor 2.

How to use the App

Connect
Push [connect to clock]
Select the name of the bluetooth module
The App should say "connected" and the [connect to clock] button should be gone

Set the time
Select the [hour]
Select the [minute]
Push [mode] and select [set time]
*new set time will appear on the clock*
*points will blink on 1 sec, off 1 sec*

Go back to clock mode from an other mode
Push [mode] and select [clock]
*time will appear on the clock*
*points will blink on 1 sec, off 1 sec*
*the + will show that the clock is normally counting*

Count down
Select the amount of hours to count [hour]
Select the amount of minutes to count [hour]
Push [mode] and select [count down]
*the starttime will show on the clock*
*points are off*
*T will show for counter*
*- will show for counting down*
To start counting down [start]
*the clock starts counting down*
*points are on*
To stop counting [stop] -the counter will start again at the whole next minute down so you can loose a minute this way-
*the clock stops*
*points are off*
To reset back to the set time [Reset]
*the clock shows the initial starttime again*
When the counter reached zero it will say "StOP"

Counter
The counter works the same as the countdown. It will just not show "stop", because it will not reach zero.

Backwards Clock
The backwards clock is a kind of backwards timer that can't be stopped like the counter and it will start over at 23:59 when it reached 00:00.
To set the starttime you select the start [hour] and [minute] and select [backwards clock] from the [mode] menu.
*the clock will show the starttime and start counting down*
*the - will show*

Alarm
To set the alarm you select the [hour] and [minute] the alarm should sound.
Select [set alarm] from the [mode] menu.
*the set time will show for a brief moment on the clock*
Check the alarm checkbox
*the A will show on the clock*
When the A doesn't show, just decheck and check again.
*the alarm will sound at the selected time for 1 second*

huh?
The [huh?] button will show "huh?" on the clock.
*shows "huh?" for four seconds*
When used as a "TED-talk" timer the public can show that they don't understand what there is said.

## Step 22: The Finished Clock

It still smells like paint and sometimes it doesn't do exactly what I want, but I am pretty happy with the result!
Tell me what you think.

## Recommendations

• ### 3D CAM and CNC Class

562 Enrolled

• ### Casting Contest

We have a be nice policy.
Please be positive and constructive.

## 8 Comments

made IT!!!

3 replies

Yeah great job! I'm impressed!

Thanks to you.. I can now cpmplete my microprocessor project.... But did you edit the code? The hour command is not functioning properly
....

I build it as a timer and a backwards counting clock for a camp-weekend, but I didn't have problems with the hour command. I just updated my mac to Yosemite and now I don't get Arduino working yet, so I can't see what's wrong... Can you tell what isn't working? So I can check when I get Arduino working again.

Very unique design of segment display, hope to see more from you :D

Great, but a lot of work. I would use some bcd-7 segment converter

2 replies

That would definitely be much easier, but what is the fun in easy? :)

:-)