Pages: [1]   Go Down
Author Topic: ADC: measuring negative voltage?  (Read 2345 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there,

I wasn't sure to post this in this section. I searched for the term and I didn't found useful information so I hope that this post is not repeated.

Also before post I read the Analog to Digital conversion part of the atmega168 datasheet and it says literally that input range is 0v - 5v.

I'm not an electronic engineer so don't be rude smiley-razz

I successfully wrote a program to the freeduino that uses an LCD and four 7-segment-displays to "measure temperature" from a LM35DZ sensor (http://labombiya.com.ar/images/DSC01066.JPG).

Actually, that value it's not converted. I also read the libraries docs, and I already know that the integer value returned from analogRead() it's ranged from 0 - 1023 with aprox 4.9mV per unit.

I'm aware of all what software concern but I'm disabled of the hardware part smiley-sad Maybe I'm missing a hardware-trick to scale the voltage so -55mV will be 0mV and units will be changed.

LM35DZ is not capable of measuring below zero degrees, or at least that was what I read in a datasheet, but a professional friend mades me a schematic that it would be possibly to extend the low-end range of the sensor (http://labombiya.com.ar/images/temp.jpg).

(Don't look at the sch chip, it was illustrative from the autor with the caps too)

The thing is, if I get from ADC2 negative supply...what actually happens? I mean, datasheet says that the ADC input voltage range is 0v to 5v, and lib docs says that analogRead() returns an integer from 0 to 1023. Will analogRead() reads a value? Can I damage the input pins?

To be more abstract. Forget about my specific situation and think about a lm35 with full range configuration. That is, -55mV to 1500mV. As datasheet says, -55ºC to 150ºC. Seems the trick remains in making the scale, for instance, 0mV - 1555mV, being 0mV the low-end range, -55ºC. Am I wrong? I can't ask my friend he's busy on another things and he already helped me a lot. So I try not to bother him right now.

I'm testing empirically anyways. I recent put the lm35dz in a ziploc bag into the freezer. I'll watch for the results later on.

Thanks for your help, and btw, i didn't want to post in my previous post because the discussion was not directly related with my doubt.

Have a nice burning! xD
lapacho


Logged


Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 5
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

you can use an opamp to add a small voltage to the voltage coming from the sensor. This will also ad to the positive voltage, but you can deal with that i software.
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 0
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You could also set up an op-amp as an inverting amplifier, so that negative voltages are inverted into positive voltages.  You'll need to arrange for a negative power supply for the op-amp, in either case.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks! I made the measuring with a multimeter and indeed Vout goes below Vss. The differences of this two (with the above schematics) it's the true temperature. So, my friend's trick works! smiley

Thanks for the tip with the opamp to both of you I'll gather info about it smiley

See ya!
lapacho

EDIT: viewing my stock I found a LM358 i'll use it as op-amp.
« Last Edit: January 09, 2009, 02:50:36 pm by lapacho » Logged


Tacoma
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It sounds like you found a solution (maybe), but I'm curious.  Are you actually going to measure temperatures near 55 below freezing?  I don't know anything about this specific sensor, but it would seem to me that unless you're going below -40 C, you have nothing to worry about.  I assume that the bottom of the voltage range corresponds to the bottom of the temperature range.  Your freezer should be about 0 C.  55 below freezing is FRIGGIN COLD!  According to xkcd, spit goes clink at -40 C.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

lol!

Actually, i'm not going to measure that cold. But, the geographic site where I live sometimes temperature goes up to -20ºC. Winter, of course, so if lm35dz is not capable of measuring below 0ºC then it's useless for me. Actually, freezer was -119mV smiley 11.9ºC.

That's why I need to rise the current range so I can measure that with the freeduino analog pins. I made the test with a multimeter and with the sensor IN the freezer hanging wires because as soon i took it out the temperature rise a very high speed. Then I put the displays board and the result of that pin (Vout) was 0 (the integer zero I think, because when I open the door and the sensor started to get warmed the displays started to show values from that pin.

I'm reading textures of non-inverting amplifiers. I got a KA393 comparator and the LM358, so I think I could diagram one with one of them....let's see how good I am understanding smiley

best regards,
lapacho
« Last Edit: January 10, 2009, 12:10:29 am by lapacho » Logged


Pages: [1]   Go Up
Jump to: