Hi,
I'm looking for ideas to build a simple timer circuit that would ideally be triggered with a momentary switch, then turn on a LED for 20 or 30 seconds and then turn off the LED and remain off until triggered again. I'm interested in using it in a game as a sort of respawn or 'jail' timer. When you're 'out', you activate your timer and when the LED goes out, you can move or resume play. In any case, I'm especially interested in simple designs that could be constructed at low cost.
I was considering some kind of 555 circuit but also wondered if it could be done with a capacitor.
Thanks in advance for any ideas you have.
Scott
Simple timer circuit ideas needed
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 564
- Joined: Wed Jun 19, 2013 3:35 am
Re: Simple timer circuit ideas needed
Here's a 555 circuit w/ momentary trigger and delay 'off'.
Using the Adafruit Playground App, I got these component values for 20 seconds
You can find a lot of other 555 timer calculators online though.
Using the Adafruit Playground App, I got these component values for 20 seconds
You can find a lot of other 555 timer calculators online though.
-
- Posts: 306
- Joined: Wed Jun 12, 2013 5:01 pm
Re: Simple timer circuit ideas needed
It is the cap and resistor that sets the time on a 555 circuit. You could build a circuit that doesn't use a 555 but it will be more complicated which is why the 555 is so useful and popular (it has been in production for over 30 years).I was considering some kind of 555 circuit but also wondered if it could be done with a capacitor.
Another way to do timing like this is to use one of the very small processors (Attiny or PIC10,12). These would use the oscillator clock and a counter for the delay time instead of an RC timer. Just mentioning this to point out there are other methods.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Simple timer circuit ideas needed
The official name for the circuit you described is a 'monostable multivibrator', and is more commonly known as a 'pulse stretcher' or 'one-shot'.
The 555 makes a very good one-shot, but there are plenty of other ways to make them. In theory you could make one with just a switch and a capacitor, but to keep an LED running for 30 seconds at 10mA you'd need about 30,000 microfarads and a way to control the current.
There are lots of ways to make one-shots: http://discovercircuits.com/O/oneshot.htm
The 555 makes a very good one-shot, but there are plenty of other ways to make them. In theory you could make one with just a switch and a capacitor, but to keep an LED running for 30 seconds at 10mA you'd need about 30,000 microfarads and a way to control the current.
There are lots of ways to make one-shots: http://discovercircuits.com/O/oneshot.htm
- chuckm
- Posts: 159
- Joined: Thu Dec 24, 2009 3:31 am
Re: Simple timer circuit ideas needed
Strangely enough, while the venerable 555 timer is an excellent choice here, an ATTiny is a viable alternative. Four components (chip, resistor, LED, button) and a very small countdown program.
--Chuck
--Chuck
-
- Posts: 564
- Joined: Wed Jun 19, 2013 3:35 am
Re: Simple timer circuit ideas needed
I hate to admit it, but....ordering a Trinket even is probably less $$ than getting the necessary discreet components from the local Radio Shack. And...it's much more versatile.ChuckM wrote:Strangely enough, while the venerable 555 timer is an excellent choice here, an ATTiny is a viable alternative. Four components (chip, resistor, LED, button) and a very small countdown program.
--Chuck
There is something quite satisfying about building a sturdy, single-job circuit out of discreet parts, though!
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Simple timer circuit ideas needed
When I make one-shots, I use a 74HC14 hex Schmitt inverter, a cap, and a resistor.
The chip costs about 10c and each inverter can be its own one-shot, so the cost per one-shot is about 7c.
The chip costs about 10c and each inverter can be its own one-shot, so the cost per one-shot is about 7c.
-
- Posts: 564
- Joined: Wed Jun 19, 2013 3:35 am
Re: Simple timer circuit ideas needed
Well, it's nice to know that the Adafruit Support Team isn't just on here trying to push more sales.adafruit_support_mike wrote:When I make one-shots, I use a 74HC14 hex Schmitt inverter, a cap, and a resistor.
The chip costs about 10c and each inverter can be its own one-shot, so the cost per one-shot is about 7c.
Yeah....my comment was a bit like comparing apples to cheese-whiz. Online, components are dirt cheep*. And, If you're able to solder SMD, you can get an whole bag full of components for about the cost of one through-hole piece!
I may be holding a slight grudge against "the Shack". Last time I ran in there to pick up a single LED to finish a project....it cost me $3.
(*spam word)
- zener
- Posts: 4567
- Joined: Sat Feb 21, 2009 2:38 am
Re: Simple timer circuit ideas needed
I think this is the best solution proposed so far. Assuming the OP is a beginner (not sure) this type of circuit would not only be easy to build, and perform the needed function, but would be fairly easy to understand and troubleshoot, and would teach some basic electronics concepts. I know the 555 is ubiquitous, and I have used lots of them, but I really don't think it is very useful for beginners as it just seems like a magical black box, and if your circuit doesn't work it can be difficult to troubleshoot. But I think the main lesson from the 555 is that you can take a couple of simple things (comparators and transistors) and put them together, and people might think you are a genius. Although the peanut butter cup might be a better example of this...adafruit_support_mike wrote:When I make one-shots, I use a 74HC14 hex Schmitt inverter, a cap, and a resistor.
The chip costs about 10c and each inverter can be its own one-shot, so the cost per one-shot is about 7c.
- Renate
- Posts: 291
- Joined: Tue Nov 13, 2012 3:21 pm
Re: Simple timer circuit ideas needed
The problem with a CMOS Schmidt trigger is that the hysteresis is not well defined.
Or maybe I'm thinking of halitosis?
A 74HC14 running on 5V might have a hysteresis of between 0.5 to 1.5 volts.
That's fine for input conditioners, but inaccurate for timing.
A 555 uses comparators set to the 1/3 and 2/3 points.
OTOH, long delays have for decades used a higher frequency clock and dividers.
Large electrolytics have terrible tolerance, some like -20% +50%.
Also, using large caps as state variables is old hat, you can't reset them in zero time.
If you want to self-roll this idea, use a counter, overflow detector and a higher frequency clock.
Or maybe I'm thinking of halitosis?
A 74HC14 running on 5V might have a hysteresis of between 0.5 to 1.5 volts.
That's fine for input conditioners, but inaccurate for timing.
A 555 uses comparators set to the 1/3 and 2/3 points.
OTOH, long delays have for decades used a higher frequency clock and dividers.
Large electrolytics have terrible tolerance, some like -20% +50%.
Also, using large caps as state variables is old hat, you can't reset them in zero time.
If you want to self-roll this idea, use a counter, overflow detector and a higher frequency clock.
- zener
- Posts: 4567
- Joined: Sat Feb 21, 2009 2:38 am
Re: Simple timer circuit ideas needed
I have never made a precision timer with one so I can't say one way or the other, but I would think the stability would be the important thing, rather than the initial spec. I don't know what the drift would be. Yes you would want to use X7R, X5R, or C0G ceramics for decent stability, film would probably be OK. My initial idea was a RC hooked to a 393 comparator, with a divider for reference and PNP on the output. A NO PB would charge (or discharge the RC). The button hold time would be added to the RC time so maybe this would be an issue.Renate wrote:A 74HC14 running on 5V might have a hysteresis of between 0.5 to 1.5 volts. That's fine for input conditioners, but inaccurate for timing.
A 555 uses comparators set to the 1/3 and 2/3 points.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Simple timer circuit ideas needed
*chuckle* In a recent interview, Ladyada described Adafruit as "an educational company that just happens to have a gift shop at the end". http://www.pddnet.com/news/2013/12/meet ... ign=Buffer1chicagodave wrote:Well, it's nice to know that the Adafruit Support Team isn't just on here trying to push more sales.
We're Makers first, sellers second. Sales-driven BS has a short lifespan among geeks and hackers, and the mindset necessary to pick the most appropriate solution from several different options is different from the one necessary to push the one that shuffles the most money from your pocket to mine.. I understand cutting off the flow of blood to the brain with a power tie helps, but have never been willing to try.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Simple timer circuit ideas needed
That isn't as big a problem as you might think.Renate wrote:The problem with a CMOS Schmidt trigger is that the hysteresis is not well defined.
Yes, there's some variation in the threshold voltages, but the effect on timing tends to be smaller than the effect of component tolerances in your resistor and capacitor. Assuming +/-5% for the resistor and +/-10% for the capacitor, your RC time constant has a worst-case variation of +/-15% and a statistical variation of +/-11% regardless of what you use for the rest of the oscillator.
One-off projects are fairly immune to such variations though.. it's one of the big advantages DIYers have over mass-produced hardware: you can build the circuit, measure the delay, then trim the resistance until you get the delay you want. A trimmed circuit will almost always perform better than one that's been designed for acceptable-worst-case performance without trimming.
Please be positive and constructive with your questions and comments.