3D Printed Watch Winder (ATtiny85+Stepper)

5,036

54

30

Posted

Introduction: 3D Printed Watch Winder (ATtiny85+Stepper)

Design Now: 3D Design Contest 2016

Runner Up in the
Design Now: 3D Design Contest 2016

A friend of mine recently bought a watch winder to keep his automatic watch charged when he is not wearing it. I wanted one too, but these device are rather expensive!

I then figured out how to make one on a tight budget: the total cost is less than 15$ (pla filament included)

As I had already experimented with ATtiny's I thought I could use it to drive a commonly-available cheap stepper, the 28BYJ-48. It is usually sold with a handy pcb featuring the "driver", a simple ULN2003 darlington array, some connectors and leds for debugging purposes. Most importantly, this motor can spin with just 5 volts, so we can use the same power supply for both the motor and the microcontroller, thus keeping the circuit very simple (read: cheap).

The idea behind these gizmos is rather simple: they slowly spin the watch some minutes per day, keeping it charged. The one I made, specifically, rotates for 10 minutes every hour.

  • Why 10 minutes? Because I've looked up some documentation regarding automatic watches and that's plenty of time.
  • Why 10 minutes every hour and not 240 once a day? Well, the latter means that once you end spinning you need to wait 18 hours before moving again. To measure time (in order to wait) in a microcontroller without any additional hardware you have to count. Why bother counting BIG numbers in a 8-bit architecture when you can just split the whole process through the day, handling much smaller time values, with no practical difference at all? (KISS principle ftw)

Here's the bill of materials:

  • ATtiny85 or a Digispark board
  • 28BYJ-48 with driver board, you can find these ones on ebay
  • 8 pin socket (optional)
  • Decoupling capacitors, I've used 10uF and 0.1uF ones (you don't need the 0.1 one on the digispark)
  • Spare wire
  • Glue
  • Soldering tools
  • Perfboard
  • 5v regulated (switching) power supply - any 5v USB battery charger will do
  • Usb cable
  • Something to program the ATtiny with (Arduino as ISP, USBtinyISP...)
  • 3D printer and some filament

I've written the code running the ATtiny85 in AVR C. Let's start with that.

Step 1: If You Have a Digispark

Digisparks, those little attiny85-based gizmos that you can program via usb! If you have one of them, you can use this guide to program it, otwherwise carry on with step 2, it will work anyway. Notice, however, that the Digispark code doesn't currently support the sleep mode, so your circuit will draw a few milliamps even when the motor is idle.

Download the Arduino source file from my Github, open it, install the digispark package following the official guide and upload the code. You're done!

Step 2: Program the ATtiny85

Head to https://github.com/SimoDax/watch-winder-attiny85/... and copy the code. Make a new AVR C project in Atmel Studio, select ATtiny85 as device, paste in my code, build it and flash the avr following these steps:

If you want to use Arduino as ISP you need to turn a UNO board into a avr programmer following this guide (I assume the Arduino IDE is already installed on your system). Now go back to Atmel Studio, click on Tools > External tools...In the window that shows up click Add and paste these strings in the title, command and arguments fields:


Title:

AVRDUDE 85

Command:

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe

Arguments:

-C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -pattiny85 -cstk500v1 -PCOM19 -b19200 -Uflash:w:"$(ProjectDir)Debug\$(TargetName).hex":i

In the last string look for "-PCOM19". This specifies the serial port the Uno is connected to. On my pc it's COM19, you can check yours in the Arduino Ide, under Tools > Port (there may be many ports listed but only one will have "Arduino/Genuino Uno" written beside, use that one). Change 19 in the parameter to match yours. The final result should be like in the second picture.

Now we're ready to compile & upload the source code: click Build > Build solution, connect the Uno (if you have disconnected it) and click on Tools > AVRDUDE85. A console window will pop up. DO NOT DISCONNECT ANYTHING WHILE AVRDUDE IS RUNNING!

Three progress bars made of #s should appear, one after another. Once you see "avrdude.exe done. Thank you." you can close the terminal. The source code has been uploaded to the attiny. Disconnect the Uno and remove the attiny from the breadboard.

Step 3: Make the Circuit

The circuit is fairly simple, as you can see (also you may notice I'm not good at fritzing). I added two decoupling capacitors, 10uF and 0.1uF respectively. Roughly said, the former smooths out the voltage across the whole circuit, while the latter is "shielding" the microcontroller. These caps are needed because the motor can produce a lot of noise across the power line, and since this is shared with the microcontroller we don't want it to reset due to voltage fluctuations.

If you're wondering why there are no diodes against back-emf don't worry: they're inside the uln2003 ic :)

You can copy my circuit layout or make your own, I tried to use as little space as possible by keeping all the components close and making a sort of +5v and GND parallel rails. Note that to be effective the .1 uF cap should be placed as close to the microcontroller as possible.

I've chosen a cheap 5v usb battery charger as power supply (be sure it's regulated!), and I've cut off an extremity of a spare usb cable to solder it to the circuit. I've designed a hole on the back of the base to pass the cable through it. The whole thing draws about 200 mA when the motor is spinning, and virtually no current (ok, some microamps) when idle, since the code I've written sends the microcontroller to sleep while waiting.

