Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Temperature Monitoring System with LM35 Sensor

View and Edit Project In Cirkit DesignerImage of Arduino UNO Temperature Monitoring System with LM35 Sensor

Circuit Documentation

Summary

This circuit is designed to read the temperature using an LM35 temperature sensor and an Arduino UNO. The temperature data is read from the sensor and displayed on the Serial Monitor in Celsius.

Component List

Arduino UNO

Temperature Sensor (LM35)

Wiring Details

Arduino UNO

Temperature Sensor (LM35)

Code

/*
 * Arduino Sketch for Temperature Sensor Test
 * This code reads the analog value from an LM35 temperature sensor connected to
 * pin A0 of an Arduino UNO and prints the temperature in Celsius to the Serial
 * Monitor.
 */

const int sensorPin = A0; // Pin where the LM35 is connected

void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600 baud
}

void loop() {
  int sensorValue = analogRead(sensorPin); // Read the analog value from the sensor
  float voltage = sensorValue * (5.0 / 1023.0); // Convert the analog value to voltage
  float temperatureC = voltage * 100.0; // Convert the voltage to temperature in Celsius
  Serial.print("Temperature: ");
  Serial.print(temperatureC);
  Serial.println(" °C");
  delay(1000); // Wait for 1 second before taking another reading
}

This code initializes the serial communication, reads the analog value from the LM35 temperature sensor, converts it to a voltage, then to a temperature in Celsius, and prints the temperature to the Serial Monitor every second.