Pages: [1]   Go Down
Author Topic: TMP36 (LM335) vs DS18B20  (Read 3566 times)
0 Members and 1 Guest are viewing this topic.
Ukraine
Offline Offline
Full Member
***
Karma: 2
Posts: 192
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good day!

I'm building a trivial digital thermometer project, but adding some things to it to make it more fun smiley

The project is battery powered and builded around ATmega8 chip. I have two options for sensors (I need two of them):

- Analog TMP36/LM335 -- they are easier to use (just read from ADC), but what to do with AREF? MCU is powered from 3 AA batteries, so reference voltage will be not stable.

- Digital DS18B20. More advanced, require more programming, but seems to be self-contained and callibrated.

Is it possible to use TMP36 with battery powered project?

Thanks!
« Last Edit: November 28, 2010, 04:05:42 pm by artvolk » Logged

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

As far it goes for DS18s20, look at
http://stuff.nekhbet.ro/2009/08/23/how-to-use-the-ds18s20-and-ds18b20-temperature-sensors-with-arduino.html
and ongoing topic about  protecting it from moisture
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1290802591/7#7

Good point to DS18s20 would be that  u dont have to worry about supply voltage droping over time, the datasheet says it works down to 3V. The bad thing here is that the program on that page takes up to 5310bytes, u could make it a bit less, but not much. 1 good point is also as u need 2 sensors you will need just 1 input for both sensor, but i dont think that rly mathers to you smiley-sad

Quote
- Analog TMP36/LM335 -- they are easier to use (just read from ADC), but what to do with AREF? MCU is powered from 3 AA batteries, so reference voltage will be not stable.
I didnt work with those 2 yet, because the local suplier doesnt have them. If u have to measure only positive temperature then pick LM35DZ. Why?
Because its easy to use...
Take a look at code and there are some interesting coments as to what to do with the analog value.
http://www.danielandrade.net/2008/07/05/temperature-sensor-arduino/
http://pscmpf.blogspot.com/2008/12/arduino-lm35-sensor.html


In ur case as they measure negative volatage and because of that u have offset voltage and diffrent voltage range not like the LM35DZ which has 0-1V for 0-100 degrees Celsius and because of that u can even pick internal referece volatage of 1.1V.
But the links do explain how to use the analog reading u just have to change it, so it suits you.
Btw i am sure there are plenty examples with TMP36 if u google it up.
Logged

Ukraine
Offline Offline
Full Member
***
Karma: 2
Posts: 192
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the responses. Topic about protecting DS18B20 is also mine smiley

About size of one wire code for DS18B20 -- yes, I use ATmega8 and this is an issue.

What about using internal reference voltage will it work from batteries? I've found example in the comments to posts you mentioned, I need to check ATMega8 datasheet it reference voltage as far as I remember is different from ATmega168 and ATmega328...

update:

http://www.arduino.cc/en/Reference/AnalogReference
Quote
# INTERNAL: an built-in reference, equal to 1.1 volts on the ATmega168 or ATmega328 and 2.56 volts on the ATmega8 (not available on the Arduino Mega)
« Last Edit: November 29, 2010, 07:02:27 am by artvolk » Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Digital DS18B20
Check out this library for the DS18  http://milesburton.com/index.php/Dallas_Temperature_Control_Library Works very well, with the onewire interface you can add up to 127 devices on one communication line costing you 1 I/O pin for all your temp needs - my max is 6 temp sensors simultaneously, worked very well.

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8472
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try the LM74, it seems happy with 3-5v and has a simple SPI-style interface.


______
Rob

Logged

Rob Gray aka the GRAYnomad www.robgray.com

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

Quote
Topic about protecting DS18B20 is also mine
My bad didnt look at the topic starter.

I looked at the LM335 and looks prety simple. it has an output 10mv/K.
so 0V is 0K or -273 degrees
2.73V is 273K or 0 degrees
Now the sensor should be calibrated and used as shown in datasheet. Its beeing calibrated at 25 degrees and should have once calibrated 2.98V

As far it goes for analog reading u have to multiply analog value with 5 and then divide by 1024
At this point u get voltage value on analog pin.
Now u multiply everything by 100 or divide by 0.01 (10mV) to get value in Kelvin, if u want value in degrees Celzius substract by 273

Personaly i would use the DS cause it uses digital communication and is therefore less subject to outside interferance.
And as someone mentioned u can use multiple of them on just 1 pin.
The only problem with DS as mentioned before is program size as ur using atmega8.
« Last Edit: November 29, 2010, 09:59:08 am by GregaG87 » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8472
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The only problem with DS as mentioned before is program size as ur using atmega8.
That's why I mentioned the LM74, it's digital like the DS but has a simple two-wire interface that you could do with about 5 lines of code.

I haven't used one yet, just going on the data sheet but it looks very simple.
______
Rob

Logged

Rob Gray aka the GRAYnomad www.robgray.com

Ukraine
Offline Offline
Full Member
***
Karma: 2
Posts: 192
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you all for the responses, unfortunatelly I can't find LM74 from local suppliers, so for now I have one DS18B20 and two TMP36 to play with smiley

The code size is an issue for me, cause I use ATMega8. OneWire library didn't fit into the chip, but this example is smaller: http://sheepdogguides.com/arduino/ar3ne1tt.htm

Logged

Pages: [1]   Go Up
Jump to: