Monday, August 18, 2014

Simple Temperature Sensor Arduino

Hello people, it’s been a while since I have posted projects on this website. This semester was really busy, I didn’t have time to much else, but soon I will have my winter holiday (Here in south our summer holiday is from December to February).

Today I am going to show you how to build a simple temperature sensor using one LM35 Precision Temperature Sensor and Arduino, so you can hookup on your future projects. The schema will send serial information about the temperature so you can use on your computer, change the code as you will. I’m planning to build a temperature sensor with max/min + clock + LCD, and when I get it done, I will post here.

Parts:
  • Arduino (You can use other microcontroller, but then you will need to change the code).
  • LM35 Precision Centigrade Temperature Sensor, you can get from any electronic store. Here is the DATA SHEET.
  • BreadBoard
Assembling:
This is a quick and simple step. Just connect the 5V output from arduino to the 1st pin of the sensor, ground the 3rd pin and the 2nd one, you connect to the 0 Analog Input.
Down goes some pictures that may help you, click to enlarge:





Temperature


sens

processin


Here is the Arduino Code, just upload it and check the Serial Communication Option.
You can also download the .pde HERE.

/*
An open-source LM35DZ Temperature Sensor for Arduino. This project will be enhanced on a regular basis
(cc) by Daniel Spillere Andrade , http://www.danielandrade.net
http://creativecommons.org/license/cc-gpl
*/


int pin = 0; // analog pin
int tempc = 0,tempf=0; // temperature variables
int samples[8]; // variables to make a better precision
int maxi = -100,mini = 100; // to start max/min temperature
int i;

void setup()
{
  Serial.begin(9600); // start serial communication
}

void loop()
{
 
 
for(i = 0;i< =7;i++){ // gets 8 samples of temperature
 
  samples[i] = ( 5.0 * analogRead(pin) * 100.0) / 1024.0;
  tempc = tempc + samples[i];
  delay(1000);

}

tempc = tempc/8.0; // better precision
tempf = (tempc * 9)/ 5 + 32; // converts to fahrenheit

if(tempc > maxi) {maxi = tempc;} // set max temperature
if(tempc < mini) {mini = tempc;} // set min temperature

Serial.print(tempc,DEC);
Serial.print(" Celsius, ");

Serial.print(tempf,DEC);
Serial.print(" fahrenheit -> ");

Serial.print(maxi,DEC);
Serial.print(" Max, ");
Serial.print(mini,DEC);
Serial.println(" Min");

tempc = 0;

delay(1000); // delay before loop
}

Anything just ask!





Source by : link

Related Posts:

  • IR Infra Red Sensor with 7 Segment DisplayInfrared light has a difference with ordinary light in general. We can see clearly when a light or light on an object. As with the infrared light we can not see the manifestation of these rays. Frankly I can not answer when a… Read More
  • Simple Temperature Sensor ArduinoHello people, it’s been a while since I have posted projects on this website. This semester was really busy, I didn’t have time to much else, but soon I will have my winter holiday (Here in south our summer holiday is from De… Read More
  • Fire Sensor Hamamatsu UVTRONFire Sensor (Hamamatsu UVTRON)UVTRON Hamamatsu R2868 is a sensor that detects a flame fire that emit ultraviolet light. Ultraviolet light emitted from a candle flame is a 5 meter can be detected by this sensor. This sensor ca… Read More
  • Temperature Sensor Circuit DiagramThe LM35 temperature sensor provides an output of 10 mV/C for every degree Celsius over 0C. At 20C the output voltage is 20 10 = 200 mV. The circuit consumes 00. The load resistance should not be less than 5 kQ. A 4- to 20-V … Read More
  • Capacitive SensorThe purpose of this schema is to animate shop-windows by means of a capacitive sensor placed behind a post-card-like banner. The card is placed against the glass inside the shop-window, and the visitor can activate the relay … Read More

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.