Searching \ for '[EE] Beginner A/D Conversion Question' in subject line. ()
Help us get a faster server
FAQ page: www.piclist.com/techref/io/atod.htm?key=a%2Fd
Search entire site for: 'Beginner A/D Conversion Question'.

Exact match. Not showing close matches.
'[EE] Beginner A/D Conversion Question'
2007\03\30@030107 by

Hi,

Here's my problem.  I've got a sensor (I didn't get to pick it, so I'm
stuck with this) which outputs a voltage between -3.6 and +3.6 volts.  The
voltage correlates to the orientation angle of the sensor.  Zero voltage
indicates that the sensor is level.  The angle from zero is reported as a
voltage (60 mV/degree).  Although angle measurements out at the voltage
limits are interesting to me, I'm most interested in getting good voltage
readings when the sensor is near zero degrees.  I figure a 14 bit A/D
converter will get me the resolution I need, as long as I scale the sensor
voltage to relatively near the full scale range of the converter.

So here's my question/problem.  I don't know how to handle the negative
voltage with an A/D IC.  I know it is possible to read it (for example, an
Omega Digital Transmitter can read it), but I haven't been able to find any
sources (electronics textbooks, web searches, etc) that can tell me how to
design my own circuit to process this voltage when it goes negative, as all
the converter data sheets I've read only allow one to convert a voltage
between ground and Vref.. There's got to be a simple solution to this
problem, but my EE class is about 20 years in the past, and I've had no luck
tracking down a beginner book which clues me in.

Can anyone help a clueless newbie out?  I'm not looking for a complete
solution, just some pointers to get me going in the right direction.  If
anyone has an electronics primer book they'd recommend, I'd be interested in
the title of that too!

Thanks,

Andy

>    So here's my question/problem.  I don't know how to handle
> the negative voltage with an A/D IC.  I know it is possible
> to read it (for example, an Omega Digital Transmitter can
> read it), but I haven't been able to find any sources
> (electronics textbooks, web searches, etc) that can tell me
> how to design my own circuit to process this voltage when it
> goes negative, as all the converter data sheets I've read
> only allow one to convert a voltage between ground and Vref..
> There's got to be a simple solution to this problem, but my
> EE class is about 20 years in the past, and I've had no luck
> tracking down a beginner book which clues me in.

acn't you raise the ground of the sensor, maybe just a litte? If you can
afford to waste some of the A/D's bits you might get by with just a
series diode in the ground path of the sensor. Do an A/D reading on that
raised fround first, then read the sensor output, and compare.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu

>    ... sensor outputs ... -3.6 and +3.6 volts.

>    I don't know how to handle the negative voltage with an A/D IC.

> ... There's got to be a simple solution to this problem, ...

Fortunately, there is.

> I'm not looking for a complete solution, just some pointers to get me
going in the right direction.

So - standard differential op amp / or summing opamp circuit will do what
you want. A bit of Googling on that area will turn up something useful.

Say for example that your ADC has a 0-+5 VDC range. You presently have a
7.2V range. You want to scale this by a factor of 5/7.2 = 0.694r and offset
the mid point by +2.5V. You will find that you can do this with a single
opamp and some resistors.

If you only want a general indication away from zero you could have a
circuit which level translates but actually has GAIN rather than loss so the
ADC allows you to inspect the region around zero more closely. You can then
clamp the excursions as they approach the outer bounds either with diode
shaping, clamp zeners, or just letting the opamp run out of voltage swing.
The output then gives you a general indication of which way the tilt goes
for large erors but precion results near zero.

This could let you use a far less accurate ADC - possibly a 10 or 12 bit
in-processor type allowing lower cost. Or you could use a slower LOW COST
Sigma Delta software driven converter converter if you want accuracy and
speed's not too critical.

If 14 bits is OK for full range the 10 bits gives you 1/2^(14-10) = 1/16th
of the range.
Full scale is by your report 3.6V / 60 mV = +/- 60 degrees so 10 bits gives
you about +/- 4 degrees with the same accuracy. 12 bits about +/- 15
degrees.

Russell

>>    ... sensor outputs ... -3.6 and +3.6 volts.
>>
>>    I don't know how to handle the negative voltage with an A/D IC.
>>
>> ... There's got to be a simple solution to this problem, ...
>
>Fortunately, there is.

Agreed

>> I'm not looking for a complete solution, just some pointers to get me
>> going in the right direction.
>
>So - standard differential op amp / or summing opamp circuit will do what
>you want. A bit of Googling on that area will turn up something useful.

