Skip to main content

LM35

Interfacing LM35 Temperature Sensor with PIC Microcontroller.


The are many cool sensors available now a days, ranging from IR distance sensor modules, accelerometers, humidity sensors, temperature sensors and many many more(gas sensors, alcohol sensor, motion sensors, touch screens). Many of these are analog in nature. That means they give a voltage output that varies directly (and linearly) with the sensed quantity. For example in LM35 temperature sensor, the output voltage is 10mV per degree centigrade. That means if output is 300mV then the temperature is 30 degrees. In this tutorial we will learn how to interface LM35 temperature sensor with PIC18F4520 microcontroller and display its output on the LCD module.
First I recommend you to go and read the following tutorial as they are the base of this small project.
After reading the ADC tutorial given above you will note the the PIC MCU’s ADC gives us the value between 0-1023 for input voltage of 0 to 5v provided it is configured exactly as in the above tutorial. So if the reading is 0 then input is 0v, if reading is 1023 then input is 5v. So in general form if the adc read out is valthen voltage is.
unsigned int val;
val=ADCRead(0); //Read Channel 0
voltage= ((val)/1023.0)*5;
The above formula give voltage in Volts, to get Voltage in mili Volts (mV) we must multiply it with 1000, so
voltage=((val)/1023.0)*5*1000); //Voltage is in mV
since 10mV = 1 degree, to get temperature we must divide it by 10, so
t=((val)/1023.0)*5*100); //t is in degree centigrade
simplifying further we get
t=((val/1023.0)*500);
t=(val*0.48876);
we round off this value, so
t=round(val*0.48876);
remember round() is a standard c library function



Comments

Popular posts from this blog

Android Tutorial

Android  is a complete set of software for mobile devices such as tablet computers, notebooks, smartphones, electronic book readers, set-top boxes etc. It contains a  linux-based Operating System ,  middleware  and  key mobile applications . It can be thought of as a mobile operating system. But it is not limited to mobile only. It is currently used in various devices such as mobiles, tablets, televisions etc. This tutorial is developed for beginners and experienced persons. Let's see the topics of android that we are going to learn. Basics of Android In this fundamental chapter, you will learn about android, its components, how to create first android application, internal of first android application etc. What is Android History and Version Software Stack Core Building Blocks Android Emulator Installing softwares Setup Eclipse Hello Android example Internal Details Dalvik VM AndroidManifest.xml R.java Hide Title Bar Activity and I...

CLOUD WORKFLOW SCHEDULING WITH DEADLINE AND TIME SLOT ALGORITHM

CLOUD WORKFLOW SCHEDULING WITH DEADLINE AND TIME SLOT ALGORITHM Abstract Allocating service capacities in cloud computing is based on the assumption that they are unlimited and can be used at any time. However, available service capacities change with workload and cannot satisfy users’ requests at any time from the cloud provider’s perspective because cloud services can be shared by multiple tasks. Cloud service providers provide available time slots for new user’s requests based on available capacities. In this paper, we consider workflow scheduling with deadline and time slot availability in cloud computing. An iterated heuristic framework is presented for the problem under study which mainly consists of initial solution construction, improvement, and perturbation. Three initial solution construction strategies, two greedy- and fair-based improvement strategies and a perturbation strategy are proposed. Different strategies in the three phases result in several heuristics. ...

Force Sensing Resistor FSR400

Force Sensing Resistor FSR400 This is a small  force sensitive resistor . It has a 0.16" (4 mm) diameter active sensing area. This FSR will vary its resistance depending on how much pressure is being applied to the sensing area. The harder the force, the lower the resistance. When no pressure is being applied to the FSR, its resistance will be larger than 1MΩ, with full pressure applied the resistance will be 2.5kΩ. Two pins extend from the bottom of the sensor with 0.1" pitch making it bread board friendly. These sensors are simple to set up and great for sensing pressure, but they aren't incredibly accurate. Use them to sense if it's being squeezed, but you may not want to use it as a scale. Dimensions: Overall length: 1.75" Overall width: 0.28" Sensing area: 0.3"