1. solpic

    Thread Starter Member

    Jul 23, 2009
    25
    0
    Hello everyone,

    I was just wondering, what happens when you measure a voltage with the PIC ADC that is higher than than 5V? I would try this but I don't want to destroy my PIC if it does destroy it. I know in the documentation it says not to do this. Also, does whatever happens apply to any ADC or just to the PIC ADC?

    Thanks
     
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    How much voltage? Use a resistor divider.
     
  3. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    Different chips have different ranges, but you typically limited to about 10V or so.

    As blueroomelectronics says above, for anything higher you just use a voltage divider.
    For anything lower, if you do not get adequate resolution, boost it with an opamp to get near the range of the ADC.

    It is also a good idea to put a small capacitor at the ADC input (to 0V) as it can draw a small amount of current during the sample period. This can cause some level of errors in the reading with just resistors at the input.
     
  4. solpic

    Thread Starter Member

    Jul 23, 2009
    25
    0
    I was wondering what would happen if you went over the range. Would the chip break or would it read random values?
     
  5. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    Possibly break, you are over the spec. limit. A protection diode may draw current to lower the voltage and depending on source impedance may or may not protect the chip.
     
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    When you are over the input range the PIC pin protection diode clamps the voltage at about 5.5v. The ADC reads the maximum count (1023) because the ADC works by successive approximation so any reading >1023 reads = 1023.

    The PIC won't be harmed if you are not putting more than 20mA into the pin protect diode.

    It is out of PIC spec and not advised unless you know what you're doing. :)
     
  7. azuari_86

    New Member

    Oct 31, 2009
    3
    0
    it easy, you just need the voltage divider technique.for example, if the input votage 12V max, the R1= 10k and R2=7.2k, the max voltage produce at R2 is 5V.if you want to measure less that 12V the calulation is needed.refer to the electric circuit law
     
Loading...