Personally I would look at an ADC that takes negative voltages. One I have
had contact with is the Linear Technology LT1414 which is 14 bits, but
parallel interface. Requires +5 and -5 supplies, and input range is +/-2.5V.

I am sure that if you go digging around the Linear Technology or Analog
Devices web sites you could find some 14 bit adc that have serial interface,
if this is more useful. A quick scan at LT indicates the LTC1858 might suit,
with SPI interface. Had a quick look at the data sheet, single 5V supply, 8
channel mux, various options for input ranges (0 to 5, 0 to 10, -5 to
+5, -10 to +10), also has 12 bit and 16 bit versions, 100ksps, but it is a
29 pin SSOP package. Looks like it can also be run as 4 differential inputs,
or a mix of differential and single ended. If that doesn't suit, check the
"related parts" table at the end of the data sheet.

Another nice thing about LT is they will sample with no questions asked. My
recent experience with AD is they kept following up, but it was an expensive
device I asked for (around US\$30).

part 1 2689 bytes content-type:text/plain; (decoded quoted-printable)

>-----Original Message-----
>From: piclist-bouncesmit.edu [piclist-bouncesmit.edu] >On Behalf Of Andrew Shearon
>Sent: 30 March 2007 08:01
>To: piclistmit.edu
>Subject: [EE] Beginner A/D Conversion Question
>
>
>
>   Can anyone help a clueless newbie out?  I'm not looking for >a complete solution, just some pointers to get me going in the >right direction.  If anyone has an electronics primer book >they'd recommend, I'd be interested in the title of that too!

For a generic level shifting circuit you are often better off using an op-amp as described in other posts, but you can perform simple level translation with just two or three resistors with some limitations:

1)Being a passive circuit you can not apply over-unity gain, i.e. you will always lose voltage swing rather than gain it.  In your case this is exactly what you require.

2) If there is ever a possibility that your input could exceed the design range you will need to provide some clamping for your ADC input.  An op-amp running from a single rail automatically provides this protection.

Consider the attached circuit.  With the sensor output at -3.6 volts, the voltage at the junction of R1 and R2 is:

Vin + ( Vcc - Vin) * (R2 / (R1+R2)) = Vout

-3.6 + (5 - -3.6) * (3k6 / (3k6 + 5k)) = 0v

With the sensor outputting +3.6v, the voltage at the junction of R1 and R2 is:

3.6 + (5 - 3.6) * (3k6 / (3k6 + 5k)) = 4.186v

So your -3.6v to +3.6v input has been translated to an output of 0v to 4.186v.  The upper number looks very inconvenient, but you could either use a 5v reference and accept some loss in dynamic range, or you could use a potential divider to derive a reference voltage of 4.168 from a 5v reference which would restore the full range of the ADC.

I'm not suggesting this is perfect for your design, but it's shows how simply this problem can be solved without needing to us any active components.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

part 2 1915 bytes content-type:image/gif; (decode)

part 3 35 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)

> you can perform simple level translation with just two or three
> resistors

Same principle as the solution for [EE] Measuring negative voltages
earlier this month (3rd). A good solution for a specific circumstance

Andy,

Bias the voltage into the A/D with an Op amp so that at zero degrees, the
A/D sees 3.6 volts.  That will translate the 0  to  -3.6 volts as 3.6 to 0,
and 3.6 to 7.2 will represent 0 to 3.6 volts.

Regards,

Jim

{Quote hidden}

> --
On Fri, 2007-03-30 at 00:01 -0700, Andrew Shearon wrote:
> Hi,
>
>
>
>    Here's my problem.  I've got a sensor (I didn't get to pick it, so I'm
> stuck with this) which outputs a voltage between -3.6 and +3.6 volts.  The
> voltage correlates to the orientation angle of the sensor.  Zero voltage
> indicates that the sensor is level.  The angle from zero is reported as a
> voltage (60 mV/degree).  Although angle measurements out at the voltage
> limits are interesting to me, I'm most interested in getting good voltage
> readings when the sensor is near zero degrees.  I figure a 14 bit A/D
> converter will get me the resolution I need, as long as I scale the sensor
> voltage to relatively near the full scale range of the converter.

Neat, offhand I'd use an dual rail op amp to scale the range you'd like
doesn't see anything outside it's range.

What specifically you need depends on:

- what range of the sensor are you interested in sensing
- at what frequency do you need to read the sensor
- what voltage rails do you have available to you

TTYL

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...