Switching circuit for a solenoid

Thread Starter

RHoppus

Joined Oct 19, 2011
10
I am working on designing a circuit mostly based on info found at this site. It seems to work in the simulator but I'm not sure about the real world. What I am trying to do is control the length of the "on" time and "off" time to actuate the solenoid. So before I buy parts, I am hoping for some direction as to how it might be improved.
Thanks
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
What range do you want for the ON time, and what range do you want for the OFF time?

You need a resistor between R2 and +9v; 1K will work. This will guard against turning R2 down too low; without a fixed 1k resistor there, you risk burning up the 555 timer and/or the pot R2.

You need a diode across the solenoid's coil.
The BC107 is not really a wonderful choice. Its' max collector current is 100mA, which gives it a practical limit of around 50mA. If that's all your solenoid coil requires, you will be OK - but a 2N2222 or PN2222 has an 800mA limit, good for ~500mA, and is probably cheaper than the BC107.

The 47uF Cf really isn't doing anything useful; but it IS putting extra load on the output when the output is changing states.

You don't show capacitors across Vcc and GND. You need a 0.1uF ceramic or poly metal film and a 1uF or larger aluminum electrolytic across the supply pins.
You could use a 10nF cap from pin 5 to ground instead.
 

Thread Starter

RHoppus

Joined Oct 19, 2011
10
First off -thanks for the reply. This is a great site! :)
I would like the solenoid to fire in the 10hz range and want the on time adjustable within that range. It has a 4.8w coil.
I changed the circuit per your recommendations and have included a readout from the scope accross the solenoid coil (see attached). It seems it should stay high longer (on) to match the pin 3 signal, correct?
So is that a good thing to have the "extra load" on the output (pin 3) with a 47uf cap?
Pin 5 is RST correct? I made that change and circuit did not produce output at pin 3. So I put it on pin 1. ??

I just changed the solenoid to a 7.5w light and the scope display changed to what I expected...... So I think I figured that out (needed the load)
 

Attachments

Last edited:

Bernard

Joined Aug 7, 2008
5,784
Your pin nos. are all screwed up- mostly at least.
1- gnd, 2 trigger, 3 output, 4- reset- tie to +supply, 5 .01μF to gnd., 6 threshold, 7- discharge, 8- + supply. 47μF pin 3 to gnd- not good. Would also add 10k from base of 2222 to gnd.
 

crutschow

Joined Mar 14, 2008
34,408
To operate the coil at 10Hz you will likely need to add a zener as well as a diode in series across the solenoid (diode cathode to plus, zener anode to plus) for transient suppression. A diode alone will cause a significant delay in the solenoid release time. The zener voltage value should be no more than about 50% of the transistor voltage rating.
 

SgtWookie

Joined Jul 17, 2007
22,230
Try it like the attached.

Note that I've changed C1 to 0.27uF; this is about right for the 10Hz range you're interested in.

I've also changed the 2N2222 to an MPSA06. You could also use a 2N5551 or 2N5550. The 2N2222 didn't have quite a high enough Vceo rating; the MPSA06 is good for up to 80v; the '5551 up to 160v.

R4 has been changed to 330 Ohms, which allows ~20mA base current. Since you say your solenoid is 4.8 Watts, that translates to 4.8W/24V=200mA, so the base current needs to be 1/10th of that.

ZD1 is a 24v 1W Zener diode. It will stop the current flow through the solenoid as quickly as it started flowing. You could also use a 120 Ohm resistor, which would be cheaper, but it would take longer for the current flow to stop.

I've used a Schottky diode for D2. You don't necessarily have to use one. A 1N5819 would work. A 1N4148/1N914 would be kind of marginal.
 

Attachments

Thread Starter

RHoppus

Joined Oct 19, 2011
10
Thank you very much for taking the time to do this!! You are the man!!
I am going to reconfigure my sim to check it out and try to learn something here. I might have more questions later, but until then -have a great day!
 

Thread Starter

RHoppus

Joined Oct 19, 2011
10
I thought I would use the LT Spice program (as I saw you use) to redo my sim. Problem being I can't find some of the components, like the LM555 or the IN4749. I tried to find the .asy files needed which took me to some archived postings that you uploaded but the attachment links are not active.
http://forum.allaboutcircuits.com/archive/index.php/t-36456.html
Can you share with me the model you created or the links to the .asy files?
Thank you Sir.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Well, you should be able to simulate it in your package - what is it, Multisim?

No, you wouldn't have all of the models I do; I've been accumulating as I go. I made the symbol for this 555, and used a macro that more accurately represents a "real" 555 timer than the default LTSpice NE555; that one is optimized for speed.

On the attached files:
"555 Solenoid Variable Timer.asc" goes in \Program Files\LTC\LTSpiceIV

LM555.zip -
LM555.asy goes in \Program Files\LTC\LTSpiceIV\lib\sym\misc
LM555.sub goes in \Program Files\LTC\LTSpiceIV\lib\sub

standard.bjt.dio.zip -
RENAME your existing standard.dio to standard.dio.bak and standard.bjt to standard.bjt.bak
standard.dio and standard.bjt get extracted and go in \Program Files\LTC\LTSpiceIV\lib\cmp

pot.zip -
pot.asy goes in \Program Files\LTC\LTSpiceIV\lib\sym
pot.sub goes in \Program Files\LTC\LTSpiceIV\lib\sub


pot
 

Attachments

Thread Starter

RHoppus

Joined Oct 19, 2011
10
Thanks for all your help so far.
Just wanted to try LTSpice.
Here it is, I changed a couple of values to get me greater range for timimg. The 1N5820 was used cause the sim didn't have the 19 and I have a light in place of solenoid for visual. Anyway, now I am wondering if you might have an easy solution for controlling how many pulses (lets say 2-5)at solenoid then 1-5 seconds delay then 2-5 pulses- delay and so on at any given frequency set by this circuit. Hope that makes sense. Would I need another 555 somehow?
Thanks again.
Ron
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
What are you trying to do with this circuit?

Is it actually going to be doing something useful, or is this just an experiment?
 

Thread Starter

RHoppus

Joined Oct 19, 2011
10
Yes, the plan is that it will eventually be a useful circuit (actually it is right now). I was just needing a bit of help getting there. I will be controlling water drops with the valve.
Here is what I am thinking. I would like a SPST switch to enable the whole circuit. Then a SPDT to switch between this part of the circuit and the new "pulse control" to enable it to control pulses as described in previous post. The problem is I am not quite sure how to do this. Would this require a micro controller? Another 555 or something else.
Any thoughts are appreciated.
Thanks again
 

Thread Starter

RHoppus

Joined Oct 19, 2011
10
Hi Sarg,
I appreciate all the help with my project. I think I have the 2nd part figured out but when I breadboard this up as planned it doesn't work. I have an LED at the gate to see it blinking. I checked the solenoid and it has 100 ohm across the coil. Also my wall wart is rated 24VDC 400ma but it measures 30.5V. Will that change the value of the 330ohm resister in order to make it switch the MSAP06? Do I need to calculate the wattage as 30.5*30.5/100=9.3w and then 9.3w/30.5vdc=304ma so 1/10th=30ma and R=E/I so 100ohm=30.5v/.304a? Is this how to calculate the resistor at pin 3 of 555? Also if you have a look at the scope shots you will see what I am trying to do with the second part of the control. And wondering if you know why the first pulse has a longer on time?
Thanks
 

Attachments

Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Funny, I was just wondering what happened to this thread late last night.

I appreciate all the help with my project. I think I have the 2nd part figured out but when I breadboard this up as planned it doesn't work. I have an LED at the gate to see it blinking.
You mean that you have an LED on the base of Q1.
That simply won't work, as the base of Q1 will never exceed ~1v, and visible light LEDs start off at about 1.7v for the old-type red LEDs.
You would have to go from the output of the 555 timer directly, and use a current limiting resistor in series with it.

I suggest connecting the cathode to the 555's pin 3, and the anode to the resistor, then the resistor to Vcc. That way the LED will turn ON when the solenoid is supposed to be off, and off when it's supposed to be ON. It also won't reduce the available base current for Q1.

I checked the solenoid and it has 100 ohm across the coil.
24v / 100 Ohms = 240mA and 5.76 Watts.

Also my wall wart is rated 24VDC 400ma but it measures 30.5V.
Your wall-wart is unregulated then. If it has a 400mA load (24v/60 Ohms = 400mA), it should measure within 10% of 24v.

So, your wall-wart transformer has an impedance of ~16.25 Ohms. In order to get the voltage across the solenoid under control, you'll need to add about 11 Ohms in series with it. 10 Ohms is close enough; it's a standard value. A 10 Ohm resistor will dissipate about 580mW, so you need ~1.6 times that much rating which brings us to ~930mW.
Radio Shack sells 10 Ohm 1 Watt resistors, which is just what you need:
http://www.radioshack.com/product/i...&filterName=Type&filterValue=1-watt+resistors

To simulate your wall wart, have V2 be 30.5v with 16.25 Ohms resistance. If you can't add series resistance to V2 itself, then use a 16.25 Ohm resistor in series with V2, and call it RV2.

Will that change the value of the 330ohm resister in order to make it switch the MSAP06?
No, not since you're going to add the resistor in series with the solenoid.

