PCF 8574

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
brabo
New user
Posts: 6
Joined: 18 Jun 2022, 14:03

PCF 8574

#1 Post by brabo » 18 Jun 2022, 14:20

Hi guys,

I have same troublesh with ESPEASY and PCF 8574.

It all look good but when i send command PCFGPIO,1,0 its ok and pin in LOW and output relay is on, but when i send other command PCFGPIO,2,0 output pin 2 set to LOW but pin 1 set to HIGH. why? every when i change state of other pin privious pin change back to HIGH. I want to control every pin separately it is posibble? what i must set?

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: PCF 8574

#2 Post by Ath » 19 Jun 2022, 20:35

Can you give some more details about your setup?
- What version of ESPEasy are you using? (most helpful is the name of the .bin file you flashed)
- What kind of ESP is used (ESP8266/ESP32/ESP32s2)?
- How is the I2C wiring set up, length of wires, pull-up resistors in place, value?
- What does the Tools/I2C scan list?
- Are other (I2C and other) devices connected to the ESP?
/Ton (PayPal.me)

brabo
New user
Posts: 6
Joined: 18 Jun 2022, 14:03

Re: PCF 8574

#3 Post by brabo » 20 Jun 2022, 19:03

Thank you for your answear

ESP_Easy_mega_20220427_display_ESP8266_4M1M
ESP 8266 Wemos D1 development board
Dupont Wire lenght 15 cm, Not place pullup, what ressistor valua to use?
I2C tools print Adress: 0x20 Support device: Switch input - PCF8574
Not any other I2c device use only PCF8574

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: PCF 8574

#4 Post by Ath » 20 Jun 2022, 21:52

If you use a breakout board with the PCF8574, it will usually have pull-up resistors installed, you can measure that using a multimeter, if you disconnect the board and measure the resistance between VCC and SCL or SDA. The value should be somewhere around 4.7 to 10 kOhm, if it is much higher (> 150 kOhm) then probably it doesn't have pull-ups, and you can apply a pull-up of 4.7 to 10 kOhm (what's available) on both the SCL and SDA connections.
I2C-pull-up.png
I2C-pull-up.png (28.63 KiB) Viewed 3737 times
/Ton (PayPal.me)

brabo
New user
Posts: 6
Joined: 18 Jun 2022, 14:03

Re: PCF 8574

#5 Post by brabo » 20 Jun 2022, 21:59

Now i test situation, when i reboot and change state of gpio 1 to LOW, it´s ok. Then i change it back and is ok. I change it back to LOW and When i change gpio 2 to LOW. First gpio is change back to High and now i can´t change to any state this pin, console returning FAILED. All other pins (2-8) i can changing and works propertily.

I was try change I2C adress of PCF8574 to 0x24 and put pullup 4K7 ressitors, but still have same problem. Do you have any idea?

brabo
New user
Posts: 6
Joined: 18 Jun 2022, 14:03

Re: PCF 8574

#6 Post by brabo » 21 Jun 2022, 21:25

I can't sleep tomorrow and trying solved problem. I found where is problem i was have enable plugin for nextion display but not connected and this making problem when I disable this plugin PCF working good all command work great a pin stay in our status. Today a try enable and connect display because I need it in my setup. Do you have any ideas why by problem when enable nextion plugin?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: PCF 8574

#7 Post by TD-er » 21 Jun 2022, 21:37

So you had the Nextion plugin enabled, but no display connected?
What pins were assigned to be used by the Nextion task?
Is it possible those could cause a conflict with the I2C pins?

Also what serial port is defined in the Nextion task? If it is SoftwareSerial, then this may take too much CPU cycles or the ESP is waiting too long for data that will never arrive and thus block execution of other code to be executed.

brabo
New user
Posts: 6
Joined: 18 Jun 2022, 14:03

Re: PCF 8574

#8 Post by brabo » 21 Jun 2022, 22:03

Yes a for first testing nextion display. Next step it was be test PCF for expanding i/o pin. When I testing PCF and I had same trouble, i was disconnected display but not disable in device.

For nextion task is set hardware serial on pin D7 and D8.
For PCF task is set I2C on D1 and D2
I think is right or not?

Yes i thinking about same as you, but I use all hw cummunication pin

brabo
New user
Posts: 6
Joined: 18 Jun 2022, 14:03

Re: PCF 8574

#9 Post by brabo » 21 Jun 2022, 22:41

Great news i found the problem.

It´s all about i had enable Nextion Plugin in device tab, but not connected wires betwen ESP and Display. And when i was trying control by commands PCF it´s not work correctly. When I disable Nextion plugin all work good. Today i connect display with plugin enable together with connected PCF and now is ALL WORK PERFECT!

Sorry, for wasting your time by my newbies troubles, but thank you with helping to solution.

Maybe this topic help to somebody else, after finish my setup i placed here. FYI: I try makes smart greenhouse irrigation

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests