Skip to main content

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 circuit 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 Sensor


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

Comments

Popular posts from this blog

NE566 Function Generator Circuit Diagram

The NE566 Function Generator is a Voltage-Controlled Oscillator of exceptional linearity with buf fered square wave and triangle wave outputs. The frequency of oscillation is determined by an external resistor and capacitor and the voltage applied to the control terminal. The Oscillator CAN be programmed over a ten-to-one frequency range by proper selection of an external resistance and modulated over a ten-to-one range by the control voltage, with exceptional linearity.  FMAX = 1 MHz     WIDE 1000:1 Continuous Sweep Possible  NE566 Function Generator Circuit Diagram Pdf Datasheet  Sourced by : Circuitsstream

Transceiver Homebrew QRP SSB 80M Band

Radio communication transceiver is a radio transmitter at the same time the plane doubles as a radio receiver used for communication purposes. It consists of the transmitter and the receiver are assembled in an integrated way. In mulamula generation, the transmitter or receiver or transmitter and receiver sections are assembled separately and is part of a stand sendirisendiri and can work well sendirisendiri Currently employed both parts are integrated in turn. Aircraft simple transmitter consists of an oscillator generating radio vibration and this vibration after vibration boarded with our voice, in a technique called dimodulir radio, then by the antenna is converted into radio waves and transmitted. As we know that the sound waves we can not reach long distances, although its power is quite large, while the radio waves with a relatively small force can reach a distance of thousands of kilometers. In order for our voice can reach a far distance, then our voice superimposed on radio w...

Altec Lansing 353A – power amplifier – vacuum tube type – Circuit diagram 6L6 12AX7

Used tubes – 12AX7 [pre-amplifier, tone control and audio pre-amplifier] – 6L6GC [audio output] Circuit diagram Tube pin-out -6L6 Tube pin-out 12AX7