I'm trying to make a simple keypad lock that has a 12 V magnetic lock. I supplied 12 V to the RAW pin on the Pro Mini with plans to actuate the relay with the 5 V from VCC pin. The lock was grounded on the terminal strip that the 12 V came from, and then the positive 12 V was switched through the relay.

Everything was working well until I powered the board through the RAW pin with 12 V. When I did that all three failed the smoke test.

My question is, am I doing something incorrectly or did I happen to get a bad batch (all three of the boards came in the same shipment, I assume they came from the same lot)?

  • 2
    Can you post your circuit diagram? – Fauzan May 25 '17 at 6:30
  • And part numbers of your regulators. What current is involved? – Code Gorilla May 25 '17 at 7:27
  • do you have common grounds? – dandavis May 25 '17 at 20:06

The Pro Mini's 5V regulator (MIC5205) can supply a maximum of 150 mA, from which the Pro Mini uses about 20 mA, leaving around 130 mA for other applications.

Pro Mini power supply

Check the data sheet of the relay, to get the maximum current draw. For example, the RWH-SH-105D relay requires around 70 mA in the "on" position. While this is under the 130mA limit, you may be using other IOs or powering other modules.

To reduce the current draw, use a transistor to drive the relay like this: Relay driver

  • 2
    Correct analysis of the problem (or at least one of them), but your solution has a bit of an issue in that it is for a relay with a 12v coil, while the poster appears to have one with a 5v coil. So the poster will need a different relay, to find a high current regulator to power it, or perhaps to play very carefully calculated games with a power resistor in series with the relay coil. Alternately, they may be able to use a much better transistor than the 2N3904 or perhaps a power NFET, and drive the lock solenoid directly. – Chris Stratton May 25 '17 at 17:10

A magnetic lock will be based on a solenoid, which will probably draw quite a high current from the 12 V rail. When that load is switched, a voltage spike will appear into the 12V rail due to the inductance of the supply wires. The longer the wires and the higher the current, the bigger the voltage spike.


simulate this circuit – Schematic created using CircuitLab

If the spike goes above 20V (and it can easily happen, believe me) then it will exceed the maximum rating of the MIC5205 voltage regulator and fry it unless you prevent that with some extra components. The voltage rating of the regulator input capacitor in the Pro Mini probably isn't up to the task of handling 20+ V spikes either and may be getting damaged too.

Note that the Pro Mini is specified to work with input voltages only up to 12 V, so you are operating it with no margin whatsoever! You should consider reducing that voltage in first place. You could use a DC/DC converter module to step down the 12V to a more suitable 7V and provide isolation from the spikes at the same time.

Apart from that, consider using a transient voltage suppressor (TVS or transzorb diode) and/or a large decoupling capacitor (with an adequate voltage rating) as close as possible to the input of the Pro Mini or the DC/DC converter (if you use one). You might want to try decoupling your magnetic lock with a properly selected capacitor as well.

Bonus: thermal considerations

Thermal issues shouldn't be the main culprit here, but be aware that the tiny MIC5205 can get extremely hot and enter thermal shutdown mode when operated at 12 V input voltage.

The junction to ambient thermal resistance of the regulator is 220 C/W. Its maximum operating junction temperature is 125 C. At 25 C ambient temperature that means the maximum allowable temperature rise is 100 C and the maximum allowable power dissipation is 455 mW. Because the regulator is dropping 7V, the maximum allowable current will be only 65 mA (instead of the 150 mA max that the MIC5205 can source in more favorable conditions). The consumption of the Pro Mini is around 20 mA, so that leaves you with only 45 mA for your application. You should consider whether this is enough for your application or not (some 5V relays draw around 80 mA, which will greatly exceed this 45 mA calculated limit, when connected to the VCC pin of the Pro Mini).

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.