Help - low side current measurement of motor via shunt and adc

Thread Starter

Choon Kwang

Joined Jun 6, 2022
13
wlpThis circuit is a low side current measurement of a motor using a shunt resistor and adc of a mcu. However, I do not understand the reason or use for the 100k internal pull down resistor, 10k external serial resistor and the capacitor. Anyone can help?
16885275218846316107857729117074.jpg
 
Last edited by a moderator:

ericgibbs

Joined Jan 29, 2010
18,221
hi CK,
The 10k and 100k form a simple voltage divider, approx 0.9 ratio, Vshunt versus Vadc.
The 1uF is an electrical noise filter when combined with the resistors.
Designed to give some level of noise protection for the ADC input.
You have not stated the motor voltages or currents.

E
 

Thread Starter

Choon Kwang

Joined Jun 6, 2022
13
wlpThis circuit is a low side current measurement of a motor using a shunt resistor and adc of a mcu. However, I do not understand the reason or use for the 100k internal pull down resistor, 10k external serial resistor and the capacitor. Anyone can help?
View attachment 297718
Hi Eric,

Thanks. The motor is driven by 5v. Based on 12bit ADC, Vref = 3.3v, for a 20mA current through the shunt resistor, am I right that the ADC count is 61?
 

ericgibbs

Joined Jan 29, 2010
18,221
Hi,
Vshunt= 2.74R * 0.02A= 0.0548V
Vadc = 100k/(100k+10k)= 0.909
0.0548V* 0.909 = 0.0498V
0.0498v/3.3v= 0.015 * 4096 = 61 Counts.

E
 

MisterBill2

Joined Jan 23, 2018
16,534
wlpThis circuit is a low side current measurement of a motor using a shunt resistor and adc of a mcu. However, I do not understand the reason or use for the 100k internal pull down resistor, 10k external serial resistor and the capacitor. Anyone can help?
View attachment 297718
The choice of resistances is based on assumptions about both the actual motor current and the input voltage range of the ADC.
Given the rather unusual value of the shunt resistor, this must be a very small motor. The two resistors, 10K ohms and 100K ohms, for an 11:1 voltage divider, also a somewhat unusual choice.
Based on the additional information in post ##3, a great deal of accuracy is sacrificed by using that voltage divider, which adds two variables of unknown actual resistance.
 

ericgibbs

Joined Jan 29, 2010
18,221
Thanks. The motor is driven by 5v. Based on 12bit ADC, Vref = 3.3v, for a 20mA current through the shunt resistor, am I right that the ADC count is 61?
Hi Bill,
There are no assumptions about the motor, or the circuitry, the figures posted were clear and concise.
Rsh=2.74R, Motor Current 20mA, 10k/100k resistive divider, 3.3Vref, ADC 12Bit.

I am at a loss regarding the point/purpose of your post that raises doubts regarding such clear-cut values.??

E
 

MisterBill2

Joined Jan 23, 2018
16,534
Hi Bill,
There are no assumptions about the motor, or the circuitry, the figures posted were clear and concise.
Rsh=2.74R, Motor Current 20mA, 10k/100k resistive divider, 3.3Vref, ADC 12Bit.

I am at a loss regarding the point/purpose of your post that raises doubts regarding such clear-cut values.??

E
It is unlikely that the resistors in the divider are exactly those values. even 1% tolerance (precision) resistors allow variations.
And then consider the A/D system, which is described as 12 bits (4096 counts full scale).
The calculated shunt voltage for 20Ma current,( V shunt= 2.74R * 0.02A= 0.0548V ) is well within the A/d input range, allowing a much higher accuracy reading of the current, considering that the A/D converter accuracy is limited to +/- some number of counts.

And also, please consider that the math used in post #5 is producing resolution not present in the original data, at least, not if this is actual data and not a simulation.
 

MisterBill2

Joined Jan 23, 2018
16,534
Hi Bill,
Forgive me for being blunt, but you are talking nonsense.

E
E.G. is certainly welcome to ignore what say. However, for data, resolution not stated is usually not implied. 20 Ma is not the same as 20.00 mA, and 2.74 Ohms is not likely quite the same as 2.7400 ohms. Using a voltage divider will certainly reduce the resolution of a reading on an A/D converter.
 

ericgibbs

Joined Jan 29, 2010
18,221
HI Bill,
It is not only a potential divider, it is also a simple noise filter.

Your arithmetic comments regarding 'possible' inaccuracies in values that have been posted by the TS are meaningless.
Using your flawed logic, it could be claimed that a mathematical answer to any circuit problem would be unacceptable.

Why do you insist on posting doubts into the mind of the TS, regarding the reliability of the helpful replies posted by other members?

E
 

Ian0

Joined Aug 7, 2020
8,942
What is the maximum running current of the motor, and what degree of accuracy is required? - the answers to those questions determine whether it is an effective circuit or not.
 

ericgibbs

Joined Jan 29, 2010
18,221
Hi Ian,
The TS did ask for our opinion of his circuit, just a request for confirmation of his result of 61 counts in an ADC buffer, using the circuit parameters he posted.

E
 

ericgibbs

Joined Jan 29, 2010
18,221
hi,
I asked that question prior to the calculation of 61 confirmation request, his reply was a request only for confirmation, that is exactly what I replied, the confirmation of his calculation.

If the TS comes back with additional query posts, I will respond appropriately.

I don't have the inclination or intention of playing games.

If you have any further points, address them to the TS.

E.
 

Thread Starter

Choon Kwang

Joined Jun 6, 2022
13
Hi all,

Thank you for providing me your advices and comments. I learnt a lot through all your advices. For now, I got my answers.
 
Top