# How to measure the current of a normal 12v dc motor?

I would like to know if there is a way to measure the current of a normal 12V dc motor.
I am using a DRV8838 and a Arduino Nano.
I want to use it to stop the motor once a specific current draw or load is reached, if the motor is about to stall.
I’m fairly new in all of this, so if possible a simple explanation would be nice.

2 Likes

What is the rated current of the motor? Current measuring devices cover a specific range, and you should choose one that is not too far over the rated current of the device you are measuring. For isntance, for a motor rated at a maximum of 3 or 4A, you could use this:

The device outputs a voltage which can be monitored by a MCU such as an Arduino, which could then trigger a relay to turn the motor off. Code examples for reading a voltage and triggering a relay are readily available.

3 Likes

Hi Dan
This chip has built in over current and over temperature protection.

If you want to actually MEASURE the current you could try a VERY LOW (0.01Ω) resistor between ground pin and ground. Will return 10mV per Amp. This may or may not be advisable. I have not read the data sheet in detail.
The breakout described above is a good bet as it will have minimum disruption to the DUT.

Cheers Bob

3 Likes

Based on the DRV8838 data source, can a very low ohm resistor in series with the motor power feed to measure the voltage drop across it? I mean, knowing the voltage and the resistance then I can calculate the current.

1 Like

That is how Amp meters work. The resistance is usually in mΩ (milliohms). The exception are the hall effect devices.
Cheers Bob

1 Like

Hey Dan,

Yes, that should be a suitable method for determining the electrical characteristics of the various elements in your circuit. One of the interesting problems that you may notice when trying to measure the specs of the motor is the generated back EMF (i.e. the voltage that the motor generates as it turns) which when you power down the motor due to coasting potentially cause a backward current to flow. With most motors and rigs this isn’t usually too high, but if you’ve got a geared system with plenty of inertia, that is something worth considering as reverse currents can destroy some of the more sensitive ammeters.

Bryce.
The voltage spike produced at the moment of switch off by collapsing fields is indeed reverse to driving voltage. The voltage produced by the motor coasting and thus becoming a generator is the same polarity. If you look across a motor with an oscilloscope being driven with a PWM signal the reverse spike is caught by the flywheel diode and you can see a voltage between pulses gradually rising as the motor gets faster. Some speed controllers actually measure this “in between” voltage as a means of estimating RPM.
Cheers Bob
PS. Apologies Bryce. I must be having a brain snap. You are talking about current, of course it will flow i the opposite direction as the motor becomes a generator.
BUT, if the motor is switched off it will be open circuit and no current will flow. If any appreciable current does flow this means there is a low resistance across the motor and it will quickly stop.
Cheers Bob

2 Likes

Ah that’s a good point Bob, the only other issue that I can see is if you’re suddenly applying a physical load to the motor, or turning it on in the reverse direction very quickly causing a spike that could potentially damage the sensor if the circuit is still closed.

It’s an unlikely edge case, but still worth looking out for if hooking this up to a breakout. The breakout Jeff linked is rated for a full 5A, however, it depends on what we classify to be a normal DC motor (I believe Jeff stated a max draw of 3/4A earlier which should be fine for this application)

1 Like

Hi Bryce
For current to flow you have to have a circuit from one side of the motor to the other. Under normal conditions this would probably include a power supply and some sort of switch. Of course if the switch were closed under these conditions the motor would be running. If however there happened to get a short circuit or low resistance across a motor current would flow and sometimes lots of it. BUT, have you ever tried to turn a DC motor while there is a short across it. That is how over run is stopped. Have a low value resistor or diode switched across it when power removed such as limit switch operation.

You are quite right though. All possibilities should be considered when playing with something new. The degree of concern should be scaled according to the probability of a particular event occurring. Good advice to have a think before first switch on.
Cheers Bob

2 Likes