I have a bunch of these boards, and worked successfully with them in the past. However, I've noticed that a high percentage of them seem to be not working properly, and I'm wondering what may go wrong with them and if they are fixable.
Out of about maybe 15 of these boards I've bought in my life, I think 5 or 6 have gone bad. I have 4 of them now, and one of them works as expected with the following sketch:
#include "Wire.h"
#define address 0x21
void setup() {
Serial.begin(9600);
Wire.begin();
Wire.beginTransmission(address);
Wire.write(0xFF);
Wire.write(0xFF);
Wire.endTransmission();
}
void loop() {
byte read_value;
if (Wire.requestFrom(address, 2) == 2) {
read_value = (Wire.read());
for (int i = 0; i < 8; i++) {
Serial.print(bitRead(read_value, i));
}
Serial.print("\t");
read_value = (Wire.read());
for (int i = 0; i < 8; i++) {
Serial.print(bitRead(read_value, i));
}
Serial.println();
delay(500);
}
}
16 Buttons are connected to the P0 to P17 pins on one leg, and GND on the other. When none is pressed, serial monitor reads 11111111 11111111 as expected, and whenever any one of the buttons is pressed, a 0 is read (for instance 11101111 11111111), so it works as it should.
Using the same microcontroller, if I plug in any of the other three boards, they all go immediately to low status, so serial reads 00000000 00000000 and nothing happens with the buttons (obviously), so I'm pretty sure these boards are faulty.
Can anyone with experience on these boards let me know if you've had similar experience? If feels like too high of a faulty rate.
Using this library, the boards seems to work, but it pulls the pins up, which I've heard is not the best thing to do with these, and pins would be best pulled down.
Nobody? I just got 5 more boards, out of which I've tested 3 and they have the same behaviour. They seem to get pulled up at setup, but something is immediately pulling them back down.
I tried again with the only working one I have now available and it's still working as expected.
Hi rob.
They are brand new boards, right out of the static protection bag, so I would disregard dust. Also tried minimum soldering, essentially just the 4 required pins to connect to the arduino, though it's just pin headers, I'm already well over that soldering level.
Yes, the scanner finds them no problem.
Since I need to move on with my project, and I don't trust PCF8575 boards anymore, I'm going to be using an arduino nano that I have laying around. I know it's not ideal, but I think it'll do the trick.
For a longer term solution, I'll see if I can achieve the same results with an MCP23017 instead.
I don't see any pull up resistors in the SCL or SDA pins for this one in any of the tutorials I've seen. Are they also required for this IC?
As an author of a PCF8575 library I have never seen a similar report.
Therefor I assume it is not the PCF8575 which is the problem.
It might be a faulty batch or even fake however then I would expect them all to fail.
They are brand new boards, right out of the static protection bag, so I would disregard dust. Also tried minimum soldering, essentially just the 4 required pins to connect to the arduino, though it's just pin headers, I'm already well over that soldering level.
I did not mean to question your soldering skills, I have seen products delivered with bad soldering right from the factory. They could have shipped crap soldering, inspection with a microscope might show bad soldering, missed soldering or errors in the PCB.
Thank you Rob. I'm also considering designing a custom pcb and re-use the actual PCF chip on those, if they are not actually fried and it's just a bad PCB design. Not sure how easy it is to fry them.
Yes pull up resistors are required, without them results are mixed at best. This requirement is part of the published specification and assumed by many. Some boards use them typically 10K others do not. You may have to solder jumpers to enable them.
From your first post, it felt like you have worked with the chip themselves, instead of the breakboards I'm working with. Would you be so kind as to suggest a working schematic for these chips? I've been checking my board, and it does some weird things that I, as a non electrical engineer or anything like that, didn't understand.
For instance, the resistors that I highlighted in a previous post, the bottom one is connected one end to SCL, and the other end to the resistor above. That resistor is then connected to a 7002 transistor, so SCL is connected via a 20k (10+10) resistor to that transistor, and SDI is connected to that same transistor directly, so SDA is connected to that transistor without resistance, and to SCL with 20k resistor. I'm sure whoever designed it that way had reasons to do it, but maybe it doesn't need to be that complicated. I can keep following traces with the microscope and the voltimeter, if you want. I quit following traces at that transistor.
Would you be willing to share a basic schematic that you know by your experience it works? nowadays it's not hard or expensive to design and print a PCB, and I'm confident with SMD soldering, I may consider using the chips if they are not fried and just create my own PCB. I don't want to throw away 8 good chips if I don't have to.
I think I'm giving up on PCF8575s. So much bad experience with them.
I'm 99% sure I'm not doing something wrong, as I'm getting different results with exactly the same code.
I've even desined my own PCBs (copied from the Adafruit's breakboard schematic) and ordered SOC chips and still the same result. According to the datasheet, pins should be high by default at startup (so I wouldn't even need to write the bytes in the setup), but that's not the case in all of the boards and chips I've bought since.
The weird thing is that the library works, when pulling pins up, so I may still be able to use them for some other projects, though I don't trust them very much, and not matrix projects, but individual inputs. Not sure if pulling several pins at the same time (meaning pushing several buttons at the same time) will work, but I guess I'll find out.
In the meantime, I will move to MCP23017, see if I have better luck with those.