• AVR Freaks

ADC and negative voltages

Author
cchermok
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2009/02/02 13:59:58
  • Location: 0
  • Status: offline
2009/02/23 22:48:44 (permalink)
0

ADC and negative voltages

Hi everyone,

I read in a similar post (http://forum.microchip.com/tm.aspx?m=405104) about a way to measure negative voltage values (of sine wave or whatever). 

However, I was wondering if a negative voltage on the input of the ADC would cause issues.  I want to measure the voltage of an AC signal and it will be negative at times.  I don't care if it is negative, because the information I want I can get in the positive portion of the signal.

If I don't care about the negative voltages, can I safely ignore adding a DC offset to the input of the ADC pin?  My assumption was that if there was a negative voltage the output would be "0", am I wrong on that?

I hope I don't need to do some redesigning. 

Thanks!

CoryC
#1

7 Replies Related Threads

    Kiwi Mike AZ
    Super Member
    • Total Posts : 2044
    • Reward points : 0
    • Status: offline
    RE: ADC and negative voltages 2009/02/23 23:05:02 (permalink)
    0
    The lowest min voltage that can be applied to a pin is in the data sheet.

     may be something like "Vss - 0.3V"

    Outside of the absolute Max/Min ratings you will most likely damage the micro-controller.

    You need to somehow limit (clip) your input signal so that it does not exceed this limit.


    e.g.   Series resistor from your signal source to a normally reversed biased Schottky diode that ties to GND, and another small resistor to the input pin.

    Attempt at an example using text art below....

    AC Source --[4K7]---+---[100R]--- Micro-controller pin
                        |
                       ---
                       / \ (Schottky Diode)
                       ---
                        |
                       ---
                       GND/Vss

                      

    Mike

     
    #2
    bugwhiskers
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2009/01/25 18:18:21
    • Location: 0
    • Status: offline
    RE: ADC and negative voltages 2009/02/24 01:06:59 (permalink)
    0
    Have a look at the following link.
     
    http://focus.ti.com.cn/cn/lit/an/sboa068/sboa068.pdf
     
    It converts a +/- voltage to all +
     
    regards
    bugwhiskers
    #3
    DSchabel
    Super Member
    • Total Posts : 1714
    • Reward points : 0
    • Joined: 2005/05/24 14:00:34
    • Location: Western NY State
    • Status: offline
    RE: ADC and negative voltages 2009/02/24 07:30:22 (permalink)
    0
    ORIGINAL: cchermok

    Hi everyone,

    I read in a similar post (http://forum.microchip.com/tm.aspx?m=405104) about a way to measure negative voltage values (of sine wave or whatever). 

    However, I was wondering if a negative voltage on the input of the ADC would cause issues.  I want to measure the voltage of an AC signal and it will be negative at times.  I don't care if it is negative, because the information I want I can get in the positive portion of the signal.

    If I don't care about the negative voltages, can I safely ignore adding a DC offset to the input of the ADC pin?  My assumption was that if there was a negative voltage the output would be "0", am I wrong on that?

    I hope I don't need to do some redesigning. 

    Thanks!

    CoryC

    You might be able to do this using proper protection, but be forewarned that if you are measuring multiple ADC channels, that there will be cross-contamination of the signals if the protection diodes on other channels are conducting. 
    #4
    cchermok
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2009/02/02 13:59:58
    • Location: 0
    • Status: offline
    RE: ADC and negative voltages 2009/02/24 12:29:41 (permalink)
    0
    Alright Mike,

    I'll bite on your idea. 

    Can you give me a rundown of how the added components will affect the signal seen at the input of the pin?

    I had never heard of a Schottky diode until this post.  Here is my interpretation of what you have here.  The diode will be like an open for positive voltages (to a point) and there will be the following scenario.

    AC Source ---[4K7]---[100R]-- Pin

    And when the voltage is slightly negative it will present the following scenario.

    AC Source ---[4K7]--|
                                 |
                                 |
                                ---
                                Gnd

    Which removes the Pic from the picture.  Correct me if I am wrong on this :).

    A quick question if I am to use this method.  The AC source has a different ground than Vss or AVss so I'm assuming I should use the AC ground for this.

    Thanks for your help!


    #5
    DSchabel
    Super Member
    • Total Posts : 1714
    • Reward points : 0
    • Joined: 2005/05/24 14:00:34
    • Location: Western NY State
    • Status: offline
    RE: ADC and negative voltages 2009/02/24 15:15:00 (permalink)
    0
    ORIGINAL: cchermok

    Alright Mike,

    I'll bite on your idea. 

    Can you give me a rundown of how the added components will affect the signal seen at the input of the pin?

    I had never heard of a Schottky diode until this post.  Here is my interpretation of what you have here.  The diode will be like an open for positive voltages (to a point) and there will be the following scenario.

    AC Source ---[4K7]---[100R]-- Pin

    And when the voltage is slightly negative it will present the following scenario.

    AC Source ---[4K7]--|
                               |
                               |
                              ---
                              Gnd

    Which removes the Pic from the picture.  Correct me if I am wrong on this :).

    A quick question if I am to use this method.  The AC source has a different ground than Vss or AVss so I'm assuming I should use the AC ground for this.

    Thanks for your help!

    Close, but not quite. 
    A shottky diode is similr to a "regular" silicon diode except that it has a lower "on" voltage, higher leakage (and a few other differences that don't matter much right now). 

    Your second drawing should look more like this:

    AC Source ---[4K7]---[100R]-- Pin
                               |
                               |
                              ---
                              Gnd

    ... meaning that the "Pin" will see "Gnd" (or nearly so; it will have about neagtive 0.3 to negative 0.5V at this point).

    Now, the extra leakage on the diode will also come into play with high resistance values, affecting your accuracy. 
    #6
    Kiwi Mike AZ
    Super Member
    • Total Posts : 2044
    • Reward points : 0
    • Status: offline
    RE: ADC and negative voltages 2009/02/24 16:40:16 (permalink)
    0
    The Schottky generally turns OFF (Recovers) a lot faster than a generic diode.... but the low voltage drop is the key.

    QUESTION: What is the voltage you are feeding into the PIC?  +/- 10V  +/-2V ???

    Your ground will need to be common to what you are measuring... otherwise you could very well have an offset voltage and potential ground loop issues.

    You could use an OPAMP circuit that gives you a balanced input, and does the clipping (Low side and high side) but that is more complex that the simple Resistor/diode/Resistor combo I showed prior.

    For Diode look at the BAT85 http://www.nxp.com/#/pip/pip=[pip=BAT85_4]|pp=[t=pip,i=BAT85_4][pip=BAT85_4]|pp=[t=pip,i=BAT85_4]

    Or surface mount BAT54A (Single) or BAT54S (Dual in series if you want to clamp min and max voltage)
    http://www.nxp.com/#/pip/pip=[pip=BAT54_SERIES_4]|pp=[t=pip,i=BAT54_SERIES_4][pip=BAT54_SERIES_4]|pp=[t=pip,i=BAT54_SERIES_4]

    Both of the above are about 0.5uA leakage current at 5V @ 25C
    If you used a 10K input resistor, this current would drop 5mV across it (10K/0.5uA=5mV)
    Lower resistor values have less effect but more current will flow when diode conducting.

    Also at low current it will conduct/clamp at a lower voltage, maybe 0.2V or less

    Give it a try, but note it is a very simple "Crowbar" type solution.

    Mike
    post edited by mimemike - 2009/02/24 16:41:56
    #7
    cchermok
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2009/02/02 13:59:58
    • Location: 0
    • Status: offline
    RE: ADC and negative voltages 2009/02/24 19:31:06 (permalink)
    0
    Hi Mike (et. al),

    The voltage that should be present on the pin will be a 1V AC sine wave.

    I am actually measuring the voltage of the common household 120VAC outlet (US).

    I do a voltage divider before the pin and had the configuration below previously.

    AC Source
       |
       |
       |
     [240K]
       |
       +---[100R]--- AN0
       |
     [2K0]
       |
       +---[100R]--- Vref-
       |
       |
    AC Neutral

    Given a high impedance for the pins then the voltage seen at AN0 is 120/121 V with respect to AC Neutral.

    I was looking at doing a Voltage follower opamp circuit with no negative power so the output would be between 0 and 1 V.  That gets a little tricky and would probably need a difference amp circuit too.

    If I can get this working with passive parts that would be good.  I also (briefly) considered doing a full-wave bridge to make negative positive and then correcting for the voltage lost.

    Thank you all for your help.  I will probably go with the diode solution.  Please let me know if that looks like a bad idea.


    #8
    Jump to:
    © 2019 APG vNext Commercial Version 4.5