Pull-down resistor + op-amp help

Discussion in 'General Electronics Chat' started by Crispin, Jul 21, 2011.

  1. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    Hi Folks,

    I've got a shunt (75mV/300A) and built a small op-amp circuit to bring the 75 up to 2.8V. Before you connect the shunt, the input is floating and as such, the op-amp has an output.

    How do you determine the value of a pull down resistor? When the op-amp's input is floating, the output is 3.6V (curious as to why that voltage) so "Simples" I said, add a pull down resisitor. I first opted for a 1M thinking anything less would skew the output from the shunt.
    I decided to try a 220K, put it in and tested. The output when the pin was not connected to the shunt (yet not floating) was 300mV. When connected it seems to work ok.

    if I short the input to ground, the output is zero.
    Seeing as 300mV is still not zero, how would I calculate what pull down is needed which will a) hold the output at zero and b) not affect what the shunt is trying to do?



    TIA


    Cheers,
    Crispin
     
  2. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Your questions lack clarity in the absence of any schematics. It would probably help if you posted something along those lines.

    It seems you are asking what to do when the amplifier (differential type?) is disconnected from the low resistance shunt ...? Normally if the inputs are left floating in this situation then the lack of input bias currents leads to an uncertain output condition.

    There is an abundance of literature on the web dealing with the use of differential amplifiers to monitor / amplify current shunt signal.
     
  3. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    I'll upload a schematic when I get home today - it's a pretty simple one though.

    I'm not really asking about the floating input, I accept that all bets are off as to the output in that case. What I am unsure of is how do you determine the value of a pull down resistor which will a) keep it low enough to stop noise on the output and b) low enough but not that low that it affects the actual device you are measuring?
    I would have thought a 220k would have been fine but there is still noise coming through. if I use a lower value, say 10k, the noise might go away but then I could be affecting the input (shunt) because it is being dragged down.

    Hopefully that makes more sense?

    sorry - not really sure how else to explain it (noob terminology)
     
  4. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    You need to clarify what you mean by a pull-down resistor.

    Noise can be addressed using a few approaches.

    For example - If the noise is due to common mode issues then you might need to go to a good quality instrumentation amplifier (e.g INA104 or the like).

    Careful attention to shielding & signal grounding will often help to resolve noise problems.

    Will wait to see your schematic.
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Nothing can be said without that schematic. Be sure to include some indication of how the shunt is disconnected.
     
  6. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    [​IMG]

    A borrowed one but this is exactly what I have.

    The shunt (low side) is connected to the above via a 3.5mm mono jack.

    Now when I have the input floating (i.e. someone unplugged the shunt) the output goes high (3.6V)
    I now have a 220k resistor from the input to ground which I thought would have been enough to keep it low when the input is open.

    Seeing as my shunt is 75mV, what can I use to keep the input low while it is disconnected but not affect shunt's voltage (load the shunt?) when it is connected?


    Cheers,
    Crispin
     
  7. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    Shunt is simply connected via a 3.5mm jack. It can be unplugged while on the bench etc. For normal operation, it'll never be removed. Everything lives in the cupboard.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    What opamp are you using?
    What are the values of R1 and R2?
     
  9. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    sorry :( - thought the theory would be the same regardless.

    R1 = 1k
    R2 = 38k

    op-amp is LM358P
    Input is 75mV max although I'll only ever see about half of that.
     
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    What is the supply voltage(s) for the opamp?
    Are you using a single supply or a dual supply?
    What have you done with the unused channel of the opamp?

    This is why we like to have complete schematics with part numbers and values up front, because we don't have to play the "Whatzis?" game.
     
  11. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    GGGRRR :D

    Single supply, 5V regulated, the unused channel is just floating (what's the best to do with it?)

    sorry - I did not think any of these things would have been required for the answer...but that's why I'm here - learning :cool:
     
  12. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Since you have 1k for R1 and 38k (a non-standard value) for R2, your gain in this non-inverting amplifier configuration will be 1+(R2/R1) = 39; if the opamp were ideal, with 75mV in you would get 2.925 V out.

    However, the LM358 has a typical input offset of 2mV @ 25°C, which could be as high as 7mV @ 25°, and 9mV over temperature. This is also multiplied by the gain, which will result in an error of 78mV for a 2mV offset, and as much as 39*9mV = 351mV over temperature. This error is added to the actual input value.

    There is a minimum output voltage limitation for this opamp. While it can sense input down to the negative rail (ground), the nominal minimum output voltage is 5mV when the gain is 1, but can be as high as 20mV. But since you have a gain of 39, you'll never see lower than 78mV due to the minimum 2mv typical input offset times the gain.

    You can short the noninverting input to ground, and you'll still see ~78mV out.

    You really need to use a different operational amplifier that has a very low offset, and has truly rail-to-rail inputs and outputs. The LM358 just is not accurate enough for your purpose.

    With a single-supply opamp, if you have unused channels and the amp is unity-gain stable, you connect the + (noninverting) input to ground and the - (inverting) input to the same channels' output. This causes the amp to follow ground with unity gain (gain=1).

    [eta]

    I've added a schematic and simulation of your basic circuit. The LM358 model that I used has an output of 103.76mV with an input of 0v, and 2.996v with an input of 75mV. The latter is an error of 71mV, which means that this SPICE model has an input offset of 1.82mV; better specifications than the datasheet.
     
    Last edited: Jul 21, 2011
    Crispin likes this.
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Oops, forgot to attach the schematic/simulation in the last reply; I was still making revisions to it while you were reading it.

    Have a look at it; attached here.
    [eta]
    I've shown the unused opamp channel (U1b) configured as a voltage follower with the input grounded. The model used measures ~21.1mV; just a tad over the datasheet's maximum - but close enough.

    While all this doesn't exactly explain why you were seeing ~3something volts out with no input, I hope it sufficiently explains the limitations of the amp you've selected.
     
    Last edited: Jul 21, 2011
  14. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    Thanks!

    The 38k is actually a 47 and 220 in parallel. It was the closest I could get to having 3V out at the input.
    What would be a better (pin for pin hopefully?) replacement? NE5534AN or CA3140EZ? Something else?
    If I wanted to use this shunt to measure down to 1A, it would have to read 250uV. From what you have just pointed out, this would not happen and just be lost in the noise? Assuming it was all ideal, this would only give me 9.7mV on the output – my ADC can only measure 3.2mV (3.3/1024) so I might not be able to do it?


    Noted on what to do with the unused inputs – thanks.


    I’m still unclear on what to do (if anything?) for the pull-up?
     
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The NE5534 is not a pin-for-pin replacement (it's single vs dual opamp), requires a dual supply, and has a 0.5mV or higher input offset.
    The CA3140 has basically the same input offset specs as the LM358, requires a dual supply, and can't output more than Vcc-2v, so with a Vcc of 5v, 3v would be the maximum out voltage.
    Both opamp designs are pretty old.

    Even if you obtain a more modern RRIO opamp, it's going to be tough to get below ~10mV out without using a dual supply.

    Are you committed to using a single 5v supply for this project?

    Does the board already exist, and is that why you are looking for a pin-compatible replacement?
     
  16. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    the board exists in as much as it's a draft from vero board, everything soldered in place etc. I only expect it to live for a short while before I build V2 so if I had a better spec, I could make V2 in a month or so. Not a biggie.

    As for the dual supply, I'm not sure -
    it's all being run and powered from the Netduino (Arduino clone(ish)) which in turn is being powered from the 12V battery I am monitoring. The Netduino has an onboard 5V and 3.3V regulator. Cant see off hand what they can supply.

    I would like to keep this all contained (i.e. no extra plug in PSU) if I can however, not and exact requirement. Can I turn my 0-5 into a dual supply?
     
  17. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    And what op amp is this? The input offset current may be generating that voltage if the input current is in the 400 uA range. 400 uA * 220 Kohms * (1 + 38K/1K) = 3.4V

    Can you get a hold of a jack that shorts when the plug is removed? I dunno if they make em that way in that style, old style mic input jacks worked that way.
     
  18. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, the ICL7660 voltage converter can take a positive input (up to 10v) and create a negative output. Efficiency is extremely high; up to around 99.9%; around 95% with a 5k Ohm output load.

    One problem with converting voltages like this is adding noise to the environment. It's sort of like inviting a punk band to play at a library. The IC runs at ~10kHz, and the power rail and output will need a good bit of filtering to minimize the noise.

    As far as the input offset - you can subtract that error from the output of your ADC. If you feed the input 50mV, knowing that you have a gain of 39, and measure 2.05v instead of 1.95v out, you'd know that you have an input offset of (2.05-1.95)/39 = ~2.564mV, with a resulting 100mV offset from what it should be.

    Or, you could get an opamp with a very low input offset, and a very low input offset drift, like an LTC1052. It has a guaranteed maximum input offset of 5uV (microvolts), and a typical offset drift of 0.01uV/°C.
    Product page: http://www.linear.com/product/LTC1052
    Not cheap at around $5/ea, but eliminates a number of problems.
    Arrow stocks them for $5: http://components.arrow.com/part/detail/41303935S7108612N7433
    Digikey is a bit to proud of theirs at over $8/ea.
     
  19. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Wow, ErnieM - I think you missed replies after #8? :confused: ;)

    I think I've 'splained most of it already... but I think he really needs a different amp with better specs.
     
  20. Crispin

    Thread Starter Member

    Jul 4, 2011
    88
    2
    Thanks fellas,

    on V2 I'll stick all the new found knowledge in. Next week ;)
     
Loading...