Pic adc

Thread Starter

solpic

Joined Jul 23, 2009
25
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
 

rjenkins

Joined Nov 6, 2005
1,013
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.
 

Thread Starter

solpic

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

russ_hensel

Joined Jan 11, 2009
825
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.
 

THE_RB

Joined Feb 11, 2008
5,438
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. :)
 

azuari_86

Joined Oct 31, 2009
3
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
 
Top