AC current sensing (rectify, amplify + levelshift)

Discussion in 'General Electronics Chat' started by Col, Apr 19, 2012.

  1. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
    Hi,

    I'm designing a circuit to measure AC current flow based on the Allegro ACS714 (Hall effect current sensor -> 100mV/Amp). I want to catch a small current, few 10s to few 100s of mA. Setting 100mA as the design goal => and input signal 10mV. ACS714 output is small signal AC at a 2.5V reference.

    I have four goals with my measured signal

    1. I would like to gain my signal for effective ADC sampling
    2. I would like to rectify the signal for ADC
    3. I would like to shift the reference to 0V
    4. Reduce amplifier bandwidth to reduce high frequency noise

    I though this was pretty simple... I AC coupled my signal into an inverting opamp (LMV321 powered with 0-5V) precision rectifier starting with a modest gain of 100. I put a bandwidth reducing cap in the feedback path. I attach a sketch of the circuit.

    I built the circuit and my amp output is driving to the positive rail and becomming hot. Am I missing something silly? Ive checked for shorts, diode polarity etc.

    [​IMG]
  2. chrisw1990

    chrisw1990 Active Member

    Joined:
    Oct 22, 2011
    Messages:
    543
    Location:
    UK, Near Brighton
    http://forum.allaboutcircuits.com/showthread.php?t=61029
    take a look here for making the signal relative to 0V..
    i think your amplifier wont like the feedback after the diode, so it will be trying to drive it to make it correct.. think of it like balancing the load almost? put the feedback circuit before the diode and try that..
    in order to rectify it, you could try 4 diode rectification, or, a low pass filter maybe.. i know this works with square waves but the harmonics of the sine wave are different. maybe worth a go.
  3. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
  4. chrisw1990

    chrisw1990 Active Member

    Joined:
    Oct 22, 2011
    Messages:
    543
    Location:
    UK, Near Brighton
    i think the cutoff frequency would have to be very low for the filter to work.. might make it unuseable..
    got to be honest, iv never seen an opamp used like that so i dont want to say, yes or no... iv never heard of an opamp being used like that.. id look more into the theory of it first:) maybe theres something youre overlooking :)
  5. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
    I reckon all's good with the rectifier circuit. It's a pretty standard config. http://sound.westhost.com/appnotes/an001.htm

    It more to do with the level shift. If I've AC coupled the input signal, is that not euough to shift down to ground
  6. chrisw1990

    chrisw1990 Active Member

    Joined:
    Oct 22, 2011
    Messages:
    543
    Location:
    UK, Near Brighton
    ah right yeh maybe.. try that transistor circuit in the thread of the link i posted, iv used it on a board im looking at now.. works quite well:) obviously your components will be different but simulate and try it out:)
  7. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Col, you need a negative supply.

    EDIT: What are you using to get your +5V? We might be able to get a negative supply from it.

    Chris, the circuit you posted here doesn't make any sense. The input signal goes to the power pin of the output amplifier, and the collector of the emitter follower. Also, Col wants a precision circuit. The addition of an emitter follower which is not inside a feedback loop eliminates this possibility.
    With all due respect, Chris, you are over your head on this topic. Giving advice when you don't know what you are doing is not helpful.
    Last edited: Apr 19, 2012
  8. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
    Thanks Ron... you are right I have been seeing some component of my signal on the supply. Unfortunately dual supply isnt an option in my application. I've thrown out the previous circuit in favour of the much simplified one attached, just a gain amp and a tank filter. I've sacrasfised half my ADCs range plus the diode drop, so really I would hope for a better solution.

    [​IMG]
    I can tolerate losing half my signal before rectification, at least i'd be using more of the ADC range. It there a way to let my amp saturate for the negative half-cycle without all the nasty side effects... perhaps put the diode and capacitor before the amplifier could work...
  9. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    My comment about signal on supply was directed at Chris's post.
    I asked you where your +5V comes from.
  10. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
    Ive got an AC/DC converter from the mains. In my component count critical application, this element is the only analogue part. I'd realy rather not go adding further power devices for voltage inversion
  11. chrisw1990

    chrisw1990 Active Member

    Joined:
    Oct 22, 2011
    Messages:
    543
    Location:
    UK, Near Brighton
    yes sorry the schematic was wrong, and when i put it on pcb, that was all corrected.. for some reason i hadnt connected the power together for the hall sensor and the trannie and opamp. nor outputted the signal.
    my direction towards that thread was for removing the dc offset. which was the use of the transistor in the middle.
    sorry if you think i am over my head. trying to help a colleague was my aim, and in my eyes i did that by pointing to the thread.
  12. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
    Implementing the simpler circuit... I have a rectified output signal which is offset by a reference of 2.5V. MY microcontroller has a 3.3V supply, (my ADC reference voltage). This is leaving me with a small 0.8V effective signal range... just too little in my opinion.

    Ron... is there a way to remove the 2.5V offset from my DC signal? I never really considered I could use opamps for DC signals. Again, putting in negative supply voltage is not an option
  13. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Are you wanting to digitize the instantaneous half-wave rectified output, or do you want a precision peak rectifier, where the peak value is converted to DC (with a little ripple)?
  14. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
    I only want to measure a DC value representing my current. No need to digitise the 50Hz
  15. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
    Is it really bad to just let the amplifier saturate?... since its only 50Hz I dont imagine it would be much affected by the saturated amps recovery time
    Last edited: Apr 25, 2012
  16. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    Here is a circuit that works well in simulation. You should be able to use any op amp whose input and output can go to the negative rail (GND). On most such amps, the input must never exceed -0.3V, although LMV321 is rated at -0.5V max.
    I set the gain at 100. You can adjust it as required. Keep in mind that the op amp's input offset voltage will be amplified by the gain. You can't put a cap in series with R2 to reduce the DC gain to 1, because the cap would charge up to the point where the circuit doesn't work.
    You can disconnect the input and replace it with a short, then measure the zero-signal output offset voltage.
    Keep in mind that the output time constant is about 100 seconds, so sudden large decreases in the input signal will take a long time to show up on the output. You can reduce the output cap at the cost of more ripple.

    EDIT: You can do this with a gain of 50 preamp with AC coupling, which will reduce the gain requirement for the rectifier, thereby reducing the output offset. It would require a dual op amp (same approximate footprint), and two more resistors and a 1uF capacitor. Let me know if you're interested.

    Attached Files:

    Last edited: Apr 25, 2012
  17. Col

    Col Thread Starter Member

    Joined:
    Apr 19, 2012
    Messages:
    34
    You've been quite helpful,
    Thanks Ron
Similar Threads
Forum Title Date
General Electronics Chat current sensing resist ? Dec 5, 2013
General Electronics Chat LT 1787 Current Sensing IC Apr 8, 2013
General Electronics Chat current sensing using ADC of microcontroller Mar 31, 2013
General Electronics Chat Current/voltage-drop on the voltage sensing wires of a Four-Terminal mesrmt setup? Nov 27, 2012
General Electronics Chat AC current sensing Nov 14, 2012

Share This Page