I am using the attached circuit to driver 6 relays with a ULN2003 driven by a PCF8574.
The problem is that, at power on, the relays a left in a random state, most times they momentarily switch ON and then OFF.
The problem of random initial state could be solved with pull-up resistors at the output of the PCF8574. However, in this case, the initial state is always ON (till software switches output to OFF) while the requirement is for the initial state to be OFF.
On the other hand using pull-down resistors at the output of PCF8574 instead, is not an option since the PCF8574 would then be unable to drive the outputs high due its the low driving current capabilities.
Replacing the ULN2003 with an PNP darligton array equivalent would be a solution, (they stay OFF till the base is driven low). Is there a PNP equivalent of ULN2003?
Other solution could be a use of an inverters before ULN or to use changeover instead of switching relays, both of course with the pull-up resistors on PCF8574.
Very nice! So how far can you go with i2c? Shielded cables i would imagine?
The enclosure looks very cleanly cut where the rj45 socket is and the lcd screen. Always difficult job to get right!
I don't need long cables so i can't tell you about far i2c.
The rj45 hole was a great job.
My dremel is my best friend.
I made a big drilling template, to make a smaller drilling template, fixed on the enclosure with a kind of wooden scaffolding, to make this rj45 hole at the end.
And same thing for the USB hole below.
I was so proud of myself... until my wife said "All this work for THAT ??"
I need to have only one current sensor, for the relay dedicated to heating system.
Firstly i used a couple PCF8574 (relays) + PCF8591 (ACS712) over I2C.
Since i got in trouble with PCF8574 and relays, i replaced all this by a slave I2C arduino pro mini.
It is more accurate for driving the ACS712 over I2C.
8 bits ADC PCF8591 => 10 bits ADC arduino
Also, sensing 220V AC 50 Hz current needs multiple access to ACS712, to get min/max values.
The arduino pro mini handle this.
The main arduino sends an order ("start read ACS712") and asks for value one second later.
An arduino pro mini could handle up to 4 ACS712 with analog inputs (4 = 6 - SCL & SDA).
how do you use the acs712? do you attach it to the AC line?
I could incorporate this into my project.
I did a search, I if I understand it correctly, you wire the acs712 in series with the load?
so if I wire it in series with the relay, once relay switched is closed, it can start measuring the load current right? For AC measurement, does it give you RMS value?