measuring adc

Started by Tom De Weyer November 17, 2005

Is it possible to measure a voltage higher then 5v? I have a a signal which
is between 7.5V and 9V.

Tom De Weyer

--- In basicx@basi..., "Tom De Weyer" <tom.deweyer@u...> wrote:

> Is it possible to measure a voltage higher then 5v?

Yes use a voltage divider to reduce the voltage to the 5 v limit.

If the max is 9volts, then dividing the voltage in half works
conveniently. So, you could use two 2.2k ohm resistors between the 9
volt input and ground. You then could take the signal to the ADC from
between the 2 resistors.

By adjusting the ratio of the first resistor to the sum of the two,
you can adjust the voltage drop to anything you want.


--- In basicx@basi..., "Tom De Weyer" <tom.deweyer@u...> wrote:
> Is it possible to measure a voltage higher then 5v? I have a
> signal which is between 7.5V and 9V.

The BX-24 device itself is limited to measuring analog voltages in the
range of 0 to 5 volts. As Tony mentioned, you can used a voltage
divider to reduce the highest expected voltage to 5 volts or less.
With your signal range, you could divide by two and measure the
resulting range of 3.75V to 4.5V.

Although this simple solution will work, it "wastes" much of the range
of the ADC. Your application may benefit from shifting and scaling
the signal voltage so that it more closely matches the ADC range. For
example, since your signal has a variation of 1.5V you could multiply
it by 3 to achieve a signal variation of 4.5 volts. If you shifted it
in the negative direction by 7.5V before amplification, you'd have a
signal to feed the BX that varies from 0 to 4.5 volts.

There was a thread about a month ago that addressed this same issue:

Don >
> Thanks,
> Tom De Weyer
> Belgium >

I just finished doing this sort of thing in a PIC project I am working on. You should be able to compute the proper resistor values using:

VA2D = VBAT * R2/(R1+R2)

where VA2D is the voltage seen by the A2D input coming from the junction of R1 and R2, VBAT is the value of the input voltage. R1 is the resistor coming from VBAT to R2 with the other side of R2 going to ground. I believe this is a classic resistive voltage divider. Using 2.2K resistors, as suggested, gives a VA2D of 4.5 volts when VBAT = 9.0V.

My VBAT was 12V and R1 = 8k and R2 = 4K. The calculation of VA2D is left as an exercise for the reader ;>{ )



Victor Fraenckel - The Windman
victorf ATSIGN windreader DOT com

I read Don Kinzer's answer to your question, and His is quite
complete and has the reference to the previous thread.

My suggestion for the simple voltage divider is only good if your
input voltage varies from zero to some voltage (higher than the
operating voltage of the BX).

If the input voltage varies over a more limited range (e.g. 7 to 9
volts only, and never below 7), then there WILL be a considerable
sacrifice in resolution.

The previous thread tells how to approach that issue.

The thread as shown did not include my reply, which may have been a
reply to a reply... I had suggested a rail-to-rail op amp. Most
operate on + and - voltages, but some will operate on signle-sided
power supplies.

Then you can use a pot to adjust the offset of the output so that
the minimum input voltage results in a zero output. Then you can
adjust the gain so the maximum input results in the desired high
output (5 volts). In this manner you will get a reasonably linear
output over a reasonable frequency range. I think it is more
complicated than some of the pute resistor networks, but is
adjustable on the fly if you use pots.