3 wire solenoid

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).

You do have the external and arduino grounds connected, don't you?

majenko:
You do have the external and arduino grounds connected, don't you?

I feel so stupid right now :slight_smile:

works perfectly..

how much time do you think a circuit like that could hold on a 9v battery?
If i'd use mos instead of npn it should not waste energy when its not used right?

Either BJT or FET will have some leakage current, so neither will last for ever.

It will last for quite some time when not actively driving the coils though.

I guess its more like weeks/months than years right?