Instructables
Picture of Digital/Analog Clock - Arduino + PaperCraft
D-A_clock2.jpg
IMG_2499.jpg
In this instructable we will be recreating a clock inspired by Alvin Aronson's original design. When I first saw this clock I was very impressed by how clean an elegant the design was I immediately wanted to recreate this effect.

Alvin Aronson's original design (made with corian and wood):

I hope some of you feel the same and use this as a guide to be one-step closer to having one of your own

Essentially, we have a seven segment clock where instead of LED's we have digits moving in and out of the pane, the shadow created by these digits will allow the user to read the time against the white on white digits. By using 28 servos, we can use a arduino to first process the current time and then push the digits out accordingly through the motor controller. more will be explained in the later pages.

I've tried to keep the parts as simple as possible, using readily available parts without a deep knowledge of electronics one can begin to explore creating their own clock. I do not have 3D printer so construction will be done by way of papercrafting.
 
Remove these adsRemove these ads by Signing Up

Step 1: Gather your materials

Picture of Gather your materials
IMG_2562.jpg
IMG_2560.jpg
IMG_2517.jpg
IMG_2502.jpg
IMG_2523.jpg
Here are the things you'll need. I intended to fit this in the "kit contest" category so i've limited the build to simple parts without need for soldering. Alternatively. Arduino Uno and motor-controller can be replaces with Arduino Mega which wall allow direct control of up to 64 servos. The build costs cost me around $130 in parts. Keep in mind you can reuses the parts to create other great projects like a Hexapod!

The Electronics Kit :
Arduino Uno
DS1307 or RTC clock breakout- keeps track of time
Servo motor controller - controls servo motors
28 Servos - they rotate 180 degrees

Construction:
Cardstock
Hobby aluminum tubing* - To allow digits to slide smoothly ; need a inner and outer tube
Double sided tape
Sticky Pads
Paper Clip

*Or use a pack of cheap lead pencils

Tools:
Papercutter - Shiloutte Portrait (optional)
Glue Gun
Dremel - to cut tubing (optional)
Knife (optional)



Step 2: Test the electronic parts

Picture of Test the electronic parts
IMG_2517.jpg
ssc32 arduino.jpg
images.jpg
Servos
So you have a lovely ball of servos now. Better test them first. (One of mine were defective)

Connect the SSC-32 to the arduino using the attached picture as a guide
http://marc-tetrapod.blogspot.ca/2012/10/arduino-ssc-32-servo.html

RTC
What the RTC allows you to do is keep track of time using a  small lithium battery. Any system [Your computer and your phone] with a clock will have one. This is the most used way to keep track of time when things are powered on/off constantly. We will hook up this circuit later on in this instructable

Step 3: Design the clock

The following pieces were designed in Adobe illustrator. With the intention of being cut onto paper. If you're using a 3D printer you'll likely have to use different methods but the basic idea will be the same. Also please share your designs:)

We have 6 layers:
[01] Front Face - Clock Face 
[01] Front Face - Segment face 
[02] Front Shield - Holds Tubing 
[03] Base - Holds Servo + Tubing
[03] Base - Holds Servo + Tubing
[04] Back Shield - Holds Servo 

Note: some files will need to be cut twice. see above for ordering details

Step 4: Cut out the pieces

The following pieces were designed in Adobe illustrator and cut with a Shiloutte Portrait. If you feel like you have the time you may want too cut out these layers by hand.

The metal rods were cut using a dremel. I cut the bigger tube 1cm and the one that slides inside it to 2cm

Step 5: Construction

In this step you will put the layers together using a padded double sided adhesive to construct the body. Use the images to guide you through this process 

Note: Metal tubing is inserted into each segment

Step 6: Add the digits

Front Steps:
-Place inner tubing in outer tubing
-Apply Glue
-Place front facing piece
-Repeat

Back Steps:
-Cut and bend paperclip as shown in pictures
-Apply Glue
-Insert
-Bend
-Repeat

Step 7: Add the servos

Picture of Add the servos
Attach servos to the paperclips we added in the previous step. the frame will ensure that the servos wont slip. You may use glue if you wish.

Step 8: Finish contruction

Picture of Finish contruction
IMG_2637.jpg
IMG_2635.jpg
Add the last layer (the back shield)

Step 9: Wire up electronics

Picture of Wire up electronics
IMG_2546.jpg
download.jpg
Servo Controller
  1. There are 32 pins on the SSC-32 controller, plug your 28 servos in make sure you go in order.
  2. Connect the RX pin to the TX pint on the Arduino
  3. Connect the ground pin to Arduino Ground pin
RTC [DS1307]
For more information http://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/overview
  1. Connect 5V to Arduino 5V
  2. Connect GND to Arduino GND
  3. Connect SDA to Arduino analog pin 4.
  4. Connect SCL Arduino analog pin 5.

