IO expander alternative

i did what you said and the led on the optocoupler side lights up but the output of the mosfet does nothing

oh im sorry seems i knock a wire loose. i did what you said and it works!

I agree with @anon35827816 opinion, but I also agree with your desire to use this board.
So the process of above my post probably works, so why not give it a try?

but why does this work. now the pcf8574 is sinking the current from the optocoupler?

Oops, I seem to be late. :face_with_raised_eyebrow:

1 Like

which one of these specs am i looking for. i was going by clamp current. so i figure it can sink/source 20ma. but apparently im missing something.

pcf8574

VCC Supply voltage range –0.5 7 V
VI
Input voltage range(2) –0.5 VCC + 0.5 V
VO Output voltage range(2) –0.5 VCC + 0.5 V
IIK Input clamp current VI < 0 –20 mA
IOK Output clamp current VO < 0 –20 mA
IOK Input/output clamp current VO < 0 or VO > VCC ±400 μA
IOL Continuous output low current VO = 0 to VCC 50 mA
IOH Continuous output high current VO = 0 to VCC –4 mA
Continuous current through VCC or GND ±100 mA
TJ Junction temperature 150 °C
Tstg Storage temperature range –65 150 °C

The PCF8574 has a high current sink capability.
That's enough to drive the optocoupler.

However, the source current capability is not high.
Therefore, don't expel current to optocoupler from that.

So if high current purpose(about like a not signal), use only sinking current.

Also, please use limit with up to the recommended operating conditions, not the absolute maximum rating.

1 Like

thankyou, just one more question. why does it say

Continuous output high current VO = 0 to VCC –4 mA

why the negative integer?

For example, the current consumed by the IC takes a positive value.
That is the current that is drawn into the IC from the outside.
This is the same pulling current as the sink current, so it takes a positive value.

However, the source current is the current output from the IC.
This is the reverse direction from the above idea.
So it will write negatively.

It's to indicate the direction of the current: out of the device (as opposed to into it).

Why does your application require optical isolation and do you realize that the way it's wired it actually is not isolated at all? (Yes, one more reason why these boards are bulls***).

@koraks u mean not isolated because all of the grounds are connected together? wouldn't it still be isolated if i used a seperate psu for the mosfet supply voltage and didn't connect the grounds?

It should be emphasized that the board itself provides proper insulation, but it is not insulated by the OP wiring method.
Also, using an optoisolator (unreasonably) instead of a small MOSFET as a drive stage to drive a non-logic level FET may not be such a bad idea. :expressionless:

Im switching 12v solenoids at about 1.5 amps about every 20 seconds. i had to move on from relays because the contacts fail after a whileso a mosfet seemed more logical. i was only worried about flyback spikes when de energizing the coil but the green mosfet boards not only includes diodes but also the optocouplers. i dont really care if there are optocouplers or not. i just dont want any CPU crashes etc.

in the testing environment i used a freq generator to switch the mosfet quickly with a load on it without issues, i was also able to switch the load at 50ms on 50ms off intervals for a half hour with the pcf8574 and bypassed optocouplers still had no problem. i don't think you can even really buy all those components for less than they are selling the boards for

It would, but it also wouldn't work anymore the way you've wired it with the workaround you had to do to get the PCF driving the optos.

Yeah, makes sense. You don't need galvanic isolation for this, so no problems there.

Of course you can...this stuff is so cheap you won't believe it. But for me that's not the motivation to forego these boards. It's that they rarely do exactly what I need; they either need additional modifications or they bring unnecessary parts, and they never are the most compact, elegant solution. I'd much rather just draft a circuit and make it into a PCB. But I do understand the attractiveness of buying ready-made modules. I used to do this too until I got tired of it.

This board can provide insulation, so if the power supply operating at 5V is separate from the 12V solenoid power supply, you don't have to connect that GND.
Wire PWMn and GNDn terminal on the optocoupler side by the method I said, and don't connect the GND of the 5V circuit.
Connect the only MOSFET side to the 12V power supply and solenoid.

May I ask you why? I think it can provide isolation.

1 Like

I wonder if it can. You'd have to check the PCB layout carefully; I had a glance at it and it seems that all GNDs simply connect to each other on the bottom layer of the PCB. I might be wrong though. A simply continuity check would give the answer of course.

i think i just lost you,

Wire PWMn and GNDn terminal on the optocoupler side by the method I said, and don't connect the GND of the 5V circuit.

let me see if i have this right, im a little confused about the 5v circuit ground,

i connected 5v from pcf8574 psu to pwm1 and output from pcf8574 to gnd1, then i connect a seperate psu to the mosfet board to power the solenoid without connecting grounds from 5v psu and 12v psu. this should provide isolation? is this what your telling me?

all ground on the board are isolated from each other. the vcc 1-4 are all connected together


I expected a connection like this, but it's quite possible that you're right.
OP should analyze the board well and use it.

Yes it is.
However, as @anon35827816 says, it is useless if there is continuity between GNDn on the optocoupler side of the board and DC- on the MOSFET side.

1 Like

I checked all the grounds and it seems like none of them are connected to each other.