Monday, March 1, 2021

Arduino Displays Temperature From LM35 Analog Temperature Sensor

Overview

LM35 is an analog temperature sensor, creates an analog voltage output corresponding to the temperature value. The conversion temperature ranges between -55 to +125 degree Celsius. The accuracy of step temperature is 0.5 degree Celsius.

Arduino Displays Temperature From LM35 Analog Temperature Sensor
Example image of this example The temperature reading is 27.83 degree Celsius.
 

It's supplied from a DC voltage between 4 V to 30 V. The physical package is mostly in TO-92.

LM35DZ in TO-92 Package

Since the output data is analog voltage, the temperature reading is easily accomplished with the MCU ADC module. With Arduino analogRead() function, the analog temperature reading is done from scratch.

A display device must connect to Arduino module to display the data. Arduino display module are available in many forms and very low cost. As mentioned so often in the previous post, I decide to use SH1106.

Arduino Interfacing And Programming

In this example, LM35DZ connects to pin A0 of Arduino Uno to output the analog voltage correspond to the temperature value. An SH1106 OLED GLCD display the temperature data.

Arduino Displays Temperature From LM35 Analog Temperature Sensor
Schematic Diagram
 

To find the analog temperature value, I follow the following step.

  1. Read the analog voltage from pin A0 (or any other analog input pin)
  2. Make a calculation to find the voltage
  3. Multiply the voltage with 100 to make the temperature become understandable to human

Arduino Displays Temperature From LM35 Analog Temperature Sensor
Arduino Sketch
 

Click here if you want to download archive of this example. 


No comments:

Post a Comment

Search This Blog

Labels

25AA010A (1) 8051 (7) 93AA46B (1) ADC (30) Analog Comparator (1) Arduino (15) ARM (6) AT89C52 (7) ATMega32 (56) AVR (57) CCS PICC (28) DAC (1) DHT11 (2) Display (105) Distance Sensor (3) DS18B20 (3) dsPIC (2) dsPIC30F1010 (2) EEPROM (5) Environment Sensor (4) esp8266 (1) I2C (29) Input/Output (67) Interrupt (19) Keil (5) Keypad (10) LCD (47) Master/Slave (1) MAX7221 (1) MCP23017 (5) MCP23S17 (4) Meter (3) MikroC (2) Motor (15) MPLABX (71) Nokia 5110 LCD (3) OLED (2) One-Wire (6) Oscillator (8) PCB (6) PCD8544 (3) PCF8574 (5) PIC (107) PIC12F (2) PIC16F628A (2) PIC16F630 (1) PIC16F716 (3) PIC16F818 (10) PIC16F818/819 (2) PIC16F84A (15) PIC16F876A (1) PIC16F877A (9) PIC16F88 (1) PIC16F887 (60) PIC18 (19) PIC18F1220 (4) PIC18F2550 (3) PIC18F4550 (12) PWM (11) RTC (8) Sensor (10) SH1106 (1) Shift Register (11) Shift Registers (3) SPI (24) STM32 (6) STM32 Blue Pill (6) STM32CubeIDE (6) STM32F103C8T6 (6) SysTick (3) temperature sensor (11) Thermometer (21) Timer/Counter (31) TM1637 (2) UART (7) Ultrasonic (4) Voltmeter (7) WDT (1) XC16 (2) XC8 (94)