Convert 0-50 mA to 0-4.5 V with LM324

Thread Starter

Nassimakhawela

Joined Mar 11, 2022
4
Hello ,
I have a current sensor with a ratio of 1:1000 for a current of 0-50 A, I want to make a circuit to capture the current value and send it to the input of a microcontroller ATMEGA 328, how I can convert the signal from 0-50 mA to 0-4.5V using LM324 amplifier or other components?
 

eetech00

Joined Jun 8, 2013
4,704
Hello ,
I have a current sensor with a ratio of 1:1000 for a current of 0-50 A, I want to make a circuit to capture the current value and send it to the input of a microcontroller ATMEGA 328, how I can convert the signal from 0-50 mA to 0-4.5V using LM324 amplifier or other components?
What type of current?
AC input current?
DC input current?
 

AnalogKid

Joined Aug 1, 2013
12,052
Your current signal is bipolar, but I assume the uC A/D input is unipolar. Once you have a scaled voltage as in post #2, you can run that through an opamp precision rectifier circuit. The output will look like full-wave rectified AC, something the uC can sort out in software.

Or - Run the voltage signal from post #1 through a true RMS-to-DC converter circuit. For best performance with least headaches, use an IC designed specifically for this purpose. Analog Devices and Linear Technology (now a part of Analog Devices) make chips for this. Overall this is a more complex xolution, but it gets you a much more accurate reading with a distorted input signal.

ak
 

eetech00

Joined Jun 8, 2013
4,704
Those values give you 0-11V output. The question was answered in post #2.

Bob
No...a behavioral simulation was shown in #2.

The current conversion is in #6. A rectifier, or peak detector, could be used to convert the voltage drop across the burden resistor to dc. Then an opamp could be used to used to scale the dc output to the appropriate output level.
 

crutschow

Joined Mar 14, 2008
38,327
The output is a current, so you don't need a precision rectifier to cancel the diode drop, since that drop doesn't affect the current through the burden resistor.
And with proper sizing of the burden resistor, you shouldn't need an op amp.

Below is the LTspice simulation of a circuit using a bridge rectifier feeding a 100Ω burden resistor (red trace), along with an RC filter to give the DC average rectified value of the current (which is better at filtering/minimizing noise and waveform distortion than rectifying the peak) at Vout (green trace).
The average output voltage value for 50mArms current (yellow trace) is 4.4V.

If the current waveform is severely distorted, such as caused by some electronic loads, then you may need to go to a true RMS converter, as Analog Kid suggested, to get an accurate RMS current reading.

1647029487392.png
 
Last edited:

MrSalts

Joined Apr 2, 2020
2,767
90 ohm resistors are known but only a few companies offer them. The standard size is 90.9 ohms. But that would be a shame to buy a 1% accuracy resistor that is already specified to be 1% off of your target.

If you want to hit your target voltage for the current, use a pair of 180 ohm resistors in parallel to give you 90ohms.
 

MrSalts

Joined Apr 2, 2020
2,767
Current loop sensors are used all the time in manufacturing and laboratory since you can run a wire all the way across a factory floor without big fears of signal loss. The current is the current whether you measure it with an ammeter directly or add a resistor and read voltage. The only concern comes if you use a resistor value thst is too large and your IxR voltage exceeds your sensor's headspace (supply voltage). These sensors come in two flavors - NPN (current sinking) and PNP (current sourcing). If read with a differential amplifier, it doesn't matter. Otherwise, it is good to know if your resistor is grounded or connected to Vcc.
 

AnalogKid

Joined Aug 1, 2013
12,052
90 ohm resistors are known but only a few companies offer them. The standard size is 90.9 ohms. But that would be a shame to buy a 1% accuracy resistor that is already specified to be 1% off of your target.

If you want to hit your target voltage for the current, use a pair of 180 ohm resistors in parallel to give you 90ohms.
180 ohms is not a standard 1% value, so they will introduce almost 2.5x the (possible) error compared to a 90.9 ohm, 1% part. Also, the 1% part almost certainly will have a lower temperature coefficient. I would go with the 90.9, and tweak the software to compensate if necessary (we don't know the TS's error budget). There has to be either a conversion equation with one coefficient to tweak, or a lookup table that has to be calculated and entered manually any way.

ak
 

MrSalts

Joined Apr 2, 2020
2,767
180 ohms is not a standard 1% value, so they will introduce almost 2.5x the (possible) error compared to a 90.9 ohm, 1% part. Also, the 1% part almost certainly will have a lower temperature coefficient. I would go with the 90.9, and tweak the software to compensate if necessary (we don't know the TS's error budget). There has to be either a conversion equation with one coefficient to tweak, or a lookup table that has to be calculated and entered manually any way.

ak
180 is certainly a standard value in the e12 and e24 series and many manufacturers are showing differentiation by (bizzarly, and conveniently) offering e12 and e24 series values 1% or better tolerances. There are 150 different SMT model numbers available in Digikey from 14 different manufacturers offering 180ohm resistors in 0.05% to 1% tolerances. Many more choices if you add through-hole (up to 100W at 1%).
 

crutschow

Joined Mar 14, 2008
38,327
Why the big discussion about resistors when we haven't yet determined exactly what is needed?
Certainly a couple 1% resistors in series and/or parallel can usually get close to any desired value.
 
Top