Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

my lm35 temperature gadget

Status
Not open for further replies.

skmdmasud

Member
Hi I am doing a room thermometer using lm35 and atmega8. For ADC ref I need 5v but my regulator lm7805 gives 4.90v. Lm35 says 10mv for 1C so if I add 1C to my result will it be OK. What other option do I have?
Regards
 
Get a better regulator? Adjustable regulator (LM317)? Do some math; ADCvolts = 4.90*ADCreading/1024 instead of 5.00*ADCreading/1024 (assuming 10bit AD).
 
it: 1214692 said:
Get a better regulator? Adjustable regulator (LM317)? Do some math; ADCvolts = 4.90*ADCreading/1024 instead of 5.00*ADCreading/1024 (assuming 10bit AD).
I was thinking something like a multiplier or calibration in the software
 
Get a better regulator? Adjustable regulator (LM317)? Do some math; ADCvolts = 4.90*ADCreading/1024 instead of 5.00*ADCreading/1024 (assuming 10bit AD).
I guess this will work

If the full scale reference voltage VDDA is 5V, then the result you would expect from converting a 2.5V input with a 10-bit ADC is: (2.5/5)*1023 = 511.5. So we would expect 512 as converted digital value by ADC.

If the reference voltage is 4.9V the conversion result for 2.5 will be: (2.5/4.9)*1023 = 521.9 So we will get 522 as converted result.
This means that with a lower voltage reference (4.9V) than the ideal voltage reference (5V), the ADC will report higher results. So each result should be adjusted by multiplying it with the calibration constant. So the calibration constant will be (expected value)/actual value = 512/522 = 0.98 Calibrated ADC result = (calibration constant)*(actual digital result).
 
I would suggest that you looks at digital output temperature sensors.

3 wire sensors are the easiest to programme for. Enable the chip and it outputs the MSB. Each clock pulse gives you a new data bit. Disable the chip and it goes back to the start, so you don't need to read in 8 bit sections. Examples include LM71 and LM74. If you are using multiple ones, each needs a separate enable line.

2 wire sensors are a bit more difficult to programme for, as they need to be sent the address first by the microcontroller, but a wire is saved. If you are using multiple ones, you can usually have 4 or 8 on a single pair of wires. Examples include LM75, LM76 and LM77.

1-wire sensors don't even need a separate powers supply, just signal and ground. The programming is quite a lot more difficult, as they need to be addressed, told to read the temperature, supplied with power, left to read the temperature, reset, addressed and asked the temperature. If you are reading multiple temperatures, you can read as many as you want on one wire, although you do have to have a way of working out which one is which. Dallas make these, and the DS18B20 is the usual one.

Whatever you chose, they all allow you to read the temperature digitally, without worrying about mV of reference voltage variation. Most work over wide voltage ranges, and are generally just as easy to use as a stand alone ADC.
 
I would suggest that you looks at digital output temperature sensors.

3 wire sensors are the easiest to programme for. Enable the chip and it outputs the MSB. Each clock pulse gives you a new data bit. Disable the chip and it goes back to the start, so you don't need to read in 8 bit sections. Examples include LM71 and LM74. If you are using multiple ones, each needs a separate enable line.

2 wire sensors are a bit more difficult to programme for, as they need to be sent the address first by the microcontroller, but a wire is saved. If you are using multiple ones, you can usually have 4 or 8 on a single pair of wires. Examples include LM75, LM76 and LM77.

1-wire sensors don't even need a separate powers supply, just signal and ground. The programming is quite a lot more difficult, as they need to be addressed, told to read the temperature, supplied with power, left to read the temperature, reset, addressed and asked the temperature. If you are reading multiple temperatures, you can read as many as you want on one wire, although you do have to have a way of working out which one is which. Dallas make these, and the DS18B20 is the usual one.

Whatever you chose, they all allow you to read the temperature digitally, without worrying about mV of reference voltage variation. Most work over wide voltage ranges, and are generally just as easy to use as a stand alone ADC.
Next time i will buy ds18b20, the water proof one
 
The other problem with the LM34/35 series is self-heating. They usually have a positive temperature offset due to the heat of their own circuitry affecting the ability of the sensor to pick up the outside temperature. The effect is decreased as the temperature rises (internal temperature becomes less of a percentage of the reading) and as the humidity rises (increased cooling capacity). I would not use them for an accurate room temperature reading. I use one as a freeze detector on my dehumidifier, but even in case in ice, it does not read below much below 35 deg F. Another is in use on the supply line from an outdoor forced hot water boiler. The reading is more accurate at 200 deg F, but all I'm looking for in this case is >185 deg F (fire still going) and < 170 deg F (fires out). In neither case if the LM34 used for control, both are used as course temperature pick-ups.
 
1. Yesterday i tested and found out that LM35 is not ratiometric, i used a variable voltage regulator to power the LM35 from 3v to 5.5v, its output remained the same.

2. I had some more 7805 in my collection and one of them gave me an output of 4.99v. NOT BAD in fact very impressive, i never expected 4.99v i was hoping for something like +-0.05v.

So i guess my problem is solved and project is completed with lots of lessons learned.

Thanks and Regards.
 
Have you considered that perhaps the 7805 output varies with temperature?
 
Have you considered that perhaps the 7805 output varies with temperature?
my one did not, i use it without heatsink and consuming over 300ma which makes it run pretty hot.

i forgot the formula for heat watt calculation. my input to vreg jumps from 30v to 20v. so considering 20v as input and output of 5v it will produce good amount of heat.
 
1. Yesterday i tested and found out that LM35 is not ratiometric,
It was not stated that the Lm35 was ratiometric, only the Atmega ADC.

The quiescent current draw of a LM35 is in the order of 100uA, it can drive a 1mA load, so have you considered using a TL431 voltage reference as a drive for the LM35.?
IMO the 7805 is not suitable for the stability you are seeking.

Also look at the LM135.
E
 
It was not stated that the Lm35 was ratiometric, only the Atmega ADC.

The quiescent current draw of a LM35 is in the order of 100uA, it can drive a 1mA load, so have you considered using a TL431 voltage reference as a drive for the LM35.?
IMO the 7805 is not suitable for the stability you are seeking.

Also look at the LM135.
E
Hi E
well things are working fine now. I ran it whole night yesterday, seems to be ok. It was fun watching the red 7 segment 4 digit display at night time from bed.

My 11 month old daughter also noticed it :)

Regards
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top