Forgive my circuit design i have never used kicad before. This is how i intend to wire the PCF8574 to the relays and the ESP8266. I did not find solenoid symbols in kicad library so i replaced them with 12VDC motors.
Will this wiring be okay or should i change something? The Relays im using are the cheap 8 relay module board from ebay. they also work at 3.3v. I have not measured the current required to operate the relay coil but i understand the PCF8574 is rated for a clamp current of 25mA or 50mA if i use 2 pins at once. I only intend to use 1 pin per output. I will wire the PCF8574 to 3.3v so that ESP8266 and PCF8574 SDA/SCL voltages match.
Is this okay please have a look.
It looks like it may only take 4mA to trigger the coil. the relay module plugs in 5V/GND and requires only 4ma to trigger the coil.
Should i add any resistors to SDA/SCL or flyback diodes on the motor/solenoids. should i use resistors between the PCF8574 and the Optically Isolated relay module inputs?
This is a more complete circuit but i wanted to focus on the PCF8574 first.
Please ignore the double lines going to the bottom left relay coil 5v.