🌡️ Temperature Monitoring System Using Arduino and TMP36
Learning ADC conversion, voltage calculation, and temperature sensing using Arduino Uno and the TMP36 sensor.

As part of my self-learning journey in Embedded Systems and Arduino programming, I built a Temperature Monitoring System using an Arduino Uno and a TMP36 temperature sensor. The system measures ambient temperature, displays it on the Serial Monitor, and activates an LED when the temperature exceeds a predefined threshold.
While building this project, I learned how analog sensors work, how Arduino converts analog signals into digital values using its ADC, and how sensor output voltage can be converted into temperature readings.
Components Used
Arduino Uno
TMP36 Temperature Sensor
LED
220 ohm Resistor
Breadboard
Jumper Wires
Circuit Diagram
The circuit was designed and tested using Tinkercad Circuits. The TMP36 temperature sensor is connected to the Arduino Uno through analog pin A0. An LED is connected to digital pin 2 and acts as a temperature indicator.
Working Principle
The TMP36 temperature sensor generates an analog voltage proportional to the surrounding temperature. This voltage is read by the Arduino Uno through analog pin A0. The Arduino's built-in ADC converts the analog signal into a digital value, which is then processed to determine the temperature.
The calculated temperature is continuously displayed on the Serial Monitor. A predefined temperature threshold is used in the program. When the measured temperature exceeds this threshold, the Arduino turns on an LED connected to a digital output pin, providing a visual indication of high temperature.
ADC to Voltage Conversion
The TMP36 sensor produces an analog voltage that cannot be directly interpreted by the Arduino. Therefore, the Arduino's 10-bit Analog-to-Digital Converter (ADC) converts the analog signal into a digital value ranging from 0 to 1023.
To determine the actual sensor voltage, the ADC reading is converted using the following formula:
Voltage = ADC Reading × (5.0 / 1023.0)
This provides the equivalent voltage corresponding to the sensor output, which is then used for temperature calculation.
Temperature Calculation
The TMP36 temperature sensor has an output offset of 500 mV (0.5 V) at 0°C and a scale factor of 10 mV per °C.
After obtaining the sensor voltage, the temperature is calculated using the formula:
Temperature (°C) = (Voltage − 0.5) × 100
The calculated temperature value is displayed on the Serial Monitor and compared with a predefined threshold. If the temperature exceeds the threshold value, the Arduino turns on the LED to indicate a high-temperature condition.
Arduino Code
// C++ code
//
int ledPin=2;
int sensorVal;
float voltageVal;
float tempVal;
void setup()
{
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
sensorVal=analogRead(A0);
Serial.print(sensorVal);
Serial.println(" sensor value");
voltageVal=sensorVal*(5.0/1023.0);
tempVal=(voltageVal-0.5)*100;
Serial.print(tempVal);
Serial.println(" temperature");
if(tempVal>25.0){
digitalWrite(ledPin, HIGH);
Serial.println("LED ON");
}
else{
digitalWrite(ledPin, LOW);
Serial.println("LED OFF");
}
}
Output
What I Learned
Through this project, I learned:
Interfacing the TMP36 temperature sensor with Arduino Uno.
Reading analog sensor data using Arduino's analog input pins.
Understanding Analog-to-Digital Conversion (ADC) and how Arduino converts analog voltages into digital values.
Converting ADC readings into equivalent voltage values.
Understanding the 500 mV offset and 10 mV/°C sensitivity of the TMP36 sensor.
Calculating temperature from sensor voltage readings.
Using the Serial Monitor to display real-time sensor data.
Implementing threshold-based control using LEDs.
Building and testing sensor-based circuits using Tinkercad.
Documenting and presenting an engineering project through GitHub and technical blogging.
GitHub Link
GitHub Repository
The complete source code, circuit screenshots, and project files can be found in the GitHub repository below:
🔗 View the complete project on GitHub:
