Project idea: Clock with stepper motors

Hi all,

I have an idea for a project, which I would like to explain to you. Feedback, ideas for optimization etc. are welcome!

My idea:

  • Make a clock, with 3 separate scales for hours, minutes and seconds
  • Each scale should be less than 360°, e.g. 240° for hours, 120° for minutes and 180° for seconds
  • As motor I would like to use 28BYJ-48 stepper motors (or stepper motors from scrap CD- or floppy drives)
  • In order to run 3 stepper motors with an Arduino uno, my idea was to use the CNC-shield
  • To be able to use the CNC shield, I need to adapt the 28BYJ-48 to bipolar. This should be easy, if a look to youtube.
  • For now, I do not know, if DRV8825 or A4988 will be the better driver. Is any experience available here?
  • The CNC shield has endstop pins, so I can use e.g. photoelectric barrier with additional hands / flags, which I place behind the scale (between scale and motor. Hope it is clear, what I mean). So I will get a zero position
  • I hope, that using the CNC shield w/o GRBL is possible. Using G-code is not preferred from my side
  • Unclear for me: How to connect a RTC DS3231modul, if the CNC shield is installed. Is this possible?

Right now, I have no experience with Arduino at all. And I have not bought any hardware right now. So if you have any suggestions for improvement, they are welcome.
Writing code: Last time I wrote code is already 15 years ago. Normally I search the net, try to understand other scripts and then copy, paste and adjust parts of this scripts to my project.

For now that´s all. Hopefully I will get some ideas for improvement!

May be you should put that project aside and start from the beginning and build up expertise with the Arduino environment, C++, libraries, common components like motors, steppers, buttons, LEDs, RTC,... etc...

Sorry, that I forgot to mention this: Yes, before I start building the clock I will of course start with the Arduino-Basics and let blink a LED etc. But I have a technical background. I studied precision engineering > 20 years ago, but my focus was more mechanics than electrics and IT-stuff.
I would lik to plan my project a little bit and therefore it would be fine to get some feedback on the ideas.

One problem with that stepper motor is that it has only 64 steps which may be a problem getting the resolution you want. 60 steps in a minute or hour would be nearly a whole revolution. Even if you use a modern microstep driver like the 8825 im not sure how well these motors can microstep.

For a very low torque application like this you could consider the drv8834 which will work off a 5v supply.

There's not a lot of benefit in using the cnc shield if it gets in the way or something else, it just saves a bit of wiring. It isn't tied to grbl.

The 8825/8834 are more modern drivers than the 4988. I have used all 3 types on 3 different machines including 2 8834s on a clock and they all work fine.

Though having home sensors is ideal i have never found a problem with losing steps once a system is running, so you might just set the hands manually to home on switch on.

My first clock was basically my first Arduino project, i just dived in.

One additional thought. You might use an external dcf77 receiver module to get time signals. These can be bought very cheaply and there are a couple of arduino libraries for decoding them and updating a software RTC. Only needs a single wire plus ground connectio to the receiver.

Thank you for the feedback! I thought, using microsteps will lead to even more possible steps, so having sufficient resolution for a scale with less than 360°. Is there a mistake in my thoughts?
Regarding he CNC shield: I was not aware, that using 3 drivers without the shield will be possible. Somewhere I read, that only 2 stepper motors can be driven directly with an Arduino. Seemed to be, that I have to dig a little deeper in there ... (If you have sketch, how to connect 3 drivers to the board it would be fine).
Endswitches: I am not afraid of losing steps, but the idea was, that the clock can automatically initiate when switching it on.
Thank you for your thoughts. Especially on the drivers and the DCF77 module.

Not true, I wonder what they were trying to say. Check out the Pololu site for stepper motor drivers.

You'll see that they need a pin for direction and a pin for step. A couple more if you need to adjust micro stepping which isn't the case for your project. Another pin for the homing microswitch which is three per motor, assuming you need to move in both directions.

Microstepping would help but im not sure how effective it would be with those old style stepper motors. It relies on driving the coils with varying currents so the rotor can take up intermediate positions. Modern motors are designed for the job. Maybe try it and see?

The usual 28BYJ-48 offering on eBay is geared about 64:1, so that the output shaft has roughly (not exactly) 4096 steps/revolution, half stepping. This is much more than sufficient for the project.

There is no need to use a CNC or bipolar driver or to modify the motor for the clock project. The ULN2003 unipolar driver that comes with most of them will work fine, and you need just 12 digital pins on an Uno to drive all three motors.

Lots of good tutorials on the web, including the one linked above. Sounds like a fun project, so let us know how you get on with it!

Yeah, I was aware of this, ....
... but just forgot it yesterday, when I wrote down my thoughts. Might be the age-problem ...

My problem was, that I somewhere read, that I could not connect 3 stepper motors to the Arduino uno. That was the point, where I decided to use the CNC shield and if use this, the motors must be bipolar

OK, thank you very much for that hint. So I will go back to "start" and read documentation on how to connect 3x ULN2003 with the Uno. Hopefully within the 4 Pins / Motor there is already an endswitch included...

I will search the web on how to connect everything. Once I am done, I will come with a picture for an expert-review :slight_smile:

Hello
What about to use servos instead of steppers ?

You may not need an input per home switch. You could OR all the switches and feed to a single input. Then you drive each axis in turn until its switch activates and back off a few pulses. Then do the next. They seem rather bad at specifying exactly how many steps per rev these motors are, bit of a critical number!

Can you explain me a little bit more, why you propose servos? What is the advantage?

Use any 12 digital pins, 4 for each stepper.

There are 14 digital pins on the Uno, plus any of the 6 analog input pins can also be used as digital pins.

I tried to make a fritzing overview. As "endswitch" I used KY-033 modules. Is a DCF77 really needed?

Instead of the breadboards I plan to hardwire everything.

Any feedback?

A hand drawing, with pencil or pen and paper, is vastly preferred on this forum. Especially if the pins and parts are properly and clearly labeled.

What is all that stuff on the left side of the drawing?

Only if you want an external time reference. You could just use an rtc module but would need to set it, or ntp via wifi.

I found on amazon this modules, named KY-033. I would like to use them as endswitch, so that the clock is able to initialize automatically after power on.

Those look over complex to me. Standard slotted opto interrupters woulld be fine.

Your scales are 240°, 120° and 180°. That's what cheap servos can perform. Instead of three stepper motors, three stepper motor drivers and three endswitches (no, you don't need six of them), you need only three servos. When you turn power on, the servos can go directly to their first time position, without first homing, like the steppers need to do. I don't really see what benefits the stepper motor approach gives you. Other than steppers being kind of a cool thing.

Than

Thank you for the feedback! At the moment it is only an idea to build the clock, but I will take servos into account too