So what I'm doing might be actually a little haywire, but here goes:

I'm using an Arduino to power a series of relays that control some 24 volt valves. The power source is two Milwaukee M12 batteries in series (the batteries themselves have no internal boards to speak of). I am using a 7805 Linear Regulator (5 volt) to pull power off one of the 12 V batteries (the regulator would noticeably choke out when I had it hooked up to the full 24 volts).

All of this worked fine.

Then I got the crazy idea to try to monitor the voltage of the batteries (individually) through the Arduino, by dividing the voltage by 1/3 and connecting them to analog pins. And that's when wires started smoking and several Arduinos checked into the morgue. Arduino Monitor for M12 batteries schematic

I don't know if a snubber or a diode in there somewhere would fix it, but I'm hoping it will be obvious to someone (trial and error is proving to be expensive). It's worth noting that this circuit will blow an Arduino even with only the first battery installed.

The diagram doesn't include the rest of what's hooked up to the Arduino--they don't strike me as suspect--but for completeness: 6 solid state relays, an NRF24 adapter(5 pins) and a 3v3 volt regulator(downstream of the 7805) to power the NRF24 adapter. Also, the both regulators (the 7805 and the 3v3) have the small capacitors recommended by the datasheet.

Any ideas? I'd be happy to share some videos, though honestly, the Arduinos completely fail to burn out in even the most vaguely interesting manner.

  • \$\begingroup\$ Doesn't 12Vin to 5Vout go to Arduino Vin, not Arduino 5V? I thought Arduino 5V pin was a 5V regulated output which is derived from a (potentially [heh] noisier) 5V input at Vin.. \$\endgroup\$
    – kando
    Sep 13, 2023 at 21:13
  • \$\begingroup\$ arduino.stackexchange.com/questions/4458/… \$\endgroup\$
    – kando
    Sep 13, 2023 at 21:15
  • 1
    \$\begingroup\$ You're correct about the pins, but the voltage incoming to the Arduino is already regulated to 5 volts by the 7805, so going directly to the 5V pin is in this case proper. \$\endgroup\$ Sep 13, 2023 at 21:46
  • 2
    \$\begingroup\$ Yeah, BT1 appears to have both its terminals connected to GND. I'd expect problems. \$\endgroup\$
    – Finbarr
    Sep 13, 2023 at 21:48

2 Answers 2


According to your diagram, BT1 is shorted. As you don't report smoke from the battery, I will assume that your schematic diagram is wrong. I am going to guess that the ground symbol at the bottom right is not actually there. If so:

What's happening is that you're sending 16 V to the Arduino through R3. The Arduino doesn't like it. If you doubt that, get a meter and start measuring. With respect to the ground of the Arduino, R3 has 24 V on the right end and 16 V on the left end. R4 has 12 V on the right end and 16 V on the left end.

The solution would be to move R4 to the real ground, not to the incorrectly drawn ground. I say "would be" because those resistor dividers will over-discharge your batteries in a mater of days. Then, when you recharge them, fireworks will follow.

On a related note:

Using Li-ion battery modules without a BMS is like playing Russian roulette with 5 bullets in the chamber.

Another note:

Using that 7805 voltage regulator without an input and output capacitor is chancy. Check the spec sheet. You need about 1 uF electrolytic on the input and 0.1 uF ceramic on the output, close to the pins.

  • \$\begingroup\$ Thank you, Davide! I will check move the R4 resistor and report back. I do think you've cracked it! (though it was probably obvious to you). I suspect you're right about the extra ground--the system works fine until I connect the battery monitors. I'll post an updated diagram once everything is working, for anyone reading this down the road. \$\endgroup\$ Sep 14, 2023 at 13:14
  • \$\begingroup\$ Real quick: I, too, am a strong advocate of battery management, though it is inappropriate for this particular application. I'll explain when I post the results of the change. Thank you! \$\endgroup\$ Sep 14, 2023 at 13:23

Thanks to Davide for pointing me toward what I was doing wrong, I wanted to follow up with my final solution, for future reference.

Even moving the ground, I was still unable to pull and divide the voltage solely from the second battery; it was always stacked on top of the voltage from the first battery. Since that meant I was stuck doing math anyway, I decided to simply measure the first battery, then both batteries in series and then--to determine the voltage of the second battery--subtract the first from the second. Works well.

Here is my final diagram: enter image description here

For the sake of completeness, I've added in the caps for the 7805 to this diagram. Also, while I agree with Davide that a battery management system is generally important, in this particular case the system will be a monitored by an operator. Any loss of battery power (via a BMS) would be unacceptable; the operator can observe the battery charge and make the decision about when to replace/recharge the batteries.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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