Need clarification on I2C port Expansion from Arduino

I connected my Arduino UNO with the PCF-8575 16 BIT I2C IO Expander(NXP). Also given 5V supply to PCF-8575.

I Have Written the below program to enable the Pin-7 as OUTPUT and expecting 5V output at Pin-7. However, I am getting the Pin-7 voltage between 0.25 and 1.25V INSTEAD of 5V.

I have also attached the connection diagram. Also, we are using PCF-8575 library.

Am I missing anything?

#include "PCF8575.h"
#include "Arduino.h"

// Set i2c address
PCF8575 pcf8575(0x20);

void setup() {

  Serial.begin(9600);
  Serial.println("Started");
  pcf8575.pinMode(P7,OUTPUT);

  pcf8575.begin();
}

void loop() {
  pcf8575.digitalWrite(P7,HIGH);
  delay(100);
  pcf8575.digitalWrite(P7,LOW);
  delay(100);
}


You need a common GND between the Arduino and the pcf8575.

@red_car - We tried this approach. Still the same result. (Now pin-7 output measures 0V)

Which PCF8575 library are you using?

How are you measuring that? You are only setting it high for 100 ms at a time. Maybe you should change the delay (to say 5000) so you can actually measure it.

1 Like

Please find the snapshot of the PCF 8575 library that we are using. Even after changing to 5000 delay I am getting the same results.

How are you measuring the voltage?

Did you try increasing the delay?

Well you need a common ground... so keep trying it.

Also - does the PCF8575 have pull-up resistors?

The data sheet is quite cryptic but external pullup resistors seem to be required.

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