Continue to Site

# Is possible to ADC the negative voltage by PIC16F87x?

Status
Not open for further replies.

#### Saboy

##### Newbie level 5
The input may be positive or negative. Is possible to convert this kind of voltage to digital by PIC16F87x?

as I know, bi-polar input ADC can do this. but PIC16F87x hasn't bi-polar input ADC.

Thanks!

Add an offset of Vref/2 to the input voltage.

can 16F87X use +2.5 to be Vdd and -2.5 to be Vss ?

Hi,

can 16F87X use +2.5 to be Vdd and -2.5 to be Vss ?

Well, technically no. But......remember, A micro (or any voltage device) only really cares about voltage difference, theoretically you could drive the micro with VSS: -10v and VDD: -5v. So its powered with a difference of 5v. The only reason they are negative voltages is to do with the reference, GND.

But, I wouldn't. Because, that would mean that the rest of your circuit (if its all referenced to GND) would make GND the equivelent of +10v to the micro, and a '1' in binary would be +15v. Both of which would probably kill the micro.

Many forget that voltage is potential difference, if both VSS, and VDD are the same voltage, even 10kv, and there is NO other reference available (like grounding from mains, enclosures) then no current will flow.

Anyway, back to the original post topic:

but PIC16F87x hasn't bi-polar input ADC.

XNOX_Rambo hit the nail on the head. Your incoming signal, is say -2 to +2v. All you need to do is bias it. That is, adding a DC component to 'cancel out' the negative part of the signal. In XNOX_Rambo's terms:
Add an offset of Vref/2 to the input voltage.

So, if your VREF is 5v. Then VREF/2 = 2.5V. -2v + 2.5v = +0.5v minimum input.
and +2 +2.5v = +4.5v maximum input.

And, if the range of your incoming signal is small, you can amplify it, or, if its too big (-10v to +10v say) you can attenuate it. All with an OPamp circuit, and a DC bias. You can sample pretty much anything with the PIC ADC, as long as the resolution and sample rate are possible.

BuriedCode.

Status
Not open for further replies.