Temperature Sensor -
The Temperature Sensor LM35 series are precision integrated-circuit temperature devices with an output voltage linearly proportional to the Centigrade temperature.
The LM35 device has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from the output to obtain convenient Centigrade scaling. The LM35 device does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature range.
Temperature Sensor connection with arduino-
technical specification
- celsius temperature
- Linear + 10-mV/°C scale factor
- 0.5°C ensured accuracy (at 25°C)
- Rated for full −55°C to 150°C range
- Suitable for remote applications
Components Required
You will need the following components −
- 1 × Breadboard
- 1 × Arduino Uno R3
- 1 × LM35 sensor
code -
// We'll use analog input 0 to measure the temperature sensor's
// signal pin.
const int temperaturePin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.print("voltage: ");
Serial.print(voltage);
Serial.print(" deg C: ");
Serial.print(degreesC);
Serial.print(" deg F: ");
Serial.println(degreesF);
delay(1000);
// repeat once per second (change as you wish!)
}
float getVoltage(int pin){
return (analogRead(pin) * 0.004882814);
}
No comments:
Post a Comment