The LM35 is a popular analog temperature sensor used to measure temperature in degrees Celsius (°C). It is a versatile and affordable component that is commonly used in various electronics projects and applications such as weather stations, climate control systems, and other temperature-monitoring devices.
int tempPin = A0; // LM35 output pin connected to A0 float temperature; void setup() { Serial.begin(9600); } void loop() { int sensorValue = analogRead(tempPin); // Convert the analog reading (0-1023) to a voltage (0-5V) float voltage = sensorValue * (5.0 / 1023.0); // Convert the voltage to temperature (LM35: 10mV per degree Celsius) temperature = voltage * 100; Serial.print("Temperature: "); Serial.print(temperature); Serial.println(" C"); delay(1000); // Wait for a second before reading again }
Origin: China
Brand:- Generic