# How to log voltage and current?

I have an RC car driven by a brushless motor, and I want to log the voltage of the battery and current drawn by the circuit at regular intervals, and store the result in the EEPROM. My circuit is pretty much the exact same as this one:

How would I connect an Arduino to the circuit to take voltage and current readings? Obviously I can't plug the battery into the ADC, as it is over 5V...

My main problem is that I have no idea how to measure the current drawn. I presume a resistor and some application of Ohm's law is needed, but I'm not sure how to go about connecting things.

Thanks in advance for any help

You connect the +ve of the battery to an arduino through two resistors forming a potential divider that reduces the voltage to less than 5V for the maximum you batteries can produce.

Make the bottom resistor 10K and work out what you need for the top one.

Current:- you break the -ve line to your battery and insert a 1 ohm resistor. Then you wire the battery side to your arduino ground and the other side to your analogue input. Measure the voltage and do ohms law. If this is not sensitive enough then make the resistor bigger but it will affect the voltage you drive your system with.

Grumpy_Mike:
Current:- you break the -ve line to your battery and insert a 1 ohm resistor.

If the motor draws 20 amps (which would not be unusual) a 1 ohm resistor would prevent it working properly. A much lower value is required - perhaps 0.01 ohms. The problem then is that the voltage across the resistor would need to be amplified before it could be detected by the ADC in an Arduino Uno. The chips in some of the other Arduinos (a Mega, Leonardo and the Attiny chips) can measure differenctial voltage and contain amplifiers. I haven't tried this yet.

Another option might be a current measuring sensor that fits over the power cable.

...R

Its compatible with the HKPilot which is effectively a DIYDrones APM 2.5 board, which is in turn a modified Arduino Mega 2560 board.

So power modules like this can be read by an Arduino , you'd just need to work out what connections go where and as the APM is open source you should be able to get the schematics for all of it.

BTW. It also extracts power to power the APM, (Max 2.25A as listed in the spec)

Thanks so much for the replies! I can't believe I forgot about voltage dividers, that was a major brain fart...

I think I'll go for a small resistor and an amplifier to measure current. I do also have some attiny chips lying around so maybe the amplifier isn't completely necessary.

A side question: how many watts should I look for in the current sense resistor? Say I draw 60 amps at 8 volts (absolute worst case scenario): does this mean I need a 480 watt resistor? Or do I just work out the voltage drop across the resistor and multiply that by current to get the watts?

Say I draw 60 amps at 8 volts (absolute worst case scenario): does this mean I need a 480 watt resistor?

No.

Or do I just work out the voltage drop across the resistor and multiply that by current to get the watts?

Yes

Thanks, it felt a little weird, trying to find a 400+ watt resistor on element14

For high current don't use resistor, use Hall Effect Current Transducer like this one