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

TDA2030 complete tone control

At this time I present a series of amplifiers that use IC TDA2030, but this series is equipped with a tone control. Tone controls include Bass, Treebel, and Volume. Power amplifier and tone control has been put together in a single PCB. As well as its power supply circuit was also used as one with the power amp, and tone control. Making it easier in the installation and will look neat. Schematics Layout PCB PCB design This amplifier is a mono amplifier type, can be modif for guitar amplifiers. If not coupled amplifier (mic preamp) then you must deactivated potensio treble and bass, why? because if not using a mic preamp and still maintain potensio treble and bass sound input (input) from the guitar will not or the maximum discharge is not tight on the speakers. So you must deactivated a way to decide which directly connected capacitor with the tone control circuit, and capacitor were connected directly to potensio volume and input jack.

PID instruction in Allen Bradley PLC Closed Loop Control

PID instruction in Allen Bradley PLC [Proportional/Integral/Derivative] Closed Loop Control For   Processor SLC 5/02SLC 5/03SLC 5/04SLC 5/05    MicroLogix 1200 and MicroLogix 1500 (A special PID file replaces the old integer file control block.) Description of PID in PLC   This output instruction is used to control physical properties such as temperature, pressure, liquid level, or flow rate of process loops. The PID instruction normally controls a closed loop using inputs from an analog input module and providing an output to an analog output module as a response to effectively hold a process variable at a desired set point. The PID equation controls the process by sending an output signal to the actuator. The greater the error between the setpoint and the process variable input, the greater the output signal, and vice versa. An additional value (feed forward or bias) can be added to the control output as an offset. The result of the PID calculation (control vari...

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