How can I create a hand-made digital timer?
September 28, 2011 9:54 PM   Subscribe

I want to create a digital timer to run a motor and activate three solenoids in a particular sequence and for particular durations.

I have a Crouzet Millenium 3 that does the above (turns a motor on and off and trips three solenoids in a particular timed sequence). I want to replace it with something hand-made and coded as a learning exercise.

Second-level accuracy is all that is needed. Tenths of a second would be nice, just to have some extra to play with.

I'm thinking that an arduino or any similar platform would make this (relatively) simple to implement. Is that true? Is there a Handy Guide that would walk me through such a scenario? How accurate (and repeatable) is the platform? Is there anyone crazy enough to literally walk me through the project step by step so I learn how these things work?

Help point me in the right direction, por favor!
posted by jsturgill to Technology (9 answers total)
 
Yes, you can do this with an Arduino. Someone has written an Arduino solenoid tutorial.

Do you know how to program? The Arduino software is super-easy if you know C.

Arduino has timers down to microsecond accuracy.

I don't know what you mean by "how accurate is the platform". It's a little computer. It's digital. It executes the same instructions in the same order every time you give it the same inputs.
posted by tylerkaraszewski at 10:30 PM on September 28, 2011


The newer Arduino Uno has less timing stability (it uses a ceramic oscillator) than the older models, which used crystals. You will get some drift if you're expecting your solenoids to fire at the same second every day for months. There are various solutions, like TXCO RTCs or (if you can get the signal) GPS time sync.
posted by scruss at 4:40 AM on September 29, 2011


Or you could do it with discrete gates! That could be very satisfying, if not programmable except by DIP switches. You need one of those 32kHz crystals and a simple clock circuit. Then you couple your clock signal to a sequence of latches, each of which divides the frequency in half. Somewhere down the chain, you'll have a 1Hz signal, because that's the idea of the odd 32kHz crystals. Keep dividing, and feed the divider outputs to XOR-gates with the other input of each XOR hooked to a DIP switch and some pull-up/pull-down resistors. AND all the XORs together, and you can use the switches to set the binary number of seconds required from latch reset until the AND output goes high. Do the same with many XORs and ANDs, do some logic on those outputs and use the result to drive relays. It will be about the size of a pocket calculator if you choose your gates smartly.

Well, it was just a thought. Good luck!
posted by springload at 6:03 AM on September 29, 2011


Response by poster: "how accurate is the platform"

I wasn't really choosing my words well with that. I was trying to see if the timing might change or drift over time, as scruss mentioned, or even differ significantly between back-to-back repetitions. Microsecond accuracy and the drift warning have answered that part.

Springload, could you find me some sort of resource/tutorial for a similar project using DIP switches?
posted by jsturgill at 8:09 AM on September 29, 2011


Response by poster: Also: this really is something I'm completely new at. Are there any simple introduction to arduino and circuitry articles that start off with the "hello world" equivalent? Maybe lighting up some LEDs or something?
posted by jsturgill at 8:21 AM on September 29, 2011


Yes, there is a blinking LED "hello world"-ish Arduino demo: http://www.arduino.cc/en/Tutorial/BlinkingLED.

The code to do this comes with the arduino software in the examples.
posted by tylerkaraszewski at 8:35 AM on September 29, 2011


Arduino is dead simple if you have any experience programming in C-like languages at all. The standard "delay" function offers millisecond accuracy, and with a little more work you could get significantly more accurate if you really wanted to.

The trickier part is going to be building the circuit that drives the solenoids -- Arduino only outputs relatively low-current 5V signals, so you're going to need some extra components. I'm no expert on the topic, but something like this.
posted by neckro23 at 8:59 AM on September 29, 2011


Response by poster: Anyone still reading this?

I plan on ordering some stuff today. Should I purchase an arduino or freeduino? Can you recommend a retailer? Will I need a breadboard?

A little handholding would be appreciated.
posted by jsturgill at 8:42 AM on October 4, 2011


Response by poster: Or should I get the Freetronics Eleven?
posted by jsturgill at 8:50 AM on October 4, 2011


« Older It's not all in my head!   |   Help me surprise my awesome hubby Newer »
This thread is closed to new comments.