I haven't used a socket but I've soldered the ATtiny directly, however I do not recommend this. Use a socket. Really.

There's no on/off switch, I don't think this thing really needs one and I don't mind sporadically plugging the usb cable from the charger. You can edit the .stl and add a hole on the base to insert one, if you want.

Now that you've soldered everything I suggest to apply some sealing glue on everything that may cause a short circuit when the whole thing will be pushed inside the base (I covered the bottom of both boards and the uninsulated wire parts), so you don't need to worry if the thigs get messy when you stuff them inside the winder.

Step 4: Print the Winder

You can find all the stl files here on thingiverse. I printed mine with 0.2 mm resolution, 60 mm/s and 20% infill, supports enabled, no raft.

The lateral wings on the central holder are chamfered because this way the printer doesn't need to make supports to print this piece.

If you want to edit the model to fit your needs don't worry: here you can dowload the Fusion 360 file (or other formats if you don't use Fusion)

I'm currently working on making a similar model without the outer cylinder, since while assembling it I noticed it doesn't look bad at all with just the rotating part, to check the latest file version follow this link

Step 5: Assemble!

Pull out the exceeding part of the usb cable, put the circuitry inside the base, use some cyanoacrylate or resin to glue the stepper in place, insert the rotating cylinder on the motor shaft and glue it through the other side of the hole. Mount the outer cylinder.

Now glue a disc of transparent plastic (or plexiglass, or even real glass) to the cover piece and insert this one on top of the winder. I have yet to find a cheap solution I like for this step, I could skip it but I want a bit of protection from dust. Anyways, the diameter of the transparent disc has to be between 80 and 82 mm: I've added some extra spacing in the design to make up for imperfect cuts.

I've also designed a piece to put the watch on before inserting it in the winder, so even if you have a small watch it should be stiff and not moving around. The lateral wings on this are chamfered because this way the printer doesn't need to make supports to print it.

Step 6: Enjoy!

Now you've made your very own watch winder! Go tell your friends!

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Gluten Free Challenge

    Gluten Free Challenge
user

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

Tips

Questions

27 Comments

I like the simple design of your winder! I'm printing one right now. What do I need to change in the code so that the motor rotates 360deg CW, pause for a few milliseconds then rotates 360deg CCW? TIA!

Oh boy, that's a completely different approach, the current code measures time, while yours would measure angles. That means converting motor steps to actual angles and completely rewriting the spin() function. Why is that needed, if I may?

Thank you for sharing, I just ordered everything thats needed :-)
Sorry for asking again but different:
What do I need to modify/add to the code, to make it rotate CW for 10 mins, then CCW for 10 mins, and then pause?
Thank you so much

Ah, understood! Thank you so much! :-)

Thanks for your reply! That sure sounds complicated especially for me since, I have zero knowledge of coding/programming microcontrollers. I'm trying to build another winder using the gyroscope approach, similar to the planetary winder by Bernard Favre. I was planning to incorporate your electronics including the (10-minute timer) to that one. Could you point me somewhere where I can read and learn about programming the ATtiny?

I like your willingness to learn! (There's people out there who just want to have the job done by others..)

Before programming chips you should probably learn a bit of pc coding in C, so if you make a mistake the program just crashes instead of blowing up a mcu :D

Anyway, I've looked up the docs on the motor, it says each steps turns the shaft by 5.625° but the gears inside have a reduction ratio of 1/64, so 360° / 5.625° * 64 = 4096 steps for a complete revolution. So here's your new spin() function:

https://gist.github.com/SimoDax/dd846bac3e9113093d...

replace the original and you're all set.

Thanks for the code. I've built my winder using the same motor but I used digispark since my arduino is yet to arrive. I tried using the code but for some reason, the winder spins for 10 minutes, stops for 3 minutes, then starts spinning again. I've found a custom stepper library which I used to make a sketch to spin the winder the way I intended it to, can you help me with the timer? I've been reading about programming but can't seem to figure out how to add the timer. TIA!

Here's what I have:

https://gist.github.com/anonymous/840971fedeb23be7...

Ok, first things first. That is Arduino code, it must be used inside the Arduino ide. Mine is Avr-C, that means I'm bypassing anything Arduino-related. It's like coding at a lower level. The reason why you don't find how to set up the timer is that Arduino doesn't support it directly. You can use a much easier way tho, there's a delay(milliseconds) function which will halt the code for the duration specified. Just write delay(3600000); to wait for an hour. You should do that when you're done spinning the motors

Wait, I just realized you were talking about the delay() function, I tried to put delay(1000) to stop the motors for 1sec but the motor didn't move anymore even after a minute, not sure why. Anyway, I'll read more and see what I can come up with.