3 wire solenoid

I tend to use MOSFETs interchangeably with BJTs at random :wink:

Q1 I would use either MOSFET or BJT depending on what else I was using in the circuit (economies of scale), or what I had lying around.

Q2 I would use a MOSFET if the voltage drop of Rdson * Ids is less than the fixed voltage drop of the PNP transistor.

The resistors are just current limiting / pullup resistors, 10K for R2 is reasonable, and somewhere around 2K for R1 is a normal kind of value - the values aren't too critical - too low and you'll get excess current draw, wasting power, and too high and you won't switch properly.

If you tie the "Common" lead of the solenoid to Vsupply and each remaining solenoid wire to the Collector of an NPN Transistor, Emitter to ground... With Back Emf Diodes. Vsupply can be ANY voltage. The base drive voltage can be as low as a volt (with suitable base resistor such that Ib > Ic/Beta (transistor current gain) and the solenoid coil will have Vsupply - Vcesat across it... no Fet or PNP transistor need be used or needed. As a side note those are solenoids I used for many years for Irrigation control, they "Latch" because there is a small "bias" magnet internal to the solenoid that causes the solenoid to 'stick' or latch until the Bias is reversed by activating the reversed winding of the 'unlatch' lead of the solenoid.

Doc

I am not sure I understand you 100%, can you please upload a simple scheme of what you mean?

srusha:
I am not sure I understand you 100%, can you please upload a simple scheme of what you mean?

Turn my schematic upside down and use NPN instead of PNP, and use your solenoid backwards.

thats what I thought,

My solenoids dont work like that, the only latch if you attach to common ground,

I have 3 wires, white black and red. the white should be grounded. and the black or the red should be vdd, if I do it the opposite way its not working.

Then there's a chance that it may have integral flyback diodes.

The circuit given in reply #5 is missing an important detail. There should be a resistor between the collector of Q2 and the junction of R2 and the base of Q2. Without this resistor, Q1 may overheat due to excessive collector current. Alternatively (and preferably), replace Q2 by a P-channel mosfet.

I'm so used to using a mosfet for q2 I often forget the resistor.

dc42:
The circuit given in reply #5 is missing an important detail. There should be a resistor between the collector of Q2 and the junction of R2 and the base of Q2. Without this resistor, Q1 may overheat due to excessive collector current. Alternatively (and preferably), replace Q2 by a P-channel mosfet.

You meant between the collector of Q1 and the base of Q2 right?

1k should be enough right?

I will eventually (probably) will use pmos and not bipolar but I guess I will get the bipolar first (shipment is already on the way)

srusha:

dc42:
The circuit given in reply #5 is missing an important detail. There should be a resistor between the collector of Q2 and the junction of R2 and the base of Q2. Without this resistor, Q1 may overheat due to excessive collector current. Alternatively (and preferably), replace Q2 by a P-channel mosfet.

You meant between the collector of Q1 and the base of Q2 right?

1k should be enough right?

I will eventually (probably) will use pmos and not bipolar but I guess I will get the bipolar first (shipment is already on the way)

Yes, that's right - just like a base resistor when connecting to the output of the Arduino - limit the base current.

The solenoid is made by GAL an Israeli company,. Motorola bought a bunch of them for their "Piccolo" irrigation controller in the late 90's (I think). I designed irrigation control equipment for about 20 years... there might very well be back emf diodes I do remember one that had them. The control circuit I designed was for 2 wire latching solenoids of the type similar to the "normal" ac solenoids however I had a circuit that "Dumped" a 4700uF cap charged to 12Vdc into the solenoid. I used a DPDT relay as a "reversing" switch and it would handle either 2 or 3 wire solenoids. I do know about polarity issues with the Gal solenoid and with the Rainbird type of 3 wire solenoids. The Rainbird solenoid fit on the valve, the GAL type was a "Pilot" valve type of valve controller. In my circuit (I made several thousand of them) the transistor switch grounded one end of the solenoid the relay decided the end that was grounded and which end was "hot". The "common" solenoid wire was connected to the capacitor (+12V end of the 4700uF capacitor) for 3 wire solenoids. My design worked with all solenoids and would drive a solenoid through a 1000' length of 16 Ga wire (from a 4700uF capacitor charged to 12V). I later used a MAX1771 to provide an 18V source that would work through about a 1/4 mile or about 1700 feet of 16 Ga wire. My pulse length was 100 mS and the cap had done its work in the first 20 or so mS the rest of the time was there for damping the solenoid (simply terminating the solenoid through a load.... the discharged capacitor).

Doc

are you talking about Gal-con?

http://galconc.com/

Thoughts and remembered considerations missing from last post. Doc

About midway through that design cycle I changed to a P222 N Ch Mosfet because I had drive issues with the Bi-polar part due to beta changes that occur when the collector current increases. These changes require a big increase in base drive to the switch transistor. Mosfets don't have this issue. I also found early in the design that a "snubber" was required. I used a 4R7 ohm resistor in series with a .33uf cap and the combination worked well although the classical snubber design method didn't work very well. My final values were determined by experimentation. I hope this helps a litttle.

Doc

you used an N channel mosfet as Q2?

srusha:
you used an N channel mosfet as Q2?

No, P channel - that's why you have Q1 there to invert the signal so it drives it right.

About midway through that design cycle I changed to a P222 N Ch Mosfet

thats what he said...

srusha:

About midway through that design cycle I changed to a P222 N Ch Mosfet

thats what he said...

He was doing low-side switching - we are doing high side.

Low-side = connected to ground = N channel / NPN. High-side = connected to positive = P channel / PNP

Ok, got it, thanks.

I will let you know when I get the transistors how things are getting...

Yes one and the same. The device in the picture drives a proprietary solenoid that is I believe integral to the design. the devices I designed were for bigger valves (3 to 6 inch valves) and my device in those cases was a pilot valve controller rather than the simpler solenoids for smaller valves. About the time that GAL made a serious entry into "Clocks" or irrigation controllers. they changed their name or formed a new division called GALCON. Their original controller was interesting... for the time (Circa 2001 or 2) as it used a 32 Bit Motorola processor... If I remember right. I chose to use a PC for my master controller rather than build all that capacity into my controller. I made my device a dumb controller and had "Scheduling" software designed for the PC. I wrote the prototype software in Microsoft PDS 7.1 Basic and I used the parallel port for my control link. For its time and place I thought the job worked rather well. At that time I did very little programming beyond a simple 8 valve controller (With A PIC16C57, Gawd what a Nasty little Chip, it had "Paged" ram". I might point out that this work started in 1991 and essentially ended in 2005. At that time I changed my work to soil measurement tool design work. EC, Moisture, most of which is still covered by a non disclosure agreement... although the company is dead now for all practical purposes I was never released form the agreement.

Doc

I got the transistors, I got the 222A npn and KSP2907A pnp, I assembled the gates, so I have 2 "gates" , connected to the arduino, but still the arduino cant drive them.

the VDD is external new 9v battery, when I take the Input and connect it to the vdd it drives the relay, but when I connect it to the arduino it wont drive it.

do you have any idea why?

majenko:
Your solenoid is akin to "common cathode" LED arrays.

The ground connection goes to ground (the cathode) and the two positive connections (anodes) get switched on and off.

This is known as "high side switching" and should really be done using PNP transistors, not NPN as you have.

Using PNP you basically end up with the original source schematic, but upside-down. Also, note that the switching is also inverted - writing a "HIGH" will turn off the transistor, and a "LOW" will turn it on.

I usually couple an NPN with each PNP to act as an inverter (in fact, I usually use MOSFETs, not BJTs, but that's just me).