Step 10: Programing

Algorithm

Main Loop
  1. Retrieve time from RTC module (in Hour and Minutes)
  2. If time is different Display Time
  3. Repeat
Display Time
  1. Split time into four digits. (using modulo/div 10)
  2. For each seven segment display, Move segments out to display digit
Display Digit
  1. Place decoder logic. Translate int into seven segment ordering.
  2. Move needed servos from X degree.  Move unneeded servos Y degrees ( Where X is the out position and Y is the position of the plane.
Sample

#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 RTC;

short segA = 0; //Display pin 14
short segB = 1; //Display pin 16
short segC = 2; //Display pin 13
short segD = 3; //Display pin 3
short segE = 4; //Display pin 5
short segF = 5; //Display pin 11
short segG = 6; //Display pin 15

short segA_OUT = 110;
short segB_OUT = 110;
short segC_OUT = 110;
short segD_OUT = 110;
short segE_OUT = 110;
short segF_OUT = 110;
short segG_OUT = 110;

short segA_IN = 90;
short segB_IN = 90;
short segC_IN = 90;
short segD_IN = 90;
short segE_IN = 90;
short segF_IN = 90;
short segG_IN = 90;

int TIME = 2000;

DateTime datePast;
DateTime dateNow;

//house keeping
void setup() {
  Serial.begin(9600);
  Wire.begin();
  RTC.begin();
  RTC.adjust(DateTime(__DATE__, __TIME__));
  datePast = RTC.now();
}

//main loop
void loop() {
  dateNow = RTC.now();
  if(!(datePast.hour() == dateNow.hour() && datePast.minute() == dateNow.hour() ))
  {
    displayNumber(dateNow.hour()*100+dateNow.minute());
    datePast = dateNow;
  }
}

//Given a number, we display 10:22
//After running through the 4 numbers, the display is left turned off
void displayNumber(int toDisplay) {
  for(int digit = 4 ; digit > 0 ; digit--) {
    lightNumber(toDisplay % 10, digit);
    toDisplay /= 10;
  }

  //start movement
  Serial.print(" T");Serial.println(TIME);
}

void move(int servo, int position) {
  Serial.print("#");
  Serial.print(servo);
  Serial.print(" P");
  Serial.print(position);
}

//Given a number, turns on those segments
//If number == 10, then turn off number
void lightNumber(int numberToDisplay, int segment) {

  int offset = (segment - 1)*7;
  switch (numberToDisplay){

  case 0:
    move(segA + offset, segA_OUT);
    move(segB + offset , segB_OUT);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_OUT);
    move(segE + offset , segE_OUT);
    move(segF + offset , segF_OUT);
    move(segG + offset , segG_IN);
    break;

  case 1:
    move(segA + offset , segA_IN);
    move(segB + offset , segB_OUT);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_IN);
    move(segE + offset , segE_IN);
    move(segF + offset , segF_IN);
    move(segG + offset , segG_IN);
    break;

  case 2:
    move(segA + offset , segA_OUT);
    move(segB + offset , segB_OUT);
    move(segC + offset , segC_IN);
    move(segD + offset , segD_OUT);
    move(segE + offset , segE_OUT);
    move(segF + offset , segF_IN);
    move(segG + offset , segG_OUT);
    break;

  case 3:
    move(segA + offset , segA_OUT);
    move(segB + offset , segB_OUT);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_OUT);
    move(segE + offset , segE_IN);
    move(segF + offset , segF_IN);
    move(segG + offset , segG_OUT);
    break;

  case 4:
    move(segA + offset , segA_IN);
    move(segB + offset , segB_OUT);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_IN);
    move(segE + offset , segE_IN);
    move(segF + offset , segF_OUT);
    move(segG + offset , segG_OUT);
    break;

  case 5:
    move(segA + offset , segA_OUT);
    move(segB + offset , segB_IN);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_OUT);
    move(segE + offset , segE_IN);
    move(segF + offset , segF_OUT);
    move(segG + offset , segG_OUT);
    break;

  case 6:
    move(segA + offset , segA_OUT);
    move(segB + offset , segB_IN);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_OUT);
    move(segE + offset , segE_OUT);
    move(segF + offset , segF_OUT);
    move(segG + offset , segG_OUT);
    break;

  case 7:
    move(segA + offset , segA_OUT);
    move(segB + offset , segB_OUT);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_IN);
    move(segE + offset , segE_IN);
    move(segF + offset , segF_IN);
    move(segG + offset , segG_IN);
    break;

  case 8:
    move(segA + offset , segA_OUT);
    move(segB + offset , segB_OUT);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_OUT);
    move(segE + offset , segE_OUT);
    move(segF + offset , segF_OUT);
    move(segG + offset , segG_OUT);
    break;

  case 9:
    move(segA + offset , segA_OUT);
    move(segB + offset , segB_OUT);
    move(segC + offset , segC_OUT);
    move(segD + offset , segD_OUT);
    move(segE + offset , segE_IN);
    move(segF + offset , segF_OUT);
    move(segG + offset , segG_OUT);
    break;

  case 10:
    move(segA + offset , segA_IN);
    move(segB + offset , segB_IN);
    move(segC + offset , segC_IN);
    move(segD + offset , segD_IN);
    move(segE + offset , segE_IN);
    move(segF + offset , segF_IN);
    move(segG + offset , segG_IN);
    break;
  }
}


