Ardiuno with temperature sensor

Arduino UNO: Temperature Sensor (LM35)

Arduino UNO: Temperature Sensor with LM35 🌡️🔌

Level: Beginner – Requires simple code.

🧰 Components Required:

  • 1 x Arduino UNO
  • 1 x LM35 Temperature Sensor
  • Breadboard
  • Jumper Wires

🔌 Circuit Connection:

  • LM35 Pin 1 (VCC) → connect to Arduino 5V
  • LM35 Pin 2 (Vout) → connect to Arduino A0
  • LM35 Pin 3 (GND) → connect to Arduino GND
Note: The LM35 outputs analog voltage. Arduino reads it on pin A0 and converts it to a temperature value.

💻 Example Code:

int sensorPin = A0;  // LM35 output pin
float sensorValue;
float temperature;

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

void loop() {
  sensorValue = analogRead(sensorPin);  
  temperature = (sensorValue * 5.0 * 100.0) / 1024.0;  
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");
  delay(1000);
}
    

📘 Explanation:

The LM35 temperature sensor gives an analog voltage that increases by 10mV per °C. Arduino reads this value on pin A0, then converts it into Celsius using a simple formula. The result is displayed in the Serial Monitor, updating every second.

© 2025 By Ismail – Future Engineer 👨‍💻🔧

Leave a Comment

Your email address will not be published. Required fields are marked *