Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Solenoid Control.

Solenoid Control.

2005-11-02 by Nice Guy

I know this is kinda off topic, but I'm having problems controlling a
solenoid.  I want to use a gpio pin to simply turn the solenoid on and
off.  I used a NPN transistor in series with the solenoid to control
it, but the solenoid only has around 2 ohms resistance and the
internal resistance of the transistor must be much higher because most
of the voltage is droped across the transistor instead of the
solenoid.  Could someone recomend a better solution to this problem or
suggest a good place on the web to find info.

Thanks

Re: [lpc2000] Solenoid Control.

2005-11-02 by Robert Adsett

At 04:31 AM 11/2/05 +0000, Nice Guy wrote:
>I know this is kinda off topic, but I'm having problems controlling a
>solenoid.  I want to use a gpio pin to simply turn the solenoid on and
>off.  I used a NPN transistor in series with the solenoid to control
>it, but the solenoid only has around 2 ohms resistance and the
>internal resistance of the transistor must be much higher because most
>of the voltage is droped across the transistor instead of the
>solenoid.  Could someone recomend a better solution to this problem or
>suggest a good place on the web to find info.

Actually transistors don't really have a resistance drop then have a 
voltage drop.  If you are driving it into saturation the drop will be from 
0.5V to 1V or even higher depending on the current.  Speaking of current 
the low resistance suggests a high current coil (or a shorted coil). 
Driving that coil with 3V would give a better than 1Amp draw, can your 
power supply support that?  Is the transistor large enough to sink that 
much current?  Maybe you just fused the transistor.

For that kind of drive I'd go for a MOSFET myself.  They are resistance 
devices.  You might be able to drive them from the I/O pin.  If you use a 
logic level FET and drive them at 5V you certainly will be able to.

First I'd check what the drive for that solenoid is supposed to be though, 
that's an awfully low resistance.  I rather suspect it's shorted.  Have you 
got a part number/data sheet link?

Hmm, there is another possibility.  I've run into this in the past on some 
contactors that have four quick connect tabs on the coils.  The first 
instinct is to connect across the two quick connects on the top or bottom 
of the device.  Unfortunately those are connected to the same side of the 
coil and you can end up trying to drive a lot of current to no effect.  Any 
possibility you are not actually measuring across the coil but rather 
somewhere else?

Robert


" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Re: [lpc2000] Solenoid Control.

2005-11-02 by Rob Jansen

> For that kind of drive I'd go for a MOSFET myself.  They are resistance
> devices.  You might be able to drive them from the I/O pin.  If you use a
> logic level FET and drive them at 5V you certainly will be able to.

And do not forget to add a diode accross the FET, some MOSFETs have a 
diode built in but it may be too small, depending on your load.
Solenoids and things like motors have huge coils - keep this in mind 
when designing.

Check your mosfet of choice for Rds and Vgs. Rds is the resistance of 
the FET when fully open (saturated) under specific conditions.
Vgs is the voltage you need to open the channel (this is a bit simple 
but will do to get an idea).

So a MOSFET with Vgs = 20V will not do for a 3.3V lpc21xx controller, 
you may want to go for a different part.

