# Arduino Forum

## Using Arduino => Motors, Mechanics, Power and CNC => Topic started by: koronus on Dec 08, 2018, 10:29 am

Title: measuring the current of the Dc motor
Post by: koronus on Dec 08, 2018, 10:29 am
hi
is there any way to measure the current of the dc motor, actually I want to give the periodic voltage to the dc motor and I need the periodic values of the current which flow in the motor
Title: Re: measuring the current of the Dc motor
Post by: groundFungus on Dec 08, 2018, 11:07 am
Some DC motor drivers have a current output.  To help find one we need to know the rated voltage and stall current of your motor.

Place a shunt (low value resistor) (http://www.vwlowen.co.uk/arduino/current/current.htm) in series with the motor.  The voltage dropped by the resistor is proportional to motor current (see Ohm's law).  Depending on the setup, amplification of the output may be necessary.

Use a current sensor  (https://www.digikey.com/en/articles/techzone/2012/sep/the-basics-of-current-sensors).
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 08, 2018, 06:13 pm
Some DC motor drivers have a current output.  To help find one we need to know the rated voltage and stall current of your motor.

Place a shunt (low value resistor) (http://www.vwlowen.co.uk/arduino/current/current.htm) in series with the motor.  The voltage dropped by the resistor is proportional to motor current (see Ohm's law).  Depending on the setup, amplification of the output may be necessary.

Use a current sensor  (https://www.digikey.com/en/articles/techzone/2012/sep/the-basics-of-current-sensors).
thank you so much
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 10, 2018, 08:45 pm
please help to wire the dc motor with ACS712 current sense module, I know how to connect the ACS712 with power supply but I don't know how to connect the dc motor to the circuit, actually, I want to give the voltage to the dc motor and read the current with ACS712
Title: Re: measuring the current of the Dc motor
Post by: groundFungus on Dec 10, 2018, 09:41 pm
What are you using to drive the motor?  A transistor?  Relay?  H-bridge?   Part number or link to the driver?

What is the stall current of your motor?
Title: Re: measuring the current of the Dc motor
Post by: outsider on Dec 10, 2018, 09:56 pm
Quote
I want to give the periodic voltage to the dc motor
If you are talking about PWM, you may not be able to measure the pulsating current without heavy filtering.
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 11, 2018, 06:21 am
What are you using to drive the motor?  A transistor?  Relay?  H-bridge?   Part number or link to the driver?

What is the stall current of your motor?
I'm using L293D shield and the stall current is 11.96 A
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 11, 2018, 06:47 am
If you are talking about PWM, you may not be able to measure the pulsating current without heavy filtering.
yes I want to use PWM, "FILTERING" what did you mean?
Title: Re: measuring the current of the Dc motor
Post by: Wawa on Dec 11, 2018, 06:52 am
I'm using L293D shield and the stall current is 11.96 A
That's ten times the absolute maximum peak current that the L293D can handle.
Leo..
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 11, 2018, 09:02 am
That's ten times the absolute maximum peak current that the L293D can handle.
Leo..
so what should I do?
Title: Re: measuring the current of the Dc motor
Post by: groundFungus on Dec 11, 2018, 10:33 am
Quote
so what should I do?
Get a proper motor driver.

Pololu carries many DC brushed motor drivers. (https://www.pololu.com/category/11/brushed-dc-motor-drivers)  Some have current sense outputs.
Title: Re: measuring the current of the Dc motor
Post by: MarkT on Dec 11, 2018, 12:24 pm
hi
is there any way to measure the current of the dc motor, actually I want to give the periodic voltage to the dc motor and I need the periodic values of the current which flow in the motor
If you mean you are using PWM to drive the motor, you may find the current is varying much less
than you think, motors are inductive, smoothing out the current waveform.
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 11, 2018, 10:15 pm
If you mean you are using PWM to drive the motor, you may find the current is varying much less
than you think, motors are inductive, smoothing out the current waveform.
you mean that I could give the smaller values of the voltage and not the maximum range?
Title: Re: measuring the current of the Dc motor
Post by: MarkT on Dec 11, 2018, 10:53 pm
No, I don't mean that at all.

I mean the current is varying less than you might think if you thought it followed the voltage waveform.
You might not need to work about timing the reads to match the PWM.
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 11, 2018, 11:07 pm
No, I don't mean that at all.

I mean the current is varying less than you might think if you thought it followed the voltage waveform.
You might not need to work about timing the reads to match the PWM.
so is it possible to use this method for reading current values with the L293D shield and ACS712 30A and the 12V DC motor and the difference between the stall current and the maximum current of the motor driver isn't important? If yes, please help about the circuit (actually wiring)
Title: Re: measuring the current of the Dc motor
Post by: MarkT on Dec 11, 2018, 11:14 pm
The ACS712 30A current sensor will not be useful for measuring small currents (the L293D can only
handle small currents).

For small currents a simple shunt resistor in the ground-return from the motor driver is all you need
to measure current.
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 11, 2018, 11:19 pm
The ACS712 30A current sensor will not be useful for measuring small currents (the L293D can only
handle small currents).

For small currents a simple shunt resistor in the ground-return from the motor driver is all you need
to measure current.
ok thank you so much
Title: Re: measuring the current of the Dc motor
Post by: koronus on Dec 11, 2018, 11:37 pm
and how much(ohms) must be  the value of the resistor?
Title: Re: measuring the current of the Dc motor
Post by: MarkT on Dec 14, 2018, 07:33 pm
What current maximum?  How much voltage do you mind losing?  How much heat can you afford to dissipate?
From such considerations use Ohm's law to calculate the shunt resistor value that works for you.