Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Voltage divider with offset

  1. Nov 13, 2016 #1
    I'm working on an Arduino project to read automotive battery voltage,.. I could use a simple resistor divider circuit, but I'd lose a lot of resolution (you aren't going to see <8V very often)..
    Could anyone take a look at this and tell me if it's a reasonable method?..

    Channel A (Blue) is 5V/div
    Channel C (Red) is 10V/div
    Frequency is 1khz, which is plenty fast enough for what I need

    It seems to have good linearity from 10-20V, I will use a multiturn trimpot for R3, 1/4W metal film resistor for R1
    It should give me a resolution of about .015V in the working range, I'm fine with that.
    Is there anything I'm missing that could come back and bite me in the arse?

    Voltage divider with offset.jpg
     
  2. jcsd
  3. Nov 13, 2016 #2

    Averagesupernova

    User Avatar
    Science Advisor
    Gold Member

    I don't think a zener diode is precise enough to do what you want. Temperature changes will bite you in the butt. You could use a precision reference or a plain old voltage regulator and feed an op amp with both the reference and the divided down sample voltage for a differential amplifier. Set the gain of the amp so you get the range you want. I suppose the alternative would be to use the zener but run it pretty hot to minimize external temperature effects. You will obviously not be using resistor values that you have chosen and will be wasting some power. There are some precision references that are used in circuit similar to a zener diode. That could also work depending on whether or not they are available at the offset you need. If you want a true offset you cannot have the pot where you have it placed when using a zener type device. It will not only have offset but will form a divider. When you dial the pot to correct for the offset you have also changed the ratio of the voltage divider.
     
  4. Nov 13, 2016 #3
    Thank you, exactly the kind of bite-my-arse things I wanted to know about...
    In this instance I can afford to put some power through it, I changed R1 to 57Ω and trimpot to 100Ω fixed resistor.. This yields about the same curve, but increases the current through D1 to about 200mw average and 50mA

    I'm really limited for space for breadboarding this together, which is part of the reason I am trying to keep component count down.
    How drastic would the temperature change this? It's primarily for display purposes, though in the distant future it could be for charge control as well, Is the penalty of decreased resolution (20V/1024 = 19mv) from a plain resistor divider going to pay off in thermal stability? It's kinda looking like it to me (and the bonus of even simpler)
     
  5. Nov 13, 2016 #4
    I tried referencing the lower leg of R3 to ground instead of the wiper, but what I found was it really affected the linearity in the lower range
     
  6. Nov 13, 2016 #5
    Here, Is this more like what you had in mind @Averagesupernova ?
    Voltage divider with offset OpAmp.jpg

    The 2.5V supply would actually be an LT1004-2.5V bandgap reference diode which I just happen to have, though I don't have a model for it http://cds.linear.com/docs/en/datasheet/1004fb.pdf
    The op amp I would use is a very linear OP77FP, 140dB gain, 130db CMRR/PSRR (I happen to have some)
     
  7. Nov 14, 2016 #6

    Averagesupernova

    User Avatar
    Science Advisor
    Gold Member

    That looks about right. Set R5 so that the middle of the range you want to measure will put 2.5 volts on the non inverting input. Set R1 to put the range you want to measure within the useable range of the op amps output. Once you have everything dialed in, get rid of the pots and use fixed resistors. Use precision if you think you need them.
     
  8. Nov 14, 2016 #7

    rbelli1

    User Avatar
    Gold Member

    The difference in price between 5% and 1% is so small just go for the 1% ones. Even though they are almost double the price they are pennies either way. Unless of course you are making this in bulk. Then it will be a consideration.

    BoB
     
  9. Nov 15, 2016 #8
    They're so cheap I bought a 1500pc metal film 1% just to have them in stock. I'm not planning on making this in bulk
    Thanks for the advice
     
  10. Nov 15, 2016 #9

    berkeman

    User Avatar

    Staff: Mentor

    Important Tip -- it is bad design practice to have the wiper of a potentiometer go into the input of an opamp.

    Quiz Question -- Why? :smile:
     
  11. Nov 15, 2016 #10

    berkeman

    User Avatar

    Staff: Mentor

    Quiz Question #2 -- What value of Zener diode has almost zero tempco? :smile:
     
  12. Nov 15, 2016 #11
    I'd love to know the answer to both!

    For #1, I can take a stab at it.. If the wiper would somehow fail, it would leave the op-amp input floating?
     
  13. Nov 15, 2016 #12

    berkeman

    User Avatar

    Staff: Mentor

    Nope, but it's not an obvious point at all. I learned the reason many moons ago after I had a potentiometer circuit like yours fail after working fine for over a year. Turns out that potentiometers have a minimum wiper current that is required to keep the contact from corroding. The minimum current is often over what is drawn by opamp inputs (especially FET opamp inputs). Here is the place that I finally found that described:

    http://www.bourns.com/docs/default-document-library/bourns_trimmer_primer.pdf

    And on #2, try doing a Google search on Zener Diode Tempco and see what the graphs or tables say... Turns out the Zener value with the minimum tempco is just about what you need for your battery offset circuit... :smile:
     
  14. Nov 15, 2016 #13
    Good read, and I'm going to have to keep it handy for reference.. So from what I see in there my shot in the dark was pretty accurate.. connecting to the wiper alone could cause a floating and unpredictable failure where the output of the op amp could damage downstream devices

    I've found something from Micro Semiconductors on Zener tempco.. I'll read it in a bit and study it, and see how temp drift would affect me in this instance
     
  15. Nov 15, 2016 #14

    Baluncore

    User Avatar
    Science Advisor

    It depends on the manufacture and material, but silicon is usually quoted at about 5.5 volts.
    The problem comes in specifying the reverse current used to characterise the zener voltage and the current then used to operate the diode in a real circuit.
     
  16. Nov 15, 2016 #15
    So if temperature stability were your goal (more than cost), you'd be better to get a 15V Zener by putting 3x 5V Zeners in series, or a 2x 3V and a 10V depending on the thermal characteristics.. Is that ever done?
     
  17. Nov 15, 2016 #16

    Baluncore

    User Avatar
    Science Advisor

    Not often used. Better to use a zero tempco current from a TI REF200 or an LM334 current reference with a diode.

    If you want for example, a B+ range from 10V to 15V with full resolution, then you must subtract 10V from B+ and use the 0 to +5V range of the A-D converter.

    But, you may have some flexibility with the Vhi and Vlo reference points of the microcontroller's A-D converter.
    Say you use a 1:3 ratio attenuator made from three identical resistors. When B+ = 15V you will have +5V to the converter. When B+ = 10V you will get 3.333V to the A-D converter. If you then use Vhi at +5V and Vlo at +3.333V you have the extended range with full resolution.
    Depending on the impedance of the A-D converter reference inputs, you may produce the 3.333V by using another three identical resistors.
     
  18. Nov 16, 2016 #17
    Now we're going far more into this than I think is necessary for the particular application, but I'm learning a lot and enjoying it....
    With many A-D convertors, you can't set the Vhi and Vlo for individual inputs, perhaps for a bank (or all) of them it's possible.
    Many controllers also have a regulated 3.3V pin as well as the 5V supply, for simplicities sake you could maybe use that as an alternate reference point. I think in most cases you're probably best off pulling the 5V reference power from the microcontroller power (since it's usually linked to that analog Vhi reference), so that changes in supply power are compensated in the ADC.. As for the V-lo pin, Would that usually be called A-Gnd? I'm not sure if all microcontrollers like to have that pin at a significantly different voltage than the rest of the grounds. I do like the idea of it though.. Some controllers have a differential analog input that you could use for the resistor bridge you mentioned as well.

    I mentioned the LT1004 reference diode earlier because I have several, they're available in 1.200V and 2.500V
     
  19. Nov 16, 2016 #18
    I've been poring over that Bournes pot tutorial posted earlier.. I'm at a bit of a loss at how to avoid connecting the wiper directly to the op-amp when you need a voltage divider... I've gone through my circuit and added another op-amp, and a few other things..

    U1A controls the response slope alone, not perfect, but it's fed by a 6.8V limited supply, which clips the output around 5.3V, giving the microcontroller a fighting chance if someone messes up while adjusting. (like that would ever happen)
    U2A controls the offset voltage alone, the 1.2V reference is a battery in this case, in reality it'll be the 1.2V LT1004 or similar reference

    I'll be able to tweak the trimpot values a little with external resistors
    Voltage divider with offset OpAmp x2.jpg
     
  20. Nov 16, 2016 #19

    berkeman

    User Avatar

    Staff: Mentor

    It looks like you've fixed the trimpot issue. :smile:

    I'd be inclined to do this simply with a 5.1V Zener diode (hint-hint) as the reference, and a voltage divider with 1% resistors for the other side of the differential subtraction opamp stage. Sorry if I missed it in your posts -- what is your desired accuracy? And can you just calibrate it a bit in your uC code?
     
  21. Nov 16, 2016 #20
    Yes, the code would certainly have to re-map the values, which is trivially difficult.
    Here's what I consider "as good as it needs to be" for my purposes... 7-17V full scale with decent linearity, full clipping at 5.1V.. I changed the final op-amp to a higher quality one and it really helped the linearity.

    I might just be getting the hang of this!

    Voltage divider with offset OpAmp x3.jpg
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Voltage divider with offset
  1. Voltage Dividers (Replies: 1)

  2. Voltage divider (Replies: 4)

  3. Voltage divider (Replies: 15)

Loading...