3v 24hr timer w/ electromagnetic pulse(?)

DickCappels

Joined Aug 21, 2008
10,661
(Some text removed for clarity)

The idea is to send a brief .5 second electromagnetic pulse from one side of the clock to the other, once every 24 hours. Essentially it's a mantle clock that has digits 1-30 around the clock face in lieu of 1-12 (Yes, I realize not all months have 30 days). The quick pulse pushes a small magnet about 5-6 inches away, which gears the clock's single hand 1/30th of a revolution, which obviously needs to occur only once every 24 hours (preferably like clockwork!).
Will you have the same gears and only require a 500 millisecond pulse now? Or what?
 

Thread Starter

AlwaysLearningStuff

Joined May 21, 2019
19
I should note, the .500 millisecond pulse originally was just a place holder until i could adjust the code appropriately to work with the clock's gear assembly. I figured that number would get me close enough to dial it in.

I'm thinking now however, with this mini drone motor, a .500 millisecond might even be too long. Those thing can crank!

But if I start with that, I can dial the code in at the end.
 

LesJones

Joined Jan 8, 2017
4,511
I think you could use the electronics from a plug in timer (Such as this. ) to do the basic timing. All the ones I have taken apart use a single
Ni-mH cell for battery backup. These seem to run the timer for a few weeks when not plugged in. This cell is very small (Less than 50 mAH) so using a AA or AAA cell it would run for months. You can't get the output pulse to less than 1 minute but you could use it to trigger a one shot to provide the pulse length you require.

Les.
 

LesJones

Joined Jan 8, 2017
4,511
You have not described the mechanical design of your clock. Two possible methods occurred to me. The first is to use a 30 tooth ratchet wheel which is stepped on by a coil like on a relay. If you Google "uniselector" you will get a better idea of how they work. This is one result that gives the baisc idea of how they work. As you are into making clocks you will be familiar with making gears so making a 30 tooth ratchet wheel is the same except for the shape of the teeth. The second idea is to use a worm and 30 tooth worm wheel. One revolution of the worm would step it one position. If you drive the worm with motor and have a set of contacts also driven by the motor that are closed for most of a revolution but open for a few degrees of rotation and have these contacts in series with the supply to the motor it will always stop in that position. If you then have a set of contacts for example on a relay in parallel with the contact driven by the motor then just closing these contacts for the time for the motor to move away from it's contacts open position is will complete one revolution.
You could take the design one step further by adding a further 1:12 reduction and making the ratchet 31 teeth. A set of 12 contacts driven from this reduction could be configured to make it double step at the end of a 30 day month. (And do 3 steps for February.)

Les.
 
Last edited:

Thread Starter

AlwaysLearningStuff

Joined May 21, 2019
19
You have not described the mechanical design of your clock. Two possible methods occurred to me. The first is to use a 30 tooth ratchet wheel which is stepped on by a coil like on a relay. If you Google "uniselector" you will get a better idea of how they work. This is one result that gives the baisc idea of how they work. As you are into making clocks you will be familiar with making gears so making a 30 tooth ratchet wheel is the same except for the shape of the teeth. The second idea is to use a worm and 30 tooth worm wheel. One revolution of the worm would step it one position. If you drive the worm with motor and have a set of contacts also driven by the motor that are closed for most of a revolution but open for a few degrees of rotation and have these contacts in series with the supply to the motor it will always stop in that position. If you then have a set of contacts for example on a relay in parallel with the contact driven by the motor then just closing these contacts for the time for the motor to move away from it's contacts open position is will complete one revolution.
You could take the design one step further by adding a further 1:12 reduction and making the ratchet 31 teeth. A set of 12 contacts driven from this reduction could be configured to make it double step at the end of a 30 day month. (And do 3 steps for February.)

Les.
Interesting thoughts Les on the uniselector and the 1:12 reduction! Great resources too. I originally thought about using a coil, but wanted to devise a device that had as few moving parts as possible; sort of a hybrid digital/ analog (particularly after tearing a few watches apart). "Digital" in the sense that most everything would operate off a microcontroller, save for the electromagnet (now a small motor) and a simple gear assembly.

I would say my main issue is creating/programming an mcu that would remain low essentially at all times, therefor conserving a small button battery, ideally for years. While I've played around with gears, I'm by no means a mechanical engineer, and wouldn't claim to be an actual clock maker. I'm afraid bringing in too many more mechanical parts is going to introduce new hurdles for me to overcome. :eek:

Guess it's time for me to get my hands dirty with a bread board, logive learning, and some of the previously mentioned components! Will probably look to the ATTinys mentioned by djs and Dick, and play around with the code that djs offered up. Will keep you guys posted. Thanks again for the responses, and thank you Les for introducing me to two-motion selectors! Amazing stuff imo!
 

Thread Starter

AlwaysLearningStuff

Joined May 21, 2019
19
I’m not familiar with the ATTiny12. But with an ATTiny45/85, outputting a 500mS pulse every 24 hours is just a few lines of code. Maybe 5?
Hey djs, can you explain the difference between the ATtiny 45 and 85? I'm not finding much through a search.. seems they are nearly the same?? Thanks!
 

