Hello everyone! This is my first time on the forum.
I've been trying to use an I2C port expander module for days, but without success.
I'm using PCF8575 to increase the number of digital output pins, but I can't get the module pins to switch between high and low (0 - 5V). The pins always stay high. Below is the small code I wrote.
I've tried various things in the code, including using only the Wire library, but I haven't been successful. I soldered the VCC and VDD pads to bypass the voltage regulator and obtain 5V on the output pins. When I use a multimeter to measure the voltage of the module pin, it always reads 5V.
All the tutorials I've seen show that I did everything correctly, but I'm not getting any success. I bought a new module thinking it might be a defect in the module, but that wasn't the case.
At first, I hesitated to perform an I2C address scan because the default address of this module should be 0x20. However, when I tested it, I discovered that every time I restart the Arduino, the module responds at a different address. This doesn't make sense! I decided to solder all three address pins to VCC to set it as 0x27, and now it works fine. I can't understand the logic behind why the module responds at random addresses each time it restarts.
Looking at your picture you have it wired wrong. I use similar items without any problems. Try posting a simple schematic rather then your pictures and show all connections and power supplies. Also post links to the hardware devices that give technical information. You have a hardware problem, run the I2C scanner and when you get the correct port to show it should work.
I think you read something wrong, the base address is probably 20, but the three address bits need to be set to either 0 or 1, with them not connected, you got random addresses. Some modules have built-in pullups or pulldowns, yours clearly did not. It might be obvious, or not, if you provided a link to the item you actually own.