Other
You will also need to set you RTC clock the first time. this will give it a starting time equal to the one on your computer. YOu will need the RTC library to run the following code.

#include
#include "RTClib.h"

RTC_DS1307 RTC;

void setup () {
    Serial.begin(57600);

    Wire.begin();

    RTC.begin();
  
    if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    RTC.adjust(DateTime(__DATE__, __TIME__));
    }
}

Step 11: Finish

Picture of Finish
So that's it. I hope you've learned a lot through the process and that your clock turned out well. I will be updating this instructable as I make minor adjustments

If you like me please support this instructable by voting. Thank you for reading!
1-40 of 90Next »

That is an insane amount of very small servos. Nicely done.

ddobier1 month ago

this is awesome. Can you tell me how loud the servos are when the time changes? Is love to put in my living room but would need it to be very quiet. Thx!

maxiuck6 months ago

top!

brillante:)

Holunderwunder11 months ago
Hi alstroemeria,
Is there any chance of getting the complete code? I am not so proficient in writing arduino sketches, so it would be a great help. Currently, I cannot see how all the 28 servos are controlled. Before I start to buy all the necessary parts, I want to be sure that everything will work efficiently.
Thanks for your help in advance!

i beleve the code here is the complete code

the servo's are moved by setting the position in the setup (90 in and 110 out)

and then calling it in the switch (numberToDisplay){

i beleve the code here is the complete code

the servo's are moved by setting the position in the setup (90 in and 110 out)

and then calling it in the switch (numberToDisplay){

paulsquitt9 months ago
Hi alstroemeria

is there a way to have this dispaly 12 hour tme instead of 24 hour. Im not very good with the programing end of things so i was wondering if it is even possible to do this but i was thinking of putting a dot in the upper right hand corner that move in and out to show the differents between AM and PM.
jgoodband1 year ago
Love this instructable, definitely my personal favourite. I'd still be really interested to get the code you used to make this clock - or maybe just some guidance on good sites to learn how to recreate the code required? Thanks
masonson1 year ago
非常有创意 惊叹了
anachum1 year ago
what do you do with the serial connection on the SSC board? how does it connect to the arduino?
anachum1 year ago
Hi, this is awesome! can you send the completed code please? tnx
ASCAS1 year ago
That's a really cool clock! Have you considered adding magnetic coils & neodymium magnets.
Wo0kiE1 year ago
I think the pic says it all
shutupandtakemymoney.jpg
Arghus1 year ago
i would love to see one made of wood..
thanks for sharing
yaly1 year ago
I'll be using stationary magnets and coils on the back of the segments as servos will be noisy and here in Egypt the cheapest servo is 80 pounds (around 13 USD) that is alot when 28 servos.
mcadet1 year ago
I really love this idea... I've kinda been stalking this instructable since you posted it... All the comments and ideas are great...
Great work... Looking forward to future improvements while I start on mine
DillyDog1 year ago
Hi Again
Is there any chance of posting the code?
alstroemeria (author)  DillyDog1 year ago
Sorry didn't see this. I've been quite busy with work but i'll definitely be putting up the refined code and other updates late August if not, early September before school starts.

If you have any questions before then just message me
Thanks very much, I look forward to it.
Henkie1 year ago
Hello alstroemeria,

You describe here the programming steps but not the actual code.
I'm not much as a programmer, can jou upload the code?

Thanks,

Henk
alstroemeria (author)  Henkie1 year ago
Sorry didn't see this. I've been quite busy with work but i'll definitely be putting up the refined code and other updates late August if not, early September before school starts.

If you have any questions before then just message me.
Hello alstroemeria,

Thanks for the reply, I will check your instructable again in september.
I'm looking foreward to it.

Thanks,

Henk
BrenBren1 year ago
Alderin, If the solenoids are small enough, I imagine you could just use a basic transistor for each one, like a pn2222 or something? I know that's enough to protect an Arduino from the inductive load of a toy motor or 5v relay. At ~$0.15 each, it would definitely be affordable...
Douwe 661 year ago
This is what I thought of with two coils for a solenoid. What do you think?
solenoid.PNG
If the magnet is limited in travel to half the length of the coil, only one reversible coil is needed: The magnet will seek either the center of the coil when the coil matches the polarity of the magnet, or the end when the coil polarity is opposite. Forcing the magnet to stop before passing the center of the coil, with a plug of some sort, will ensure it moves one direction when moving to the end of the coil.

Your design reminds me of a multi-coil solenoid design I pondered that made the solenoid multi-positional: If a stack of coils are energized in the same direction, they magnetically act as one coil, so energizing two sets opposite each-other, the magnet will seek the spot between the opposing sets of coils. That's the theory anyway, and would allow for as many positions as coils in the stack. Combined with a decoder-driver and some kind of positional feedback, it could act like a linear servo (without all the gear noise). Drawbacks: it would take a lot of power compared to a servo, and it would be very electrically noisy instead of audibly noisy.
SDX42 Alderin1 year ago
What you want and attempt to do there is called a bistable solenoid.

These exist in two different types:
- You have one coil, that has a gap at some point in the middle. This cap is filled with a constant magnet. The polarity decides the direction then.

- You divide it into two coils, with a gap in the middle for a constant magnet. This design is _very_ practical since it doesn't require a H-bridge in order to control it in both directions.

Both designs are used the following way: you apply power and the plunger moves into the desired direction. Once the power is off, the solenoid will keep the position! Hooray, this is what we need.
Winding solenoids isn't as hard as many might expect, I'm about to write a Instructable which also goes through the different designs.
SDX42 SDX421 year ago
I couldn't find a good picture except this one. It's german, but you should understand it in combination with my description above:
http://www.magnetbasics.de/hubmagnete/bistabil.gif
Alderin SDX421 year ago
Very nice! Metal plunger instead of a magnet plunger, a toroid magnet for the center, and a metal tube for plunger limit. The limit part might be a little difficult to scale down, but the single-direction ability of the coils greatly reduces driver complexity.

And I quite agree that winding solenoids is pretty easy to make it functional. I make things hard for myself by also trying hard to make it look smooth and uniform. While this can improve efficiency somewhat, the added time and effort is well beyond the improvement percentile. I just get OCD about my coils. :-)
Krayzi991 year ago
Very neat! Reminds me of those piston-based minecraft digital clocks.
Douwe 661 year ago
@ Alderin

This way you would need 5 H-bridges to control 25 coils ;)
H-bridges.PNG
Douwe 661 year ago
@Alderin
I think that it will be more expensive to make and populate all the circuit boards than buying the servo's.
Another solution might be to use two coils, one for backward motion and one for forward motion, but then you need 56 coils...

