Logic 1 reads 4V ?

Consider this diagram :

When the PCF8574 outputs 1s, the voltage at its output reads 4V which then leads to about 0.9-1V at the output of the inverter (74HC04). This doesn't affect the operation of the darligton driver and the relays which operate as expected.

I only noticed this when connected some LEDs on OUT0-OUT5. The leds dimly lit even when the relays are off (logic 0 at the output of the hex inverter).

I know this is pretty basic but I am puzzled why this is happening!

Post withdrawn.

When this happens, what does your Vcc read.

The pins on the PCF8574 can only source 100 µA.

// Per.

When this happens, what does your Vcc read.

Vcc is always 4.978V supplied from a 7805 regulator or from USB.

The pins on the PCF8574 can only source 100 µA.

Correct. Thats why there are pullup resistors in the circuit. (10K)

OUT0 on the inverter or the ULN2803?

Check to see if there's a voltage difference between the ULN2803's ground and other ground points.

Have you got decoupling capacitors close to your supply pins of ic's?

And are your ic's etc grounds all connected to the same 'gnd'?

Also... if the pcf8574 is configured for 'outputs'..... then external pullup resistors aren't required, right?

P6 and P7 on the PCF8574T are net named as +LED1 and +LED2. The circuit for these LEDs isn't shown, but it implies that you're trying to source LED current when you should be sinking LED current instead. Also, the LED current limiting resistors (not shown) would need to limit the current to within 10mA.

The required pullup resistors for SDA, SCL and INT are not shown. What is their value?

The PCF8574T has quasi-bidirectional I/Os. Being non totem pole type, the outputs don't yield solid voltage levels.

When the PCF8574 outputs 1s, the voltage at its output reads 4V

Perhaps your 10K pullups could be a bit stronger (i.e. 3.3K - 4.7K).

What is the purpose of the 74HC04 inverter ?

Typically your indicator leds would be on the ULN2803As outputs...

yep..... dlloyd is right. P6 and P7 pins, when configured for 'output' (and for the purpose of driving LEDs), will require resistors in series with the LEDs, and the LEDs will light up when P6 and P7 are commanded to go 'low' (which means sinking current). The pcf8574 will struggle to source current to the LEDs.

So, in this particular situation, the way to 'drive' the LEDs is to sink current when you want the LED to light up. This means, the positive terminal of the LED will be connected to Vcc, and the remaining LED terminal connected to a resistor, and the other end of the resistor will be connected to the output pin of the pcf8574.

Starting to think that this push-pull I/O expander would have been a better fit, possibly no need for 74HC04.

Thanks for all the responses!

Check to see if there's a voltage difference between the ULN2803's ground and other ground points.

No difference. All is soldered on a PCB with solid ground.

Have you got decoupling capacitors close to your supply pins of ic's?

And are your ic's etc grounds all connected to the same 'gnd'?

Also... if the pcf8574 is configured for 'outputs'..... then external pullup resistors aren't required, right?

Yes I have decoupling caps. Eventhough the problem appears under steady state conditions and caps would affect it much.

Yes all grounds are connected together.

Pullup resistors are there since the PCF has a very low current source capability.

P6 and P7 on the PCF8574T are net named as +LED1 and +LED2. The circuit for these LEDs isn't shown, but it implies that you're trying to source LED current when you should be sinking LED current instead. Also, the LED current limiting resistors (not shown) would need to limit the current to within 10mA.

There are current limiting resistors for these leds eventhough they are not show here.

The required pullup resistors for SDA, SCL and INT are not shown. What is their value?

4.7k

Typically your indicator leds would be on the ULN2803As outputs...

Not necessarily. Since according to datasheet the PCF can drive leds directly.

Perhaps your 10K pullups could be a bit stronger (i.e. 3.3K - 4.7K).

Now this does make sense! I had the same thought as well. In other words, since the PCF only has a very low current source capability (100uA), it is up to the external resistor to source the necessary current to 'establish' a proper logic 0 and 10K might be too high. I intend to try 4.7K but since these are SMD 1206 array resistors , I have ordered another set at 4.7k to try out.

And I'd recommend using 74HC14's because schmitt-triggers are so useful to have in stock, why get inverters
that aren't schmitt-triggers? (Well perhaps because they might be a little faster I suppose).

ricky101:
What is the purpose of the 74HC04 inverter ?

Typically your indicator leds would be on the ULN2803As outputs...

The PCF8574 cannot source anything like enough current to drive the 2803, the inverter can.

What is the purpose of the 74HC04 inverter ?

This is necessary in order to make sure all relays are de-energised (off) at power on in addition to current source capability.

Starting to think that this push-pull I/O expander would have been a better fit, possibly no need for 74HC04.

Interesting.. I am not familiar with this one. What is the advantage in this case?

And I'd recommend using 74HC14's because schmitt-triggers are so useful to have in stock, why get inverters
that aren't schmitt-triggers? (Well perhaps because they might be a little faster I suppose).

I agree Mark. Speed is not an issue here but there should be a need for a schmit trigger since the output should have been within the logic specs.

Hmm ... I was thinking the inverter was there to prevent all relays being energized during startup since by default the expander will initialize all I/Os to inputs with a weak pullup current to Vcc.

That as well... See my my other post