djsfantasi

Joined Apr 11, 2010
9,237
Memory! Pretty much memory size. The higher the number, the larger the memory.

You can see a comparison chart by clicking on this link.

Given that I believe your application requires but a half dozen lines of code, the ATTiny45 is probably sufficient for your needs. And maybe the ATTiny13...
I’ve just not used anything smaller than an ATTiny25.
 

djsfantasi

Joined Apr 11, 2010
9,237
Are you all set to program them? Danadak proselytizes using another Arduino as an ISP. My preference is a programmer from SparkFun. One approach is cheaper, but requires more work. The other is pretty much plug and play.
 

Thread Starter

AlwaysLearningStuff

Joined May 21, 2019
19
Hope everyone is having a great labor day weekend for those who celebrate.

Project Update:
- Got a bunch of ATTiny45s.
- Been learning to program them and have successfully uploaded some programs using Arduino Uno.
- Got a bunch of tiny DC motors (thought I ordered 10, but actually 10 - ten packs, ha!), but put the DC motor route on hold however. I just don't think it's going to be precise.
- Got some great micro bipolar stepper motors however, which leads me to my next query for you all:

I came across this video of a guy running a bi polar stepper using only an ATTiny85, but cannot figure out the code for it;

He says in the video he's using basically standard stepper code, but all my attempts to duplicate have failed. Any ideas as to what he did here?? It's pretty clever IMO. Thanks for any help or ideas!
 

Sensacell

Joined Jun 19, 2012
3,785
A while back I designed a pulser for old-style (1950's) mechanical school clocks that require a 24 V pulse every minute from a master in the principal's office to keep them in perfect synch.

Since a 24 V battery is not a reasonable option, I designed it to boost the 3 V battery (2 D-cells) with a flyback converter - up to 26 Volts to charge a large capacitor that then is discharged into the clock coil to fire it, once a minute. This configuration can provide rather large energy pulses, by upping the capacitor value and charging voltage, which is limited only by the breakdown voltage of the parts chosen, and the time available to charge it up.

The circuit utilizes a micro-controller to manage all the functions: timekeeping and power conversion.

The power consumption is very low because the micro is in 'sleep' mode most of the time, the batteries last more than a year.
It keeps perfect time via a cheap and ubiquitous 32.768 Khz watch crystal.

Maybe this could be adapted for your clock.
 

Attachments

Thread Starter

AlwaysLearningStuff

Joined May 21, 2019
19
Hi Sensacell,

Very interesting! I'll have to marinate on your design here, and weigh the pros and cons with regards to my current design direction. Interestingly enough, I came across the pic16(L)1454/5/9 the other day, and booked-marked it as the best alternative to the ATTiny45/85 for my application. The more I've played around with the ATTiny45, the more I've come to realize the clocking precision would absolutely require a crystal.

Thank you so much for taking the time for me and sharing your design and insight.
 

Thread Starter

AlwaysLearningStuff

Joined May 21, 2019
19
Figured it out! The following allows me to run a micro stepper on attiny45 w/ only 5v logic.I get one revolution every half second on a 18degree bi-polar stepper. This will allow me to change the delay to what was discussed previously.

My issue now is getting to to step on 3v button cell, then figuring out how to add a crystal.

#include <Stepper.h>

const int stepsPerRevolution = 20; // change this to fit the number of steps per revolution
// for your motor
int in1Pin = 3; // was 8
int in2Pin = 2; // was 9
int in3Pin = 0; // was 10
int in4Pin = 1; // was 11

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, in1Pin, in2Pin, in3Pin, in4Pin);

void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}

void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);

// step one revolution in the other direction:

}
 
Last edited:

Sensacell

Joined Jun 19, 2012
3,785
Stepper motors are very inefficient, not very good for battery-powered devices.
Stepper drivers might still consume relatively large amounts of power even when shut down, they are not often used in super low power applications.

Consider the energy density of those batteries, do the math and you will see that you have to reduce the idle drain down to a very low value to obtain reasonable battery life.

You can shut the motor down to conserve power, but then you might lose position when it powers back up.
This might be workable if you add a sensor to re-home the motor when you power it up.

A brushed DC gear motor will be substantially more efficient at converting your batteries minuscule energy to mechanical work.

If you gear the motor down substantially, controlling it becomes easier, a single switch or sensor could signal the MCU to stop it in the correct position.

Have a look at those cheap garden watering timers, that's essentially what you are building here.
 

Thread Starter

AlwaysLearningStuff

Joined May 21, 2019
19
I'm discovering that as we speak actually, using a 3vdc micro stepper. Runs great from arduino power, but requires two 3v buttons at 128khz(wdt) and only works for about 5-6 times before it starts tripping up. I think I'll take another run at the DC option. Thanks for your response! I think @DickCappels had also mentioned the water timer route a bit earlier in this project thread debacle. Will revisit that. Thanks sensacell.
 
Top