I have also been thinking for some time now to find a less-servo-ish approach. What came to my mind was a solution where one only would need 5 servo's. By using "encoder wheels" with 10 places that set the 7-segments on/off for every digit.
I'm working on a design for that at the moment. It will be more challenging because of the mechanics, but I think I like this approach.
I'm not quite sure how you'd get 5 servos to make this happen, but I'd love to see the design. I hadn't considered mechanical encoding, but it led me to wonder if I could use simple selection circuitry to drive more than one coil with an h-bridge. This would drop the cost considerably, and a "7 segment h-bridge" might be good for other projects.
mr fat1 year ago
Awesome!
ecochran31 year ago
Just thinking out loud, here, but perhaps a better (more cost effective) way to approach this project might be to use some small magnetic strips on the back of the digits and use the Arduino to control electromagnets to either attract or repel the strips?
rf1 year ago
Wow!

Very thought provoking. Brute force!

Looking forward to the video.
rf rf1 year ago
Judging from the comments everyone's running off to build many different weird clocks.

Well done!
perfo1 year ago
Nice idea I like the look of it. As a thought you could do this with four servos each one with seven card cams on with each cam controlling one segment of one digit. That way as the servo rotated the seven segment display would count from zero to nine.
Another idea would be to put all 28 (4 digits X 7 segments each) cams on the same shaft and rotate it with one servo. The problem with this would be you have to split the 180 rotation in to 720 ( 12 hours x 60 mins) individual segments to 4 per degree. You could use a 360 servo and make this a bit easier or even replace the servo with a cheap steeper motor borrowed out of printer. Anyway good work and great idea... thanks..
majeral1 year ago
WOW, I sure my "tecno memory card" in my old brain was still working....lol like this but could not do it be fore I die and go to the recycle bin..
Alderin1 year ago
What a fun project!
28 servos is a lot of servos for a clock though, if I had that many servos around I'd make a 4DOF per leg hexapod instead, but that's me.

The clock could also be done with homebrew solenoids instead of servos, and with a little creative source/sink transistor work, it could run completely from an Arduino Uno (or compatible) using multiplexing. Maybe a thicker 'face' for opacity and LED backlights.

Hmm, now I want to go do that. First step would be the "homebrew solenoid" I mentioned. I've made them before experimentally from straws and paperclips and neodymium magnets... hmmmmmm....
1-40 of 90Next »