PDA

View Full Version : How to use Vref



d1camero
- 5th April 2004, 05:26
Hello, I am new to uProcs, but most is going well (I can light LEDs, measure temp, measure voltage and do serial communications).

I am a little confused about using Vref for AD converters (specifically 12F675). Is Vref supposed to be the upper end of the measurement or the lower end (i.e. an offset).

E.g. I want to measure from 10-15volts. The ADC can measure between 0-5 volts. So I put Vref to 10volts. Yet this cannot be right, because if I want to simply measure 0-5v, I make Vref = Vdd = 5v.

help?

thanks
d1

anj
- 5th April 2004, 06:04
Gday D1
Some chips allow you to set Vref+ and Vref-, and as long as the delta is less than the pics supply voltage yr sweet, but you cant do that with the 675.
With the 675, you only have Vref+ or Vdd for the top of the AD range. The bottom is always Vss.
To do what you want with a 675, yr best bet is to power the ADC from Vdd, and bring the input voltage down using a voltage divider. Then multiply the ADC reading to get yr actual voltage. May need a little calibration but thats easy to do.
Andrew

d1camero
- 5th April 2004, 07:59
I am stretching my electronics knowledge here, but can I use an OpAmp or some analog circuit to subtract a base voltage from the voltage to be measured?

thanks
d1

Melanie
- 5th April 2004, 12:20
Don't go overboard here... a simple two Resistor Potential Divider will suffice - use 1% tollerance (or better) parts.

Eg... For a simple Divide by 2... R1+R2 can be say 2K2 each, connected in series. Top end of R1 goes to your voltage to measure (input), bottom end of R2 is connected to Vss. The junction of the two is connected to your PIC. Now, 0-10v on the input will be 0-5v at the PIC. With VRef+ configured at +5v Vdd, your ADC will be measuring 0-10v because you have scaled it down.

Melanie