+ Post New Thread
Results 1 to 9 of 9
  1. #1
    Newbie level 6
    Points: 450, Level: 4

    Join Date
    Sep 2010
    Posts
    14
    Helped
    0 / 0
    Points
    450
    Level
    4

    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.

    •   Alt29th October 2010, 22:01

      advertising

        
       

  2. #2
    Advanced Member level 3
    Points: 4,269, Level: 15
    KJ6EAD's Avatar
    Join Date
    Oct 2010
    Location
    Earth
    Posts
    710
    Helped
    195 / 195
    Points
    4,269
    Level
    15

    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. #3
    Advanced Member level 5
    Points: 160,151, Level: 95
    Awards:
    Downloads

    Join Date
    Oct 2004
    Location
    West Coast
    Posts
    7,943
    Helped
    2302 / 2302
    Points
    160,151
    Level
    95

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

    From this thread:
    Scale and Shifting Op-amp voltages
    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. #4
    Newbie level 6
    Points: 450, Level: 4

    Join Date
    Sep 2010
    Posts
    14
    Helped
    0 / 0
    Points
    450
    Level
    4

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

    Quote Originally Posted by KJ6EAD View Post
    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 ----------

    Quote Originally Posted by IanP View Post
    From this thread:
    Scale and Shifting Op-amp voltages
    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



    •   Alt30th October 2010, 06:29

      advertising

        
       

  5. #5
    Newbie level 6
    Points: 450, Level: 4

    Join Date
    Sep 2010
    Posts
    14
    Helped
    0 / 0
    Points
    450
    Level
    4

    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. #6
    Newbie level 6
    Points: 450, Level: 4

    Join Date
    Sep 2010
    Posts
    14
    Helped
    0 / 0
    Points
    450
    Level
    4

    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. #7
    Advanced Member level 5
    Points: 160,151, Level: 95
    Awards:
    Downloads

    Join Date
    Oct 2004
    Location
    West Coast
    Posts
    7,943
    Helped
    2302 / 2302
    Points
    160,151
    Level
    95

    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. #8
    Newbie level 6
    Points: 450, Level: 4

    Join Date
    Sep 2010
    Posts
    14
    Helped
    0 / 0
    Points
    450
    Level
    4

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

    Quote Originally Posted by IanP View Post
    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. #9
    Advanced Member level 5
    Points: 160,151, Level: 95
    Awards:
    Downloads

    Join Date
    Oct 2004
    Location
    West Coast
    Posts
    7,943
    Helped
    2302 / 2302
    Points
    160,151
    Level
    95

    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



+ Post New Thread
Please login