# Another 555 timer question

Discussion in 'The Projects Forum' started by dthx, May 16, 2013.

1. ### dthx Thread Starter Member

May 2, 2013
194
14
I've been reading the 555 timer Q and A's and thought I'd ask the forum for help on this.
I think I know how to ask this now..
Here is what I want to do.

Push a button
Have a 555 timer circuit energize a 12VDC.... solenoid #1
Solenoid #1 stays energized from 2 sec to 10 sec ... (On time is adjustable by an external pot)
Solenoid #1 then de-energizes from 2 sec to 10 sec....(Off time is adjustable by an external pot)
555 timer then rolls to the #2 solenoid and the logic is repeated.....
555 timer stops ......Until button is pushed again

2. ### tracecom AAC Fanatic!

Apr 16, 2010
3,939
1,430
The way I visualize it, you will need three 555 circuits: a one-shot to operate solenoid #1, a one-shot to time the pause after solenoid #1 releases, and a one-shot to operate solenoid #2. There's also probably a way to do it with only two 555 circuits and a flip-flop, but I can't visualize exactly how that would work

Or you could take care of all the timing with one microcontroller, plus a couple of transistors to drive the solenoids.

But there are more knowledgeable people than me on this site, who may think of better ways.

dthx likes this.
3. ### elec_mech Senior Member

Nov 12, 2008
1,513
195
Hmm, interesting. I agree with Tracecom and think there may be a couple of additional ways to do this. I've created a timing diagram giving a visual of how you've described the operation. Is this correct?

In the diagram, I've drawn it so that TIMEs A-D are equal, but that may not be the case.

Some questions:

Is the 2-10 timing the same for any of the times? For instance, if you set the ON time for solenoid 1 to be 3 seconds, will the OFF time for solenoid 1 always be 3 seconds as well or do you want to be able to set different times for ON and OFF?

Same question for solenoid 2 - will its ON time be the same (everytime) as either solenoid 1's ON and/or OFF time?

Do you want solenoid 2 off for a certain amount of time before the user can press the button again?

Do you want the button disabled so that once pressed, it will not reset the circuit or effectively do anything until the timing cycle is complete?

• ###### Another 555 Timer Question - Timing Diagram.png
File size:
28.9 KB
Views:
92
dthx likes this.
4. ### Dodgydave AAC Fanatic!

Jun 22, 2012
7,606
1,261
Or use a 555 timer in a variable astable mode clocking a CD4017 set to 2, and the push button on the reset pin?

dthx likes this.
5. ### dthx Thread Starter Member

May 2, 2013
194
14
Thank you guys for the help.

For elec mech
1/) Yes.. the on or off time can be the same for all solenoids...but I may set it for up to ..say...10 sec and it has got to be variable via a pot
But once I set it ..it wil be the same for all solenoids.
2.) The user wil never push the button again until all the solenoids have fired and the cycle has completed for all sols.
3) No, There is no need to disable the push button as the user will not push the button until the cycle is complete.

For Doggy Dave
Ive been reading about 555 timers and that may be the way to go.
Can you connect a pot to them...? OR does the pot go on the CD 4017

6. ### Dodgydave AAC Fanatic!

Jun 22, 2012
7,606
1,261
pot goes on the 555 timer to alter the time like this circuit, R2b sets the on time of the relay/solenoid, R2a set the off time.

http://www.foroselectronica.es/atta...15-minutos-555-timer-dutty-cicle-variable.jpg

7. ### dthx Thread Starter Member

May 2, 2013
194
14
AWSOME..!
So I need one of these circuits for each solenoid?

8. ### Bernard AAC Fanatic!

Aug 7, 2008
4,926
541
Post # 6 shows how to change frequency & dutycycle & only partially related to your project. If using 4017, on time can be adjustable, but off time same or multiple of on time. Each solenoid needs a driver.

9. ### elec_mech Senior Member

Nov 12, 2008
1,513
195
Okay, here's a first cut at a solution. I have not tried it and can't promise it's foolproof, but at least we can use it as a reference.

U1 is a 555 configured in bistable mode - a flip flop. When the trigger button is pressed, the output goes high and stays high until a reset signal is received - this done when the second solenoid is turned off.

U1 is a 555 in astable mode. It will produce a clock signal used to control how long the solenoids are on and off. You should be able to achieve ~14 seconds or less with the values for C7, R3, and VR1 shown. The output is low (off) until a high signal is received from U1.

U3 is the 4017. Everytime the signal from U2 goes from low to high, a different output goes high. This is easiest to see by looking at the attached timing diagram. When reset to the 4017 is high, output 0 (pin 3) is high. When the trigger button is pressed, U2 is turned on. When the first low-to-high clock signal is received, solenoid 1 is turned on and stays on until the next low-to-high signal is received. From there, output 1 is turned on - it is connected to nothing to give you the pause time you need between solenoids. Next solenoid 2 is turned on. When it turns off, the 4017 and U1 receive reset signals from output 4. This turns off the clock and resets the 4017 so output 0 is on.

I've attached LEDs to outputs 1 and 3 to represent the solenoids. I suggest using LEDs first to verify the circuit works as desired. Once it is, we can help you select the components you'll need to drive the solenoids. This could be relays, transistors, etc.

File size:
72.3 KB
Views:
106
File size:
84.4 KB
Views:
128
10. ### dthx Thread Starter Member

May 2, 2013
194
14
Thanks everyone......dont do any more work on this...
I'm too ignorant to understand what youre saying .....not used to the jargon....and Ive had no training in gates or flip flops, etc....
I have an inkling of what they are but that's all....
I'll figure it out..but I feel guilty that you guys are thinking about my stuff and I can't tjustify it....
I thought I could....but I guess I'll have to use a toggle switch on each sol. and just count out loud....then go to the next one....
If I lived in a more urban area...I could go to my local electronics club ..or some such thing....
But I dont....
But.... I saw 2 deer this morning on the road to the coffee shop....that's something.
So..everything has a upside.
I do really appreciat you guys, though.
D.

11. ### elec_mech Senior Member

Nov 12, 2008
1,513
195
Bah, don't be discouraged. I'll build it when time allows and get back to you - I'd like to verify whether it works or not for my own benefit as well as yours.

Assuming it works or I can work out any kinks, I can post a parts list and you can order from a supplier. If you're comfortable building a circuit, you'll be set. Let us know roughly where you are - U.S., U.K., Asia, Australia, etc. - so we can recommend a good local supplier.

If you'd like to better understand what is happening, we can go through it step by step. While it's good to understand what is going on inside your circuit, I always found it a little more encouraging when starting in electronics to have a project in mind and just build it. The theory can be a bit overwhelming at first and you can spend weeks trying to understand something before actually making anything. That works for some, but it's easy to get discouraged and disinterested for others, especially if you're just tinkering at first.

Have heart, we're here to help.

12. ### Bernard AAC Fanatic!

Aug 7, 2008
4,926
541
'just want to second elec_ mech's last post. If you have completed a Heathkit project, then you can plug in some IC's in a solderless breadboard available from RS, as is a resistor assortment & 555 IC. You do live in US ?
What test equipment do you have or is available to you ?

13. ### dthx Thread Starter Member

May 2, 2013
194
14
You guys are more than kind....
Ok....Here we go..
I can solder and read a VOM and I know what ohms law is but not so good at figuring out the values of a complex circuit.....and I have a lot of questions....
I live in a small town in Louisiana....
Louisiana's motto is "Thank God for Mississippi."
The closest town of any size to me is about 80 miles.
It's only 3 hrs to Houston and about the same to Dallas, though..
We do have a RS next door to our Walmart but the 2 girls in there are clueless
unless you want a cell phone...no disrespect to girls intended....
I went in there to look to see what they had and they had a \$16.00 breadboard and some little packages of wire for maybe \$6.00....and they had a drawer of chips but I had no idea what to get....
The money isnt a prob...I just need some direction.....
but I really dont know how to even use a breadboard....
Where does the power go?
How are connections made....do you jump everything with a wire....?
Do the chip pins just plug in to the board....
I'll need a push button....
Hmmm....maybe I can do this after all....
So....Ok.....Let me know what to do...
One more thing....
If you really want to dive into my project......this is what I have totally invisioned.
I have 6(six)- 12VDC solenoids in all....they are on pneumatic valves.
I dont know what the holding current is for the solenoids yet....and I cant imagine these little chips handling it....but I know they do somehow....
I also want to have a 6 section thumbwheel switch......so that I can set to energize the solenoids at random via the setting on the thumbwheel.
I aslo want the solenoids to be independently set for on time and off time via a pot.
I cant afford a mini controller but I guess that is what we would be building almost...
I understand if you get fed up with this as we go along......I will have no hard feelings if you try to help me and it gets to be a problem....
D.

