I'm having trouble diagnosing a faulty circuit. Here's the schematic, which is based on this instructables build. This is part of a bigger circuit, but I have tested it in isolation on a fresh board.

enter image description here

Link to the Eagle file (This is part of a bigger board, but hopefully this helps)

The purpose of the circuit is to drive 16 relays using I2C communication. I'm currently testing with an Arduino Mega. I'm using the MCP23017 for the 16 I/O pins, and two ULN2803ADWR darling transistor arrays to sink 5v on each G5Q-14 DC5 relay coil.

The circuit seems to be correct – I've gotten it to run a few times and the Arduino can successfully switch the relay. After less than a minute or so, pins 9 and 10 on the MCP (+5v and GND) start sparking and smoking. I've tested this on two PCBs meticulously testing for shorts between pins before turning it on - same issue. I also only encounter this issue once introducing the relay to the circuit.

I also find that pins 9 and 10 become connected after the sparking occurs. Not until I apply the soldering iron do they go back to being disconnected. Is it common that very close pins will bond when things get that hot?

I have no idea what's causing this short. Does it seem like a physical error or a circuit design error?

Note that:

  • In my circuit, the MCP is floating on A0 A1 A2 (address pins). Does this matter?
  • On my PCB, the MCP pin 9 (+5v) is connected after the relay coils (the trace goes from the +5v source, through each coil, then to the MCP). Could that be causing an issue?
  • 4
    \$\begingroup\$ I notice you don't seem to have flyback diodes antiparallel with any relay coils. If you power up your board but make the software not switch relays, does it still fry? Any inductance (like a relay coil) produces a voltage spike whenever current in it is interrupted. Inductors want to keep current flowing through them the same so they produce a voltage to oppose the current if it's increasing which gets stored in the magnet field. When the current decreases, the inductor dumps the energy in the magnetic field to push the current through the obstacle. If it's a big obstacle (like an open relay) \$\endgroup\$ – DKNguyen Feb 27 '19 at 21:11
  • 1
    \$\begingroup\$ [cont...] then the inductor produces whatever voltage is required to shove the current through that until the energy in its magnetic field is exhausted. That spike can is appears on the 5V you are using to power the relay coil, which also happens to be what is powering your MCU. Chances are it's frying your MCU and semiconductors tend to fail short-circuit rather than open circuit which would cause the overheating and frying. The spike is probably damaging the ULN2803s as well but it's not as evident since they can tolerate up to 50V. \$\endgroup\$ – DKNguyen Feb 27 '19 at 21:15
  • \$\begingroup\$ Actually, it seems that the ULN2803s include such diodes within them. I'm not sure I trust those however. If you have a scope you can scope the line to check if the spike on the 5V rail is being suppressed enough. \$\endgroup\$ – DKNguyen Feb 27 '19 at 21:27
  • \$\begingroup\$ are you saying that an electric arc occurs between pin 9 and 10 of the MCP23017? \$\endgroup\$ – jsotola Feb 27 '19 at 21:27
  • \$\begingroup\$ @Toor Your explanation seems plausible to me. Regarding built in diodes: they do the job as long they have connection, so if you don't remove or plug the relay when it is energized. \$\endgroup\$ – Marko Buršič Feb 27 '19 at 22:12

Seems like there are probably multiple issues on your board. I can't speak to the sparking you're seeing, but the MCP23017 does require the address pins to be biased, according to page 11 of the datasheet:

enter image description here

I'm not sure if you're trying to use a specific address or not, but your software will need to reference whichever address is selected via these address pins. If you don't care what the address is, I'd just ground all three pins to use address '0100000':

enter image description here

  • \$\begingroup\$ Thanks Chris, I'll definitely make that change. I'm not sure if that is my issue, as the MCP's address has been steady (when I've tested it with no relay). It could be causing issues though, I'll report back. \$\endgroup\$ – dmayman Feb 27 '19 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.