Electronic – arduino – Killing an Arduino and I2C device with a relay

arduinoi2ctransistors

I destroyed* an 5V 16Mhz Arduino Pro Mini and a PCF8574 I2C port extender and I wonder how. Obviously it can be many things (ESD, overvoltage, etc.). But I suspect the problem lies in my driving a 24V relay, so in order to keep this topic narrow, that's going to be my question.

Background: There's a Pro Mini, powered by one of those XL4005 power supply boards you find all over China. Power supply is dialed to 5V. The Pro Mini is connected using I2C to four PCF5874A extender boards. The boards too are powered from the same source.

I hooked it up to a NPN transistor (2N3904) in order to switch a relay (Fujitsu FTR-K1CK024W). The relay coil is 24V, and according to its specs draws 17mA (1440ohm coil).

Schematic

Is there a way this schematic could destroy the PCF and connected I2C device?

*) Pro Mini is unresponsive, boot loader LED not blinking on start. On a fresh Pro Mini, all extender boards, except the one destroyed are being recognised.

Best Answer

You can also put a zener diode between the transistor collector and emitter. Make sure the zener diode breakdown is greater than the input voltage, but less than the breakdown of the transistor.

A good reference for switching inductive loads is "On Switching Inductive Loads with Power Transistors" by R.E. Locher, published by the IEEE in 1970.