Erriez LM35 library for Arduino  1.1.0
This is a LM35 analog temperature sensor library for Arduino.
LM35 temperature sensor library for Arduino

This is an accurate LM35 analog temperature sensor library for Arduino with noise cancellation.

Library features

Hardware

Supported hardware

Notes:

Arduino UNO - LM35 example

Schematic LM35 and Arduino UNO
LM35 Arduino UNO
GND GND
Vs 5V (or 3.3V)
Vout A0 (ANALOG pin)

Notes:

LM35 pins

LM35 pins

LM35 specifications

Examples

Arduino IDE | Examples | Erriez LM35 analog temperature:

Documentation

Usage

Initialization

{c++}
#include <ErriezLM35.h>
// Connect LM35 data pin to Arduino DIGITAL pin
#define LM35_PIN A0
LM35 lm35 = LM35(LM35_PIN);

Read temperature and humidity

{c++}
void loop()
{
// Read unsigned temperature from sensor
uint16_t lm35_temp = lm35.readTemperature();
// Print temperature
Serial.print(F("LM35: "));
Serial.print(lm35_temp / 10);
Serial.print(F("."));
Serial.print(lm35_temp % 10);
Serial.println(F(" *C"));
// Wait some time
delay(2000);
}

Serial output

Analog LM35 temperature sensor example
LM35: 18.1 *C
LM35: 18.2 *C
LM35: 18.2 *C
...

Library dependencies

Library installation

Please refer to the Wiki page.

Other Arduino Libraries and Sketches from Erriez