How I can create timer in classic asp?

How can I create a hand-made digital timer?

  • 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!

  • Answer:

    Yes, you can do this with an Arduino. Someone has written http://www.arduino.cc/playground/Learning/SolenoidTutorial. 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.

jsturgill at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

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 https://www.adafruit.com/products/255 or (if you can get the signal) GPS time sync.

scruss

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!

springload

"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?

jsturgill

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?

jsturgill

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.

tylerkaraszewski

Arduino is dead simple if you have any experience programming in C-like languages at all. The standard "delay" function offers http://www.arduino.cc/en/Reference/Delay, and with a little more work you could get http://arduino.cc/en/Reference/Micros 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 http://www.sparkfun.com/products/9479.

neckro23

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.

jsturgill

jsturgill

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.