14. ### elec_mech Senior Member

Nov 12, 2008
1,513
195
Helping you figure out what you need, providing direction, suggestions, help, etc. is not a problem. This forum is for people interested in electronics, specifically for people new to electronics with little to no background. I daresay I'm almost at an intermediate level myself, but that might be stretching it.

We're here to help - not because we have to, certainly not because we're paid, but because we love electronics and helping others. So don't fret.

That said, the best bet for purchasing parts is buying from a distributor such as Digikey or Mouser. There are many, but we'll try to find all the parts from one supplier so you don't have to pay shipping multiple times.

Now, before buying anything, it is important to determine exactly what it is you want to do and come up with a design - otherwise you'll be spending extra time and money.

I built the circuit I posted yesterday and found a couple of boo-boos and then hit a wall trying to get the 4017 to reset the 555. Apparently, the output pins can easily reset the 4017, but problems occur trying to get an output pin to reset the 555 - I tried inverting the signal through a transistor, then a MOSFET, and finally through a 4049 (inverter) and every time the 555 got stuck in reset mode with no way to get out without cycling power. dthx, I mention this so people smarter than I might help determine what isn't working and why.

However, it sounds like the requirements have changed, so before I bang my head against a wall on the aforementioned circuit, let's determine what the end goal is.

So you have six solenoids you want to control?

I'm a bit confused by your description. Could you go through, step by step, what it is you want to happen?

Example:
1. Press button.
2. Solenoid 1 comes on for x seconds.
3. All solenoids turned off for y seconds.
4. Solenoid 2 comes on for z seconds.
When you mention thumbwheel switch, do you mean something like this? Does the thumbwheel determine which solenoid will come on or how long each solenoid will be on? Example, thumbwheel in position 1 means only solenoid 1 will come on, position 2 means only solenoid 2 will come on, etc. or position 1 means a solenoid will be on for 2 seconds, position 2 for 4 seconds, etc.

You mention independent setting of the on/off time for the solenoids. Do you mean you want to set the on and off time of EACH solenoid differently, e.g., set solenoid 1 on for 2 seconds, solenoid 2 for 5 seconds, etc.? Also, will the on and off times be different, e.g., on for 2 seconds, off for 8 seconds?

You mention not being able to afford a controller. This implies you've seen something pre-made that can do what you want - is this true? Could you provide a link? This would help give us a better idea of what function you want.

There are PLCs (programmable logic controllers) that could probably do this, but I'm unsure about their cost.

15. ### tracecom AAC Fanatic!

Apr 16, 2010
3,939
1,430
I guess what you mean is really a microcontroller, and I bet you can afford one. They start at less than a dollar and for five bucks, you can get a huge amount of computing power. Of course, you still need some peripherals (other parts), but you will have to have those regardless of the control circuitry.

Elec_mech is really good with microcontrollers. I don't think you should rule out that option yet. Your project sounds interesting.

16. ### Bernard AAC Fanatic!

Aug 7, 2008
4,926
541
The air valve might require about 200mA, so a PN2222, NPN would do for driver. Might read resistance of solenoid to be sure. Note: solenoid may have an internal series diode, so try reversing meter leads. A rotary switch, 1 pole- 6 or 8 positions is available for \$ 1.29 & does not need decoding as some thumbwheel SW's do. Could also use a SW to give 6 or 8 settable times. ' Do not see need for variable off times if operation is manual. I'll post this now & add a simple drawing loter.

17. ### dthx Thread Starter Member

May 2, 2013
194
14
Thank you....
Here's my wish list...
Electrical Power will come from a 12VDC battery.
1.) Set the 6 position thumbwheel switch to read ....1,3,5,2,4,6......
2.) Turn the power to the circuit "ON" via a toggle switch.
3.) Rotate the pot labled "ON Time" to 3 sec....(the pot should be settable from 1 sec to 10 sec)
5.) Rotate the pot labled "OFF Time" to 5 sec.....(ditto)...
"On Time" meaning energized time and "Off Time" meaning de-energized time.
6.) Push the "GO" button.

