# Convert 1-50mA to 0-5V using LM324

1. ## Convert 1-50mA to 0-5V using LM324

Hi and good day all,

I wanted to measure current from a motor. I measured that at normal operation the motor takes about 40mA. I am using a current sense resistor of 0.1ohm. Usually I use a HCPL-7520, but this time around I am trying to use a LM324 to solve the problem.

With a HCPL-7520 it is really easy, just parallel the current sense resistor to the HCPL-7520 and input it to the microcontroller (PIC) ADC pins and adjust the codings.

But with a LM324, I really am not sure how to do this. Just for safety, I put the maximum value to 50mA so it would detect the little overcurrent there. As the PIC ADCs could only detect 5V it would be nice that at 50mA the PIC will detect about 5V.

Anyone got any idea? Really stuck here. Thanks in advance guys.

---------- Post added at 05:01 ---------- Previous post was at 04:58 ----------

Btw, the motor is dc.

2. ## Re: Convert 1-50mA to 0-5V using LM324

Wouldn't the first single supply application circuit from the data sheet (non-inverting) work with a gain of 100 or the current monitor application circuit http://www.national.com/ds/LM/LM124.pdf?

1 members found this post helpful.

•

3. ## Re: Convert 1-50mA to 0-5V using LM324

you can learn how to scale and shift voltages using opamps ..

As far as the opam is concerned, you should look for rail-to-rail opam that can produce the output from GND to Vcc (full swing); the LM324 can't do this, so with the supply voltage of Vcc=+5V you can expect the output range somewhere between 0.3V to 3V ..

IanP

1 members found this post helpful.

•

4. ## Re: Convert 1-50mA to 0-5V using LM324

Wouldn't the first single supply application circuit from the data sheet (non-inverting) work with a gain of 100 or the current monitor application circuit http://www.national.com/ds/LM/LM124.pdf?
Oh yeahh~ Never know this datasheet before. I see it got a current sensing design there~ Thanks KJ6EAD

---------- Post added at 13:29 ---------- Previous post was at 13:27 ----------

Originally Posted by IanP
you can learn how to scale and shift voltages using opamps ..

As far as the opam is concerned, you should look for rail-to-rail opam that can produce the output from GND to Vcc (full swing); the LM324 can't do this, so with the supply voltage of Vcc=+5V you can expect the output range somewhere between 0.3V to 3V ..

IanP
Thanks IanP, I'll try to look at KJ6EAD and yours. Will tell the updates later yea

•

5. ## Re: Convert 1-50mA to 0-5V using LM324

I took it directly from the circuit but it doesn't work. The output just shows my Vin. Got any idea how to test this to work?

---------- Post added at 18:53 ---------- Previous post was at 18:51 ----------

Is there any big difference if I took out the transistor? I used 2N3904 for this purpose. Tried with the transistor and not. But it just doesn't make that voltage difference say if I put a 15mA LED and 30mA dc motor.

6. ## Re: Convert 1-50mA to 0-5V using LM324

Anyone can help me with this? This is the last part of my project. Really could use some help. Thanks

7. ## Re: Convert 1-50mA to 0-5V using LM324

There are certain conditions that have to be met if you wants this circuit to work ..
First, for small currents you have to increase the value of R1, which was meant to work with amps rather than mA, to, say 1ohm ..
Next thing you have to keep in mind is that the opamp’s supply voltage has to be higher than V[L], voltage used to supply load ..
And (I hope) you have connected a load in place of R[L], correct?

IanP

8. ## Re: Convert 1-50mA to 0-5V using LM324

Originally Posted by IanP
There are certain conditions that have to be met if you wants this circuit to work ..
First, for small currents you have to increase the value of R1, which was meant to work with amps rather than mA, to, say 1ohm ..
Next thing you have to keep in mind is that the opamp’s supply voltage has to be higher than V[L], voltage used to supply load ..
And (I hope) you have connected a load in place of R[L], correct?

IanP
Is there a way that I can still use the 0.1ohm resistor without changing it to 1ohm? And yes, I have connected the necessary load. first is to make 20mA and the other is 30mA just to know is there any increase in the voltage. I am using 5V rite now, so maybe the maximum limit is 3V like you've said? It is still ok for me I think

•

9. ## Re: Convert 1-50mA to 0-5V using LM324

0.1 0hm x 20mA => 2mV

And 2mV is the opamp’s input offset voltage, so the usable signal is on the same level as errors ..
Consider even higher resistance, maybe 10 Ohm; 1 Ohm will be the absolute minimum ..

IanP

--[[ ]]--