Nice parts are the IRF540 
(http://www.irf.com/product-info/datasheets/data/irf540.pdf), Vgs = 
2-4V, Rds = 0.077 ohm.
Id (continuous drain current) is 28 Amps (at Vgs = 10V, so it will be 
less when driven by the lpc21xx directly).

For smaller currents check out the IRF7403 (it's an SMD package ...) Vgs 
= 1V, Rds = 0.022 ohm, Id = 8.5A.
It's big enough for most of my applications and I tend to use this one 
instead of a standard NPN transistor when driving small loads (up to a 2 
amps).

I get these part from http://www.reichelt.de (German ...) and the 540 
costs 0.52, in SMD version 0.70 and the 7403 is 0.42 - all prices in Euro.

I prefer the SMD parts. Since I design, etch and drill my own PCBs for 
home projects I prefer SMD.
Creating SMD layouts and transfering this to photo sensitive PCB 
material is easy to do (I use HPs overhead film).
Drilling holes is not only time consuming but I also tend to break the 
(fairly expensive) drills from time to time ...

Regards,

    Rob

> Unfortunately those are connected to the same side of the
> coil and you can end up trying to drive a lot of current to no effect.

except from the nice smoke effects that is :-)

Re: [lpc2000] Solenoid Control.

2005-11-02 by Tom Walsh

Rob Jansen wrote:

>>For that kind of drive I'd go for a MOSFET myself.  They are resistance
>>devices.  You might be able to drive them from the I/O pin.  If you use a
>>logic level FET and drive them at 5V you certainly will be able to.
>>    
>>
>
>And do not forget to add a diode accross the FET, some MOSFETs have a 
>diode built in but it may be too small, depending on your load.
>Solenoids and things like motors have huge coils - keep this in mind 
>when designing.
>  
>

I generally use a 2N7000 or 2N7002 FET for driving relays.  They can 
sink up to 100ma easily and have an internal clamping diode to protect 
the gate when the coil (de)energizes.

TomW




>Check your mosfet of choice for Rds and Vgs. Rds is the resistance of 
>the FET when fully open (saturated) under specific conditions.
>Vgs is the voltage you need to open the channel (this is a bit simple 
>but will do to get an idea).
>
>So a MOSFET with Vgs = 20V will not do for a 3.3V lpc21xx controller, 
>you may want to go for a different part.
>
>Nice parts are the IRF540 
>(http://www.irf.com/product-info/datasheets/data/irf540.pdf), Vgs = 
>2-4V, Rds = 0.077 ohm.
>Id (continuous drain current) is 28 Amps (at Vgs = 10V, so it will be 
>less when driven by the lpc21xx directly).
>
>For smaller currents check out the IRF7403 (it's an SMD package ...) Vgs 
>= 1V, Rds = 0.022 ohm, Id = 8.5A.
>It's big enough for most of my applications and I tend to use this one 
>instead of a standard NPN transistor when driving small loads (up to a 2 
>amps).
>
>I get these part from http://www.reichelt.de (German ...) and the 540 
>costs 0.52, in SMD version 0.70 and the 7403 is 0.42 - all prices in Euro.
>
>I prefer the SMD parts. Since I design, etch and drill my own PCBs for 
>home projects I prefer SMD.
>Creating SMD layouts and transfering this to photo sensitive PCB 
>material is easy to do (I use HPs overhead film).
>Drilling holes is not only time consuming but I also tend to break the 
>(fairly expensive) drills from time to time ...
>
>Regards,
>
>    Rob
>
>  
>
>>Unfortunately those are connected to the same side of the
>>coil and you can end up trying to drive a lot of current to no effect.
>>    
>>
>
>except from the nice smoke effects that is :-)
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>  
>


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: [lpc2000] Solenoid Control.

2005-11-02 by Robert Adsett

At 06:35 AM 11/2/05 +0100, Rob Jansen wrote:

> > For that kind of drive I'd go for a MOSFET myself.  They are resistance
> > devices.  You might be able to drive them from the I/O pin.  If you use a
> > logic level FET and drive them at 5V you certainly will be able to.
>
>And do not forget to add a diode accross the FET, some MOSFETs have a
>diode built in but it may be too small, depending on your load.
>Solenoids and things like motors have huge coils - keep this in mind
>when designing.

Good thing to check although I've not seen a power FET whose integral body 
diode wasn't rated for a much current as the FET itself.  More important 
make sure the coil is properly suppressed either with a diode or some other 
circuit.

>Check your mosfet of choice for Rds and Vgs. Rds is the resistance of
>the FET when fully open (saturated) under specific conditions.
>Vgs is the voltage you need to open the channel (this is a bit simple
>but will do to get an idea).
>
>So a MOSFET with Vgs = 20V will not do for a 3.3V lpc21xx controller,
>you may want to go for a different part.

Have you ever seen a MOSFET rated for a threshold that high?  If you are 
taking about logic level FETs I have seen VGS max of +/- 20V fairly 
commonly on logic level FETs.  I think the highest threshold I've seen for 
VGS was about 5V.

>Nice parts are the IRF540
>(http://www.irf.com/product-info/datasheets/data/irf540.pdf), Vgs =
>2-4V, Rds = 0.077 ohm.
>Id (continuous drain current) is 28 Amps (at Vgs = 10V, so it will be
>less when driven by the lpc21xx directly).

Well maybe, That 4V is the maximum for the threshold voltage so to 
guarantee turn on you need to drive above that voltage. preferably at 10V 
or more.  It will work at 5V although with higher RDS.  It might work at 3V 
but you'd be right at the turn-on knee so you would be taking a chance.


>For smaller currents check out the IRF7403 (it's an SMD package ...) Vgs
>= 1V, Rds = 0.022 ohm, Id = 8.5A.
>It's big enough for most of my applications and I tend to use this one
>instead of a standard NPN transistor when driving small loads (up to a 2
>amps).

Now that's a logic level FET.

> > Unfortunately those are connected to the same side of the
> > coil and you can end up trying to drive a lot of current to no effect.
>
>except from the nice smoke effects that is :-)


That's what over-current circuits are for :)  You can't expect the end 
users not to make an occasional mistake hooking up a coil and of course 
they do short from time to time.  Now if they hook up the power leads to 
the motor controller backwards that's another story entirely ;)

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Re: [lpc2000] Solenoid Control.

2005-11-02 by Robert Adsett

At 02:45 PM 11/2/05 -0500, Tom Walsh wrote:
>Rob Jansen wrote:
>
> >>For that kind of drive I'd go for a MOSFET myself.  They are resistance
> >>devices.  You might be able to drive them from the I/O pin.  If you use a
> >>logic level FET and drive them at 5V you certainly will be able to.
> >>
> >>
> >
> >And do not forget to add a diode accross the FET, some MOSFETs have a
> >diode built in but it may be too small, depending on your load.
> >Solenoids and things like motors have huge coils - keep this in mind
> >when designing.
> >
> >
>
>I generally use a 2N7000 or 2N7002 FET for driving relays.  They can
>sink up to 100ma easily and have an internal clamping diode to protect
>the gate when the coil (de)energizes.


Well the original post did say they had a 2 Ohm coil.  That in turn would 
suggest a multiamp drive was needed.  That diode in the 2n7000 won't 
protect against inductive spikes though, it's in the wrong part of the 
circuit.  You are probably getting avalanche breakdown and I don't think 
I've seen a data sheet for either of these parts with an avalanche rating.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Re: [lpc2000] Solenoid Control.

2005-11-03 by Tom Walsh

Robert Adsett wrote:

>At 02:45 PM 11/2/05 -0500, Tom Walsh wrote:
>  
>
>>Rob Jansen wrote:
>>
>>    
>>
>>>>For that kind of drive I'd go for a MOSFET myself.  They are resistance
>>>>devices.  You might be able to drive them from the I/O pin.  If you use a
>>>>logic level FET and drive them at 5V you certainly will be able to.
>>>>
>>>>
>>>>        
>>>>
>>>And do not forget to add a diode accross the FET, some MOSFETs have a
>>>diode built in but it may be too small, depending on your load.
>>>Solenoids and things like motors have huge coils - keep this in mind
>>>when designing.
>>>
>>>
>>>      
>>>
>>I generally use a 2N7000 or 2N7002 FET for driving relays.  They can
>>sink up to 100ma easily and have an internal clamping diode to protect
>>the gate when the coil (de)energizes.
>>    
>>
>
>
>Well the original post did say they had a 2 Ohm coil.  That in turn would 
>suggest a multiamp drive was needed.  That diode in the 2n7000 won't 
>protect against inductive spikes though, it's in the wrong part of the 
>circuit.  You are probably getting avalanche breakdown and I don't think 
>I've seen a data sheet for either of these parts with an avalanche rating.
>
>  
>
OW, missed that one!  Well, bigger FET and larger diode(s) then...  
Perhaps an IRF530, lots of power in that, somewhere around 6 AMPs, 
IIRC.  It could also be switched from 5volt logic.

Trouble with transistors is that they are current devices, they magnify 
current based on the beta (gain) of the device.  You don't suffer that 
problem with an FET as it controls current with a voltage on the GATE 
(low current draw on the control voltage).  Definately would go with a 
MOSFET or BI-FET.

TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: [lpc2000] Solenoid Control.

2005-11-03 by Peter Jakacki

Solenoids require a lot of current to "pull-in" the plunger. After the 
plunger has been pulled-in a smaller amount of current is all that is 
required to hold it. Some solenoids may have two windings, the primary 
high-current pull-in winding, and the secondary low-current hold 
winding. These windings may be switched over internally by the plunger 
action. If your solenoid has only a single winding you will find that 
the large amount of current flowing will produce heating effects. It is 
usually advisable for this reason, and also for reduced current 
consumption that the winding be switched to a lower current either by 
means of reduced voltage or by the PWM method. The PWM could be 
implemented in sw as it only needs to be a low frequency.

If a bipolar transistor is used to drive the solenoid then it will 
usually require a significant amount of base drive current to achieve 
saturation, much more than a logic pin can usually provide. The device 
of choice for driving solenoids has to be the MOSFET due to the fact 
that it requires practically no current to drive, it features an 
integrated clamp diode, and they are available in special configurations 
such as autoprotected.

Although it is true that you don't need a resistor in the gate drive 
circuit it is good practice to include one in the event of a MOSFET 
failure for whatever reason and there is a breakdown from drain to gate 
(yep!). In which event the unprotected logic device will release it's 
magic smoke and forever cease to function.

2N7000s are unsuitable for anything but small signal or very low-current 
(IMO, don't use them). The IRF7403 that was mentioned is a good 
candidate for medium power drive. Personally, if I have room I allow for 
standard TO-220 through-hole parts. My favorite is the IRF3205, they are 
cheap and being rated at 110A are hard to destroy, the pcb tracks 
vaporise first.

I find that due to the excellent clamp action of the integrated diode 
that an external coil diode is not (never) required. Also, but not very 
importantly, the breakdown voltage of the integrated diode allows the 
magnetic field to collapse faster increasing the response time of the 
solenoid release. If for instance you were driving a relay and needed 
faster release, you would not use a normal diode across the coil. You 
could either feed the power via a series fast-zener (etc) or depend upon 
the integrated diode. Which by the way means that the coil needs to dump 
it's current in reverse through the power supply so it is advisable to 
have a diode (preferably a transzorb) device across the supply rails or 
you could find those voltage spikes appearing at rather sensitive places.

Summary: use low RDSon low Vgs mosget with series resistor (10K-100K), 
along with a clamp diode across the supply.

*Peter*




Nice Guy wrote:
Show quoted textHide quoted text
> I know this is kinda off topic, but I'm having problems controlling a
> solenoid.  I want to use a gpio pin to simply turn the solenoid on and
> off.  I used a NPN transistor in series with the solenoid to control
> it, but the solenoid only has around 2 ohms resistance and the
> internal resistance of the transistor must be much higher because most
> of the voltage is droped across the transistor instead of the
> solenoid.  Could someone recomend a better solution to this problem or
> suggest a good place on the web to find info.

Re: Solenoid Control.

2005-11-03 by charlesgrenz

Hi Tom,

  We use a IRFD110 (Hex Dip MOSFET) with a 1N4001 diode to control 0.5
amps in a very small package. They are also logic compatiable.

regards,
Charles

--- In lpc2000@yahoogroups.com, Tom Walsh <tom@o...> wrote:
>
> Robert Adsett wrote:
> 
> >At 02:45 PM 11/2/05 -0500, Tom Walsh wrote:
> >  
> >
> >>Rob Jansen wrote:
> >>
> >>    
> >>
> >>>>For that kind of drive I'd go for a MOSFET myself.  They are
resistance
> >>>>devices.  You might be able to drive them from the I/O pin.  If
you use a
> >>>>logic level FET and drive them at 5V you certainly will be able to.
> >>>>
> >>>>
> >>>>        
> >>>>
> >>>And do not forget to add a diode accross the FET, some MOSFETs have a
> >>>diode built in but it may be too small, depending on your load.
> >>>Solenoids and things like motors have huge coils - keep this in mind
> >>>when designing.
> >>>
> >>>
> >>>      
> >>>
> >>I generally use a 2N7000 or 2N7002 FET for driving relays.  They can
> >>sink up to 100ma easily and have an internal clamping diode to protect
> >>the gate when the coil (de)energizes.
> >>    
> >>
> >
> >
> >Well the original post did say they had a 2 Ohm coil.  That in turn
would 
> >suggest a multiamp drive was needed.  That diode in the 2n7000 won't 
> >protect against inductive spikes though, it's in the wrong part of the 
> >circuit.  You are probably getting avalanche breakdown and I don't
think 
> >I've seen a data sheet for either of these parts with an avalanche
rating.
Show quoted textHide quoted text
> >
> >  
> >
> OW, missed that one!  Well, bigger FET and larger diode(s) then...  
> Perhaps an IRF530, lots of power in that, somewhere around 6 AMPs, 
> IIRC.  It could also be switched from 5volt logic.
> 
> Trouble with transistors is that they are current devices, they magnify 
> current based on the beta (gain) of the device.  You don't suffer that 
> problem with an FET as it controls current with a voltage on the GATE 
> (low current draw on the control voltage).  Definately would go with a 
> MOSFET or BI-FET.
> 
> TomW
> 
> 
> -- 
> Tom Walsh - WN3L - Embedded Systems Consultant
> http://openhardware.net, http://cyberiansoftware.com
> "Windows? No thanks, I have work to do..."
> ----------------------------------------------------
>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.