Here is what should happen....
1.) Solenoid # 1 energizes for 3 sec and then de-energizes....
2.) After 5 sec from sol #1's dropping out....solenoid #3 energizes for 3 sec..and then de-energizes
3.) After 5 sec from sol #3 dropping out....sol #5 energizes for 3 sec and then de-energizes
4.) After 5 sec from sol #5 droping out ...Sol # 2 energizes for 3 sec and then de-energizes
5.) After 5 sec from sol #2 dropping out....sol #4 energizes for 3 sec and then de-energizes
6. Ater 5 sec from sol # 4 dropping out....sol #6 energizes for 3 sec and then de-energizes
7.)Then...Everything stops until you push the "GO" button again.
For the next sequence.....
You may want to set the thumbwheel for a different firing order AND you might want to vary the pots to change the ON time and Off time.

I would also like to have a "Manual" / "Auto" toggle switch so that I could by-pass the circuit and have six toggle switches (one for each sol) and just fire the solenoids manually.
There ya go...
D.

18. ### elec_mech Senior Member

Nov 12, 2008
1,513
195

How does the thumbwheel work? Example: position 1 fires solenoids in following order: 1, 3, 5, 2, 4 ,6. What do positions 2-6 (more?) do? Change the order but use all six and/or use fewer solenoids?

For the manual operation, are you picturing pressing and holding a momentary switch for as long as you want to actuate each solenoid?

This seems to beg for the use of a microcontroller. One or more 555's with one or more 4017's could do it, but it'll get complicated fast, depending on the function of the thumbwheel switch.

If you're not in a hurry, I could program a chip for you and send it your way along with a schematic on making a complete circuit - perhaps with Tracecom's help if he's interested. I'd love to see Bernard's solution for interfacing to the solenoids - can't say I've done that before.

Alternately, we can guide you through programming a microcontroller yourself if you'd like to learn to program. In this way, you'd learn a lot more and have the ability to modify the operation of your circuit on a whim. Up to you, just let us know how you'd like to proceed.

19. ### dthx Thread Starter Member

May 2, 2013
194
14
All I know about thumbwheel switches is what I read on the Net. Digitran makes them.....I suppose other manufacturers also..
Someone told me that I could use a thumbwheel. If you look em up you can tell what they are...Im sure with your experience.
But theyre a gang switch, kinda....they look kinda like a car odometer with ratchets.
If you roll the first wheel to say.....2....then that is wired to the #2 sol...and 3 on that same wheel is wired to the # 3 sol.....
Yep...lots of wires it seems to me .....but I havent talked to Digitran yet....
Anyway...thats the best explaination that I can do for you on that.
Yes for manual operation...I was going to use 6 toggle or push buttons and count in my mind the number of seconds that I want the sol to be ON and the number of secs that I want it to be off....just throwing the switch back and forth....one switch for each solenoid...
If this project gets too dicey....I can always go with that but because of the setup of the whole project, it would be cumbersome and not my 1st choice.
A couple of things....
You would take a blank chip and burn some kind of program onto it....? How would I get another one if something happened...?
Also, what are some brands of microcontrollers and what kind of programming language do they use?
....I was thinking...in essence this is what I'm doing...
What if I had 6 mechanical 12VDC "one shot" relays..... look at www.micromatic.com
Click on Technical Support and then....Understaning Relays
You probably already know this stuff
But what if I had 6 "one shot' relays....and they all get power at the same time.
AND....the first one is set to make contact for 3 secs (they are adjustable)...1st sol
AND...the 2nd Relay is set to make contact in 8 secs (3+5)...2nd sol
AND ....the 3rd Relay is set to make contact in 16 secs .....3rd sol
And...so on ....until the #6 relay has timed out and then everything stops.....
Apparently thats what a "one shot" Relay does.....according to the site above.
I wouldnt need the Thumbwheel.....
BUT .....the relays are about \$50.00 each, I think.....
So....that's out...
So....if you know of a microcontroller that I could look at .....let me know....
and we can start talking in that direction....
Im up for taking that on....I have time.
And I could pose a question from time to time ....once I got started.
D.

20. ### dthx Thread Starter Member

May 2, 2013
194
14
Ok.....I have stumbled into another world....
Ive just been on the Microchip and Atmel website...
I'm begining to realize what is going on....
I can program my own chip on a breadboard if I can come up with a workable circuit....
Or one of you fine people can help me come up with a circuit...and I can buy the components and (once I have the Microcontroller) I could build a real board....
I think I see a way out of the woods..
D.