Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to interface an LM35 with Atmega16 for detection purpose......

Status
Not open for further replies.

ppatel23

Newbie level 5
Joined
Jul 24, 2012
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,357
Hey,...

I want to use LM35 for sensing the room temperature with the atmega16, i need to adjust the temperature ie if room temp falls below 20c then i need logic1 or 0 on the ADC0 port or at any port..
pls help me with the circuit n programming ...
thanks
 

It is very simple. Connect the +V pin of LM35 to 5V, -V pin to GND, and o/p pin to ADC input pin of MCU. With this method it will measure temperatures from 0 deg C to +150 deg C.
 
Use the ADC to measure the output voltage of the LM35. The LM35 outputs a voltage proportional to the temperature. The output voltage is 10mV per degree Celsius. So, at 20 degrees Celsium, the output voltage will be 200mV. The corresponding ADC reading will be (0.2/VREF)*1023 (for 10-bit ADC, which is what the ATMEGA16 has). Use a simple if condition to decide whether to output logic high or logic low to the required pin.

Hope this helps.
Tahmid.
 
thank you for ur help, this means that i have to only keep the condition in terms of millivolts what ever i require n when ever the condition is true it would give me a logic 1 on any determined pins....
 

can i keep the Aref at 5V ..i.e at Vcc..
 

You can use ARef of +5V but you will then get adc value of 1023 for 5V adc input. Max Vo of LM35 for 150 deg C is 1.5 V. So your max adc value for 1.5 V is 306.9.
Your resolution becomes less.
 

I want to sense the temp by LM35 n i have an condition 2 be set up at 20'c (if the temp is above 20'c the my relays will remain set otherwise will remain reset)...now im getting 200mV at 20'c at Vout pin of LM35 , now what should be the condition set for the atmega16 i.e in programming (i'm really confused as i had referred a lot) also let me know what should be the Aref (preferably for good result),......pls help my mind has just freaked out..
 

What ARef have you used. You are getting very low value. Even if you use 5V for ARef then also you will not get such low value. Post your circuit. Mention your ARef value otherwise value can't be calculated.
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top