PCF8574 Low output voltage

Hello,

I am using a PCF8574 IO Expansion Board I/O Expander I2C-Bus Evaluation Development Module with the Arduino and I am able to trigger HIGH and LOW in LED light. the observation is that the LED light is very low. using multimeter:

  • input voltage 5v output of P0 pin is 0.23v
  • input voltage 3.3v output of P0 pin is 0.17v

what is the reason behind that?
my application I would like to trigger a 5v relay using this extender.

In what circuit do you measure? Do you measure HIGH or LOW?

It has "pseudobidirectional" pins - it has only two states, using Arduino terminology OUTPUT HIGH and INPUT_PULLUP. It cannot source much current, only sink.

It is tge pcf8574 module

We already know this. How is it connected? What code is used? What do you measure? Do you have photos of your setup?

Thank you Smajdalf for your reply.

connections Arduino and the PCF8574

  • Arduino 5v to PCF8574 VCC ( did the same with 3.3v)
  • Arduino GND to PCF8574 VCC
  • Arduino A4 to PCF8574 SDA
  • Arduino A5 to PCF8574 SCL

Connections PCF8574 with LED light

  • PCF8574 P0 Pin to 330 ohms -> LED long foot.
  • LED short foot to GND

the code

#include "Arduino.h"
#include "PCF8574.h"

// Set i2c address
PCF8574 pcf8574(0x38); // address defined as per the I2C scanner

void setup()
{
	Serial.begin(9600);
	delay(1000);

	// Set pinMode to OUTPUT
	pcf8574.pinMode(P0, OUTPUT);

	Serial.print("Init pcf8574...");
	if (pcf8574.begin()){
		Serial.println("OK");
	}else{
		Serial.println("KO");
	}
}

void loop()
{
	pcf8574.digitalWrite(P0, HIGH);
	delay(1000);
	pcf8574.digitalWrite(P0, LOW);
	delay(1000);
}

measurments

  • the PCF8574 VCC to PCF8574 GND = 5v
  • P0 PCF8574 to PCF8574 GND = 0.23 ( when having the voltage of 3.3v, the pin output voltage is 0.17v

I hope that is clear

See post #2

Solution;
Wire led plus resistor from Vcc to pin of the 8674. Note that the logic will be reversed so LIW will switch the LED on.

That is strange. When P0 is HIGH the measured value is too low. For P0 LOW it is too high. Did you try it without the LED, with nothing connected to P0? What about other pins?

Not clear, I think. Your words have confused @Smajdalf.

I think what you meant to say was that

  1. when Vcc is 5V and the P0 output is set to 1 or HIGH, and the led+330R is connected, the voltage on P0 is 0.23V.
  2. when Vcc is 3.3V and the P0 output is set to 1 or HIGH, and the led+330R is connected, the voltage on P0 is 0.17V.

You have not attempted to measure the voltage on P0 when it is set to 0 or LOW.

These readings are as expected, as already mentioned. The pcf chip is not faulty. Driving LEDs brightly requires more current than a pcf pin can source. However, it can sink more current than it can source, so if you connect the led+330R between Vcc and P0 it should be brighter (but will be off when P0 is HIGH and on when it is LOW.

A relay module may require less current to trigger it than a led requires because it may have a transistor on-board. However, some relay modules have an opto-isolator, which will require more current, like a led (an opto-isolator contains a led). If you can wire the relay module so that sinking current from the opto-isolator triggers the relay, that will be fine.

No they are not. PCF8574 should source 100 uA. I don't recall if type of LED was mentioned but even a red LED of reasonable size and quality should have about 1.5 V forward drop at 100 uA (as well as some light output).

@PaulRB,

thank you for passing by and for your input. Please be patient with a noobie :slight_smile:

if you see the code, in the loop section, am LED light will be on and off every 1 second. I am aware that PCF is doing the opposite.

@Smajdalf,

I have tried to remove the loads (LED+330R) and measure the voltage directly from the pin. the result is 5v. however, when I connect the load again drops and the LED as low light. to test the LED, I connect it +ve side of the LED to the 5v and it works fine


This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.