Do I need to calculate the wattage as 30.5*30.5/100=9.3w and then 9.3w/30.5vdc=304ma so 1/10th=30ma and R=E/I so 100ohm=30.5v/.304a?
No.
I've added 10 Ohms of resistance in series with the solenoid, so now the voltage across the solenoid will be ~24V when Q1 is conducting.
24v/100 Ohms = 240mA.
240mA/10=24mA, which is the current you need through the base of Q1.
Figure that pin 3 will be ~1.3v less than 9v due to the Darlington follower configuration of the 555 timer.
Figure that Q1's base will be ~0.8v when 24mA is flowing through it.
Rbase = (9v-(1.3v+0.8v))/24mA = (9-2.1)/0.024A =6.9/0.024 =287.5 Ohms. 270 and 300 Ohms are both close enough.
I had 330 Ohms for the base resistor in my simulation; I probably had calculated 9v-1.2v and 0.7v for the Vbe.

Also if you have a look at the scope shots you will see what I am trying to do with the second part of the control. And wondering if you know why the first pulse has a longer on time?
When you hold the RESET input low, the timer discharges the timing cap completely. This causes the 1st pulse to be longer than subsequent pulses.

Instead, you might use the 1st timer's pin 3 via a 1k base resistor to turn on an NPN transistor wired as common emitter, with its' collector tied to a 3v Zener that limits the 2nd timers' C1 voltage to 3v - and leave the RESET input tied to Vcc.
 

Thread Starter

RHoppus

Joined Oct 19, 2011
10
There is a lot there to chew on here! And it will take some time for me to absorb all this. But after making some changes to my sim, is this what you mean? I moved the LED (works as you said) I don't see the voltage change after the 10 ohm resistor was added. And I probably don't have the Transistor wired correctly; although the sim runs the "on" pulse is still longer on the first one with the scope. I'm headed to RS to get the resistor, just wanted to be sure.
You patience and knowledge is appreciated.

Thank you Sir!
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Do me a favor, will you?
Instead of attaching .pdf files, do a screen print (using Ctrl+PrintScreen or Alt+PrintScreen), then paste it in MSPaint (use Ctrl+V), crop to suit, and save as a .png file. Then upload the .png file as you've been uploading the .pdf's.

I don't have to download .png files; I can simply click on the .png image thumbnail, and view it online.
With .pdf files, I have to download each one, start Adobe Reader, view the file, and then go back and delete it. This makes more work for me.

And no, you did not wire it correctly.

R8 belongs just above X1, the top end should connect to the junction of D3 and V2, the lower end connects to the upper end of X1.

Then you need to either change the resistance of V2 to 16.25 Ohms, or put another resistor in where you had R8 and make it's value 16.25 Ohms.

The emitter of Q2 goes to ground.
The collector gets connected to the anode of D5.
The cathode of D5 gets connected to the junction of D1/C1/R2/THR/TRI.
 

Thread Starter

RHoppus

Joined Oct 19, 2011
10
I love you man!

I got the 10 OHM resistor, inserted it.... nothing. Then I was remembering that in your circuit the DC- from 9v & 24v sides are connected. So I thought what could it hurt and tried it. Wham... solenoid started to fire! ..... Is this easy to explain to a novice?
I haven't incorporated the other part of the control on the breadboard yet but have in the sim and am still not clear for the change with the NPN transistor . I will surly have more questions then but for now I want to "play" with what I have working now.
And how easy would it be to use the same wall wart to also supply the 9v for the other side of the circuit?

Thanks again!
 

Wendy

Joined Mar 24, 2008
23,421
Depends on current. Read the current rating on the wall wart, then measure how much current you are actually using. If one solenoid is more than 35% then you probably need another, more powerful wall wart.

With electronics it is a really good idea not to try to run components at 100% of their rated values. This usually means a much shorter lifespan if you do.
 

SgtWookie

Joined Jul 17, 2007
22,230
Well, I DID show grounds in my schematic, and you showed grounds on both sides of yours tied together.

Without the supplies having a common ground, there won't be a way to turn on Q1; so the solenoid won't engage.

Here are the changes; circled in pink. Some stuff moved, some stuff appeared, some stuff disappeared.



And how easy would it be to use the same wall wart to also supply the 9v for the other side of the circuit?
You could probably use a regulator like an LM317 from the 24v supply. It wouldn't be very efficient, but the LV side doesn't use much current.
[eta]
An LM7809 or LM7810 fixed positive regulator would work as well. You could also use an LM7805 with a 750 Ohm resistor from the GND pin to GND as well. Make certain to use an 0.33uF cap from IN to GND, and another 0.1uF cap from OUT to GND, or the regulator can be unstable (oscillate)
 

Attachments

Last edited:

Thread Starter

RHoppus

Joined Oct 19, 2011
10
Thanks- but it seems that last change takes away my timing ability for the first part of the circuit and not sure that it evened out the pulse length. The second circuit should enable the first for X amount of pulses to solenoid then off for X seconds- repeat. I was just trying to keep the first pulse the same length as the rest.
At this point this is doing want I needed :), but I would like to add a visual readout (lcd?) for the pot settings so I can return to values that are working best. Do you have any ideas for me? Perhaps panels meters that read ohms?
 
Last edited:
Top