I’m working on a design using a pcf8574 chip. This is an I2C expansion part that gives me 8 I/O pins. I need to drive a 5V relay from one of the pins, but since the pins won’t sink/source enough current, I’m planning on using a PNP transistor to drive the relay. The IC will have to run at 5V in order to get the voltage high enough to cut off the PNP transistor. If I understand the Arduino hardware, the I2C lines will be at a max of 3.3 V.
I’m concerned it will not work correctly and may damage the CPU. If necessary I can put an optoisolator in the circuit to drive the transistor, I think.