Electronic – arduino – Damaging a linear regulator applying a voltage to the output

arduinointegrated-circuitlinear-regulator

As a simple project, I was trying to replicate an Arduino Nano, fabricating my own board. I'm using a UA78M05 linear regulator to feed 5V from a 9V battery (see image below) as external power supply.

schematic

simulate this circuit – Schematic created using CircuitLab

Now, this board uses an 6-pin IDC type connector for SPI programming. Since the 2nd and 6th pins of the IDC connector are, respectively, Vcc and GND, I'm applying a voltage to the output of the linear regulator. The problem is that the regulator immediately heat up (after maybe 10 seconds I can't touch it). Is it supposed to heat up like this and I simply forgot to put a heatsink? Or is there something wrong with the wiring? The rest of the board follows in the next image. All the parts were soldered by me and are SMDs on a board professionally frabicated (no home-made etching).

Arduino-uno-like board

Edit 1: Following the suggestion of Dwayne, I hooked up a 1N4007 diode across the output and input pins. The result was that now the heat distributes across the two components: for the same amount of time during which I keep the battery connected (or the IDC connector), if there's the diode, the regulator will heat less but touching the diode you can feel it heated. Is this an expected behaviour or there's something wrong with wiring/power dissipation?

Best Answer

You need to avoid backfeeding the regulator. This is done by diode ORing your two power sources (regulator and bus power). Note that [depending on your budget and requirements] this can be done with Schottky diodes or with ideal [IC, MOSFET-based] diodes, e.g. these.

The protection that Dwayne describes is useful when you cut the battery power to regulator (so its output may temporarily see higher voltage than its input), but is not a substitute for diode ORing when using multiple power sources that all have power at the same time.

Regarding heatsink: how much power are you drawing? At idle the Atmega328 shouldn't use more that 100mW so if you find yourself needing a heatsink at idle, something is probably wired wrong. That means 20mA at the most through the reg at idle. Times 4V (=9-5) it's about the same power dissipated in the regulator. Actually, which package of uA78M05 are you using? In the TO-220 you shouldn't be able to feel anything at this power, but with the smaller SOT223 package you might feet a small warm spot.