Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Ocelot on July 07, 2009, 08:22:59 PM

Title: Solenoid Valve Circuit to work with Axon
Post by: Ocelot on July 07, 2009, 08:22:59 PM
Hey all,

I'm having a bit of a run of bad luck with circuits. I'm trying to get the attached solenoid valve circuit to work with Axon. I'm using a regulated 5V supply pin and correlating ground from one of Axon's analog pins for the circuit ground and +5V supply. Then I'm using one of Axon's digital pins that I've turned on as an input to toggle the solenoid valve on and off.

The NPN transistor I am using is a 2N5210 (http://www.fairchildsemi.com/ds/2N/2N5210.pdf (http://www.fairchildsemi.com/ds/2N/2N5210.pdf)). To be honest I'm new to NPN transistors and am not sure this is the right one I need for this circuit.

The purpose of the circuit is when the Axon digital I/O pin goes digital high, then the NPN switches to ground and turns on the solenoid valve.

I can get the solenoid valve to turn on and off by connecting it straight to the 5V supply and ground from Axon and toggling it on and off with a physical flip switch but the problem I'm having is that the NPN isn't creating a true ground. My multimeter is telling me that when the Axon I/O goes high, the NPN for some reason goes to 2.81V instead of ground.

Is this the right NPN for this application? If anyone has any other ways to be able to switch the valve on and off with the Axon please feel free to share.

The solenoid valve I'm using has the following specs
Voltage:               5 VDC
Amps:                 320 mA
Resistance:         18 Ohm
Title: Re: Solenoid Valve Circuit to work with Axon
Post by: Soeren on July 07, 2009, 09:11:44 PM
Hi,

The NPN transistor I am using is a 2N5210

[...] the NPN for some reason goes to 2.81V instead of ground.

The solenoid valve I'm using has the following specs
Voltage:               5 VDC
Amps:                 320 mA
Resistance:         18 Ohm
No wonder... According to the datasheet that you link to, the 2N5210 is good for max. 100mA (and then there's virtual no gain left to speak of).
If you use a 2N2222 (or BC337) instead, the current handling issue is dealt with and to improve this very simple circuit, do the following:
The transistors collector will now be able to pull the relay to (nearly) 0V.


Title: Re: Solenoid Valve Circuit to work with Axon
Post by: Ocelot on July 08, 2009, 05:57:39 AM
Hi,

The NPN transistor I am using is a 2N5210

[...] the NPN for some reason goes to 2.81V instead of ground.

The solenoid valve I'm using has the following specs
Voltage:               5 VDC
Amps:                 320 mA
Resistance:         18 Ohm
No wonder... According to the datasheet that you link to, the 2N5210 is good for max. 100mA (and then there's virtual no gain left to speak of).
If you use a 2N2222 (or BC337) instead, the current handling issue is dealt with and to improve this very simple circuit, do the following:
  • Move the leftmost resistor (the 4k7) from the left side of the other resistor (the 2k7) (i.e. directly to the transistor base).
  • Change both resistors to 1kOhm.
The transistors collector will now be able to pull the relay to (nearly) 0V.




Awesome, thanks Soeren. I knew I was missing something when I ordered the NPN.
Title: Re: Solenoid Valve Circuit to work with Axon
Post by: Admin on July 09, 2009, 06:30:46 PM
MOSFETs are much better for high current applications like this. ;D
Title: Re: Solenoid Valve Circuit to work with Axon
Post by: Soeren on July 09, 2009, 09:52:08 PM
And sadly, they're very easy to snuff by ESD - BjTs OTOH are tough little buggers and with just 320 mA, I fail to see the great win by switching to a MOSFET (plus driver).
Title: Re: Solenoid Valve Circuit to work with Axon
Post by: Admin on July 10, 2009, 04:44:08 AM
I guess for 320mA a MOSFET isn't a big deal . . . and MOSFETs don't really need drivers these days ;D
Title: Re: Solenoid Valve Circuit to work with Axon
Post by: Ocelot on July 10, 2009, 07:32:14 AM
The 2N2222 and the changes you suggested worked perfectly. Thanks for the help Soeren!
Title: Re: Solenoid Valve Circuit to work with Axon
Post by: Soeren on July 16, 2009, 08:59:05 AM
Hi,

[...] and MOSFETs don't really need drivers these days ;D
Not for driving a simple relay, but I'm sure some designers will be very pleased with a hint on how to drive the PWM controlled solenoids in an EFI system with just a few mA and the 1MHz+ SMPSU designers will probably be hysterically happy as well, to get in on that secret of how to avoid ms. Ciss and mr. Miller ;D
Title: Re: Solenoid Valve Circuit to work with Axon
Post by: Soeren on July 16, 2009, 09:01:02 AM
Hi,

The 2N2222 and the changes you suggested worked perfectly. Thanks for the help Soeren!
Glad it worked (I kinda knew that though ;)) and I hope I can help with some of your other questions later.