Building an automatic battery tester. How to measure voltage and/or current?

Hi friends,

So far I have rigged up a bunch of LED strips using a sketch similar to the one attached below from adafruit. That draws the max safe output current from my batteries (22.2v, 18a, 400W), and I’ve determined that if they can supply that for 6 min then they are good. The test works; however, I’d like to have the Arduino automate that process.

Is there a way I could get the arduino to measure the current or voltage going into the LEDs even though it bypasses the board? I’d like to write a sketch wherein if the voltage/current drops below a specified threshold the arduino stops the test and signals me (flashes the LEDs), or if the energy stays above that threshold for six minutes the arduino stops the test and gives some other signal.


Background info:

I’m looking to test some lithium batteries quickly, and automate the process with an arduino. The batteries I need to test have six 18650s wired to an internal balancing board, but there are no external balancing leads, so the only way to find if a cell has gone bad is by testing discharge rate. The manufacturer says they should be able to discharge 18 amps continuously without issue, and 22 in a burst. I appreciate your concern, but please do not fret over my safety. I’ve taken the necessary precautions regarding the lithium batteries, high current wiring/pcbs, LED strip voltage drop, etc. I’m just new to Arduino and need help with that.

Easiest way to measure Voltage is to make a voltage divider and read it with analogRead().

A9V battery can become e.g. 4.5 volt so analogRead should read something like 900.

Thank you, Rob, that is a very promising lead; although, after a bit of reading about voltage dividers I hit a little snag. I'm working with about 400W, and looking into resistors that can handle that kind of load I'm noticing they are huge and expensive. Unfortunately, that won't work for me. Please forgive my ignorance, but is there a way to measure the full current without running it all through an expensive resistor? For instance, could I siphon off some small portion of the current, measure that, and produce a somewhat accurate estimate of the whole?