Electronics, 3D printing and mechanics: STEP CLOCK 5


Description

I have been wanting to use some stepper motors to design a clock for a long time, and finally I could find some time and IT IS HERE!

It uses two steppers to move hour and minute hands independently with 3D printed concentric shafts, while one Arduino compatible board controls everything.

For me, there were two big challenges; designing the concentric shafts and the position detection system. I spent quite some time thinking about the design before the first approach. Then, when I printed the first version, I decided to change some major things to make it easier to assemble. Finally, after a couple of prints and tests, I’m quite satisfied with this final version. It uses two hall sensors to know where the initial position is and a concentric shaft system with bearings. It also uses a real time clock module to keep track of the time when it loses power, so you only have to set it the first time or when changing batteries.

You’ll find different “faces” (covers), so you can choose the one you like the most or have different models ready for swapping them depending on the occasion.

In addition, they are stackable, so you can print a couple of them and create some unique layouts and keep track of different time zones!!

Printing settings

All parts print without supports. The body is a long print (about 6-7hours). I decided to design it with 1.6mm wall so it prints with 4 perimeters (on 0.4mm nozzles).

I used PLA and printed all parts (except body) with 0.2mm layer height (body 0.3mm) and “standard” settings (3-4 perimeters and around 20% infill).

For the cover, there are two versions, the “normal” cover is supposed to be printed at 100% infill. On the other hand, the cover_infill part, is designed to be printed with different infill patterns and no top layers. Tinkering with the slicer settings, you can get some awesome original designs! With Simplify this is really easy to do, but if you’re using some other slicer you’ll need to change your printing settings accordingly.

Parts and components

In addition to the printed parts, you’ll need:

Code

The Arduino program comes with the stl files and last version can be downloaded from my github repository.

NOTE: Bear in mind that at the time of the release, the code is in beta version. It works but it may have some bugs/errors. Visit my github for latest updates.

You’ll need three libraries: RTClib, Accelstepper and wire.h that is already included with Arduino IDE.

First time use

The first time you use it, uncomment one of these two lines:

  • //rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));//this sets time manually
  • //rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));//this sets time based on the compilation time of the computer

Once time is set, comment again and reupload the sketch. After the time is set for the first time, the RTC module will keep it synced as long as it has battery. If you change the battery, you'll need to uncomment this again. Batteries on the RTC clock module should last long enough.

Calibration

You’ll also need to calibrate the zero position. The code works like this: first minute motor moves until it detects the magnet and then hour motor does the same. At this moment, calibration of zero position (12 o’clock) has to be done. You have two ways of calibrating, with code or manually. The code is set to adjust them manually by default but you can change it commenting or uncommenting these lines:

  • //Code calibration, change these values if necessary
  • stepperMin1.runToNewPosition(3675);//Manual calibration, change this value to achieve 0 position stepperHour1.runToNewPosition(3900);//Manual calibration, change this value to achieve 0 position
  • //Manual calibration, comment if you are using code calibration or hands are already in place
  • Serial.println("Insert minute and hour hand on the 12 o'clock position, you have 20 seconds");
  • delay(20000);//Time to put the hour and minute hands on the correct position, you can change it

With manual calibration, the code pauses (20 seconds by default) to give you time to insert the hands in the correct place (12 o’clock).

With code calibration, the minute and hour motors move “some steps” (3675 and 3900 in the exemple) until they reach the o’clock position. These “some steps” is what you may have to change if necessary.

Just bear in mind that to make one complete turn, the stepper motor has to move 4096 steps. If you need half turn, then correct the zero position with 2048 steps, a quarter with 1024 and so on.

If you find yourself with the motor turning counter-clockwise, just add a minus (-) before the steps. For instance, -4096 will move one turn counter-clockwise and 4096 clockwise or vice-versa depending on your connections.

If you like it please click “like” to support my work and don’t forget to post some pictures of your print!!

Watch the video in action!!

⇓ Download Makit's Step Clock stl files from MyMiniFactory

 

ASSEMBLY INSTRUCTTIONS

Step 1

Solder some jumper cables to the hall sensor. Bear in mind pins.

hall_sensor_pinout

makit Step Clock Step1

Step 2

Insert 4 bearings into supports

makit Step Clock Step2

Step 3

Secure the 3 or 4 magnets into their holes. You can use a drop of glue. You can use one or two magnets in the gear.

makit Step Clock Step3

Step 4

Use two M3x10mm countersunk screws to secure minute bearing support to base

makit Step Clock Step4

Step 5

Insert minute axle

makit Step Clock Step5

Step 6

Mount minute motor support with two M3x10mm countersunk screws and nuts

makit Step Clock Step6

Step 7

Fix hour bearing-motor support with two M3x10mm countersunk screws and nuts and insert hour axle

makit Step Clock Step7

Step 8

Insert minute gear into the motor shaft and screw both motors into place with two M3x16mm and two M3x35mm screws and nuts

makit Step Clock Step8

Step 9

Insert hall sensors into their holes and secure them with a drop of hot glue. Bear in mind that hall sensors work depending on the magnet poles, so if they don't work, maybe you just have to insert them the other way around.

makit Step Clock Step9

makit Step Clock Step9_2

Step 10

Mount Arduino base to structure with two M3x8mm screws

makit Step Clock Step10

Step 11

Screw the Arduino board to the Arduino base with two to four M3x8mm screws

makit Step Clock Step11

Step 12

Mount the two drivers with three M3x16mm screws and nuts

makit Step Clock Step12

Step 13

Follow the connection instructions

 makit Step clock connections

Step 14

Secure the RTC module to the structure with two small self-tapping screws

makit Step Clock Step14

Step 15

Organize the cables with some straps. I strongly suggest you try your connections first by uploading the code, so you don't have to re-organize the cables.

makit Step Clock Step15

Step 16

Insert face into the body and and secure the structure to the body with two to four M3x12mm screws and nuts

makit Step Clock Step16

Step 17

Upload the code to the board, follow the calibration instructions (read above for code instructions) and insert the hands.

And that's it, your clock is finished!! 

Step clock bedside table

If you want to stack them, just use the two bottom and side holes and some screws to hold them together.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

5 thoughts on “Electronics, 3D printing and mechanics: STEP CLOCK

  • Anthony Johnson

    Hi. A question please about this project. All other tutorials I find for the Hall effect sensor A3114 use a 10k pull-up resistor between the data and VCC pins. Is this required in your circuit? Thanks

    • makit Post author

      Hi Oscar!
      You’ll have to modify the Arduino code. In my case the motor has some gear reduction and I’m using 8-step sequence, so I need 4096 steps per revolution.
      If you have a 200 steps per revolution motor, you’ll need to adapt the code and change a couple of things. You have to look at my code and change all calculations I do with 4096 to fit your motor.
      Hope that helps!
      Best
      makit