Need help! Interfaceing PCF8574 with transistor to switch solenoid

Thread Starter

mvschaefer

Joined Jul 30, 2013
6
Hello,

I am new here in this forum and I hope someone is able to help me with my problem. I used the search function but I couldn't really find something that I understood :)


I am trying to interface a PCF8574 port extender with the base (1kOhm resistor in between output pin of PCF8574 and base pin of transistor) of a transistor which then is supposed to switch a 24 VDC solenoid valve.

Controlling the I2C port extender is no problem, but for some reason the transistor does not switch the solenoid valve on/off if the appropriate pin is triggered high/low on the port extender.

I read some stuff in various forums about the maximum HIGH output current of the PCF8574 (maximum 300 uA) is not enough but I can not judge if that is really my problem here. Also, I read that the PCF8574 is not good for current sourcing and should rather be used for current draining.

Does anyone know why it does not work, meaning why the solenoid does not switch when the port extender pins logic levels get changed ???

Any help is greatly appreciated.

mvschaefer
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
Probably better off using a FET 2n7000, this was designed for TTL/CMOS with up to 60vdc interfacing for solenoids and the like.
I always keep a stock in hand and found them indispensable over the years.
Max.
 

wayneh

Joined Sep 9, 2010
17,498
I read some stuff in various forums about the maximum HIGH output current of the PCF8574 (maximum 300 uA) is not enough but I can not judge if that is really my problem here.
It is. As noted, use a MOSFET. A rule of thumb for a regular transistor or BJT is that you need 10% of the load current on the base in order to get full switching. I don't know about your solenoid but I'll bet it needs more than 10 x 300µA. A MOSFET does not need a base current but it does require adequate voltage on its gate pin to be fully "on".
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
That is the advantage of the 2N7000 it only requires 3.5v as it was designed for TTL interface.
No other resistors required, it is equivalent to a bi-polar darlington.
Max.
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
I just noticed you are switching a solenoid and these invariably draw around 1.25 amps, so it would be out of the range of the 2n7000, In this case I have used the IRL520, still 5v logic input.
Max.
 

SgtWookie

Joined Jul 17, 2007
22,230
Simply using a MOSFET on the output won't work, as the port expander basically has open-drain outputs; note that the specification gives Vss for the source of the current.

One could use a PNP-NPN pair to supply the current. You don't mention what the current requirements are for the solenoid, which needs to be known for an optimal design to be developed. Also, you didn't mention what Vcc/Vdd you're using. Is it 5v? 3.3v? Something else?
 

Thread Starter

mvschaefer

Joined Jul 30, 2013
6
First of all thanks all for your replies.

To complete the missing information:

- I run the PCF8574 on 5V which comes from an external power supply that is capable of supplying 5V/12A to that line.

- The PCF8574 is then interfaced back with an ATMEGA328P which is the core of our own custom "arduino" microcontroller (controlling of the PCF8574 is as before mentioned not an issue).

- The transistor I use is a B44H11G NPN power transistor that can handle up to 10 A. Collector-Emitter are connected to external power supply line of 24 VDC that can supply 2A.

- The solenoid valve I use is a 2V035 three way direct acting solenoid valve from STCvalve and consumes 3W and runs on 24 VDC (so do I get this right that it needs 125 mA to get energized ?).

// EDIT //
Just looked at the slenoid again and saw that it consumes 6.5 W not 3 W which would bump up the current to around 270 mA.
// EDIT //


I hope I did not forget any information this time.

However, due to the fact that my setup is already on a PCB (yes you can call me naive to make a PCB without having tested the functionality of this part of my board).

I am looking for a solution that I can easily implement on my board. As for the transistors, I am using a D2-PAK. If I could maybe replace it with a D2-PAK MOSFET that has the same pin configuration as my NPN transistor then I could get it working without too much hassle ??
If my thought process makes sense I would be thankful if someone could point me to such a MOSFET.

Any suggestions and help is again much appreciated.


mvschaefer
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
The solenoid power rating appears to depend upon your working pressure:
3.0W for 60 PSI
4.8W for 115 PSI
6.5W for 150 PSI
So, what is your working pressure?

What is the resistance of a single solenoid?

You might use a MOSFET like this one:
http://www.digikey.com/product-detail/en/IRLR024TRPBF/IRLR024PBFCT-ND/827874
http://www.digikey.com/product-detail/en/NTD5867NLT4G/NTD5867NLT4GOSCT-ND/2409631
However, you will need to use a pull-up resistor to 5v in order to source current to the gate, as the port expander really can't do it. A 1k resistor means a 5mA static load per channel. Unless you will be trying to turn the solenoid on and off very rapidly, a simple gate pull-up resistor will probably work OK.

Make sure you have a reverse-biased diode & resistor in series wired in parallel to the solenoid, or the current might blast the MOSFETs right off the board when you turn them off. The resistor should be somewhere near the same value as the solenoid itself.
 
Last edited:

Thread Starter

mvschaefer

Joined Jul 30, 2013
6
Thanks for your replies.

- The working pressure on my solenoid valve is fluctuating from 70 - 130 PSI (due to many devices using the same line, but changing that is not really possible, so I have to live with it).

- I measured the solenoid resistance to around 100 Ohm.

- I have equipped each solenoid with reversed bias diodes to counter the induced current when the solenoid gets shutt off. (I should mention that on another part of the board, two additional transistors get switched with a DAC6573 (were the only pins I had left over in my setup, so I used them). This switching works fine because I guess the DAC can suply enough current to the transistor base).

- I looked into the MOSFETS you linked before and only one had max. power ratings of 36 W, the other ones 2.5 - 3 W. Do I see that right, that if the solenoid consumes up to 6.5 W in the worst case, that I cannot use the low power rated MOSFET's ?

- Further I called Texas Instruments technical support and they pointed me to a PCA9534A port extender: http://www.ti.com/lit/ds/symlink/pca9534a.pdf . It has a clamp I/O of ± 20 mA.

Shouldn't that solve all my problems ?

If I use that port extender (which btw has the same pin layout as the PCF8574 which means I can just swap it into my PCB) to get 20 mA max. current onto the base of my transistors, then with a gain of 60 (if I am not mistaken) that should be plenty to reach my goal of 270 mA to trigger the solenoid with the worst pressure settings.


- Finally, because you asked SgtWookie, I wanted to mention that I need my setup for fast switching (ALD valves) with injection times of as low as 30 ms (if that can be considered fast in the electronics world :) ).


However, I would be glad if you could give me your opinion on either using the PCA9534A as a replacement or the power MOSFET with the 36 W max. power rating that you posted before (btw can I just plug in the MOSFET or do I need to think about a different pin layout ?)

Thanks to anyone again for all your help.

mvschaefer
 

BobTPH

Joined Jun 5, 2013
8,998
The power rating of a MOSET is not the power of the load, it is the power dissipated in the MOSFET. In switching a 6W solenoid, the MOSFET will be dissipating only a fraction of a Watt. The formula for dissipated power is:

I ** 2 * Rdson

Bob
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
The current will be the same regardless of pressure at 100Ω that would be 240ma or 6w.
The ones I showed in the DigiKey link are a bit overkill but at $2.00 ea the cost should not be a factor.!
Max.
 

SgtWookie

Joined Jul 17, 2007
22,230
- The working pressure on my solenoid valve is fluctuating from 70 - 130 PSI (due to many devices using the same line, but changing that is not really possible, so I have to live with it).

- I measured the solenoid resistance to around 100 Ohm.
OK, so 24v/100 Ohms = 240mA, and 5.76 Watts of power will be dissipated in the coil.

The IRLR024TRPBF in my 1st link has an Rds(on) of 100m Ohms, or 0.1 Ohm. With 240mA flowing through it, the power dissipation will be 5.76mW; basically negligible.

- I have equipped each solenoid with reversed bias diodes to counter the induced current when the solenoid gets shut off.
If you want the solenoids to disengage more quickly, you'll need to use resistors in series with the reverse bias diodes. Try it as it is, and then try adding 100 Ohms in series with the diode. I suggest you don't go above 150 Ohms unless you change to a MOSFET with a Vdss rating higher than 60v.

(I should mention that on another part of the board, two additional transistors get switched with a DAC6573 (were the only pins I had left over in my setup, so I used them). This switching works fine because I guess the DAC can supply enough current to the transistor base).
You don't show the schematic for that part, so we have no idea what you're talking about.

- I looked into the MOSFETS you linked before and only one had max. power ratings of 36 W, the other ones 2.5 - 3 W. Do I see that right, that if the solenoid consumes up to 6.5 W in the worst case, that I cannot use the low power rated MOSFET's ?
As shown above, you need to calculate the power dissipation by drain current times Rds(on). In this case, the power dissipation is trivial.

- Further I called Texas Instruments technical support and they pointed me to a PCA9534A port extender: http://www.ti.com/lit/ds/symlink/pca9534a.pdf . It has a clamp I/O of ± 20 mA.

Shouldn't that solve all my problems ?
It looks like it will certainly help the situation. Since your coil current will be 240mA, you really need about 24mA of base current to saturate the existing transistor(s). However, that's a bit much for the driver, so try using 200 to 220 Ohm resistors, 1/4W rating. If your transistors get hot, you need to change over to MOSFETs.

If I use that port extender (which btw has the same pin layout as the PCF8574 which means I can just swap it into my PCB) to get 20 mA max. current onto the base of my transistors, then with a gain of 60 (if I am not mistaken) that should be plenty to reach my goal of 270 mA to trigger the solenoid with the worst pressure settings.
You need to change the base resistors, too.

- Finally, because you asked SgtWookie, I wanted to mention that I need my setup for fast switching (ALD valves) with injection times of as low as 30 ms (if that can be considered fast in the electronics world :) ).
That's going to be mighty fast for both energizing and de-energizing the solenoid. If you aren't getting the times you need with 24v (I suspect you won't) then you will need to increase your 24v supply voltage very significantly, use chopper drivers for the coils, and use snubbers to de-energize them more quickly.


However, I would be glad if you could give me your opinion on either using the PCA9534A as a replacement or the power MOSFET with the 36 W max. power rating that you posted before (btw can I just plug in the MOSFET or do I need to think about a different pin layout ?)
I would replace both the port expander and the transistor to a MOSFET, replacing the base resistor with one around 22 Ohms to help avoid ringing on the gate. To double-check the pinouts, make certain that:
1) The collector is the same pin as the drain.
2) The base is the same pin as the gate.
3) The emitter is the same pin as the source.
4) The tabs are connected to the same pin on both devices.
Read & compare both datasheets to make certain.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
28,698
Incidentally I notice the 2v035 comes in DIN connect or Grommet, the DIN version has inbuilt LED and is polarity conscious.
It could also have the necessary suppression? Unfortunately no details are shown.
Many of the DC valves I have fitted of late, have on-board electronics LED etc, and are not polarity conscious due to a bridge input.
Max.
 
Top