Search This Blog

Showing posts with label LM35. Show all posts
Showing posts with label LM35. Show all posts

Saturday, 14 September 2013

Easy Datalogger

Hello!

Today I've been working in a easy datalogger with my Arduino Nano. I need to know how a temperature changed along the time (5 hours) and I had a LM35 sensor and the "Nano".

The LM35 series are precision integrated-circuit temperature sensors, with an output voltage linearly proportional to the Centigrade temperature. It's really easy to find and its precision is really good -I evaluated it using a precision termometer and I concluded that I didn't need to gauge my LM35-.





Next step is the wiring. I conected the LM35 to one of the analog input of the Arduino Nano (Pin 2). I used the number 0 (A0) but you can choose whatever you want -We have 8 analog inputs-.


LM35 PIN 1 ------------------------------ 5V OUTPUT ARDUINO NANO
LM35 PIN 2 ------------------------------ ANALOG INPUT 0-7 ARDUINO NANO
LM35 PIN 3 ------------------------------ GND ARDUINO NANO


Arduino Code


float temp1;

const int sensor1 = A0;    
int sensorValue = 0;
int time1
 = 30000;    
float time = 0;

void setup() {
Serial.begin(9600);
}

void loop() {
  float sensorValue = analogRead(sensor1);
  temperatura1 = (5 * sensorValue * 100.0)/1024.0;

  Serial.print(time);
  Serial.print("\t");
  Serial.println(temp1);
  delay (tiempo);
  time = (time + ((time1/1000));
}


Notes:


  1. Measuring period: 30000ms (time1 variable).
  2. Our data will be showed in "Serial Monitor". ---> Tools -> Serial Monitor.



And finally, I copy&paste all the data compiled in a Excel... to make graphs or calculations. It's really easy and useful. I recomend try it.


See you!