Design of a Temperature Detection Device Using RTD
Aim
- To design a temperature measurement system using an RTD.
- To interface the RTD through a bridge circuit and differential amplifier for signal conditioning.
- To use an ESP32esp32A low-cost, low-power system-on-a-chip microcontroller with integrated Wi-Fi and Bluetooth capabilities, widely used by students and engineers for IoT applications and sensor data acquisition. microcontroller to convert bridge voltage to temperature using a linear calibration relation.
- To display the measured temperature on an LCD module.
Apparatus & Software
| Component | Quantity |
|---|---|
| RTD Sensor | 1 |
| Resistor (100 Ω) | 3 |
| Resistor (2.2 kΩ) | 2 |
| Resistor (4.7 kΩ) | 2 |
| DC Power Supply | 2 |
| Connecting Wires | As required |
| Operational Amplifier (Op-Amp) | 1 |
| ESP32 Microcontroller | 1 |
| LCD Display | 1 |
| Display Driver / Interface IC (I2C) | 1 |
Theory
Pre-Lab / Circuit Diagram

Figure 1: Circuit diagram showing the RTD Wheatstone bridge (3× 100 Ω), differential amplifier (R1 = 4.7 kΩ, R2 = 2.2 kΩ), and ESP32 microcontroller with LCD display via I2C interface.
Procedure
- Connect the RTD as one arm of the Wheatstone bridge using three 100 Ω resistors for the remaining arms.
- Connect the bridge output to the differential amplifier configured with R1 = 4.7 kΩ and R2 = 2.2 kΩ to attenuate the bridge voltage within the ESP32 ADC range.
- Connect the amplifier output to the ADC input pin of the ESP32 microcontroller.
- Connect the LCD module to the ESP32 via the I2C interface (Display Driver IC).
- Power the bridge circuit and op-amp with the DC power supply.
- Use the linear calibration relation T(°C) = 129.4 · Vbridge − 26.4 derived from the previous experiment.
- Incorporate the amplifier gain (Gain = R2/R1 = 2.2/4.7 ≈ 0.468) to relate ADC voltage to temperature: T(°C) = 276.49 · VADC − 26.4.
- Program the ESP32 with this conversion equation.
- Verify the displayed temperature matches a reference thermometer.
- Gradually heat the RTD in the water bath from 35°C to 70°C.
- Record the bridge voltage and the measured temperature displayed on the LCD at each step.
- Compare the displayed measured temperature with the actual reference temperature.
- Calculate the absolute and percentage errors for each reading.
Simulation / Execution (Not Applicable)
This section is not required for this experiment.
Observations
| S. No. | Temperature (°C) | Bridge Voltage VAB (V) |
|---|---|---|
| 1 | 37 | 0.49 |
| 2 | 40 | 0.50 |
| 3 | 42 | 0.515 |
| 4 | 45 | 0.541 |
| 5 | 47 | 0.569 |
| 6 | 50 | 0.590 |
| 7 | 52 | 0.610 |
| 8 | 55 | 0.632 |
| 9 | 57 | 0.644 |
| 10 | 60 | 0.661 |
| 11 | 62 | 0.690 |
| 12 | 65 | 0.710 |
| 13 | 67 | 0.724 |
| 14 | 69 | 0.735 |
| 15 | 70 | 0.745 |

Figure 2: Bridge Voltage (VAB) vs Temperature — plotted using MATLAB from calibration data.
| Actual Temp (°C) | Measured Temp (°C) | Bridge Voltage (V) |
|---|---|---|
| 35 | 35.42 | 0.478 |
| 38 | 38.61 | 0.500 |
| 42 | 42.90 | 0.536 |
| 44 | 44.88 | 0.551 |
| 47 | 47.90 | 0.572 |
| 50 | 50.95 | 0.598 |
| 53 | 54.08 | 0.622 |
| 56 | 57.03 | 0.645 |
| 59 | 60.01 | 0.668 |
| 62 | 63.21 | 0.693 |
| 65 | 66.43 | 0.717 |
| 68 | 69.73 | 0.743 |
| 70 | 71.47 | 0.756 |

Figure 3(a): LCD display reading showing bridge voltage and corresponding temperature value (Vb: 0.536V T: 42.99C).

Figure 3(b): LCD display reading showing bridge voltage and corresponding temperature value (Vb: 0.743V T: 69.73C).
| Actual Temp (°C) | Measured Temp (°C) | Absolute Error | Percentage Error (%) |
|---|---|---|---|
| 35 | 35.42 | 0.478 | 1.20 |
| 38 | 38.61 | 0.501 | 1.61 |
| 42 | 42.90 | 0.536 | 2.14 |
| 44 | 44.88 | 0.548 | 2.00 |
| 47 | 47.90 | 0.569 | 1.91 |
| 50 | 50.95 | 0.591 | 1.90 |
| 53 | 54.08 | 0.614 | 2.03 |
| 56 | 57.03 | 0.636 | 1.84 |
| 59 | 60.01 | 0.658 | 1.71 |
| 62 | 63.21 | 0.680 | 1.95 |
| 65 | 66.43 | 0.703 | 2.20 |
| 68 | 69.73 | 0.743 | 2.54 |
| 70 | 71.47 | 0.744 | 2.10 |

Figure 4: Actual Temperature vs Measured Temperature for RTD system. Measured points track closely with the ideal (dashed) line.
Calculations
Results & Analysis
- The linear calibration equation T(°C) = 129.4 · Vbridge − 26.4 was successfully programmed into the ESP32.
- After accounting for the differential amplifier attenuation (Gain ≈ 0.468), the final ADC-to-temperature equation is T(°C) = 276.49 · VADC − 26.4.
- Measured temperatures tracked closely with actual temperatures across the range of 35°C to 70°C.
- Percentage errors ranged from 1.20% to 2.54%, with the maximum error at 68°C.
- The LCD module successfully displayed real-time bridge voltage and computed temperature values.
Conclusion
Post-Lab / Viva Voce
- Q: The differential amplifier in this experiment is configured with R2/R1 = 2.2/4.7 ≈ 0.468, giving an attenuation (gain < 1). Why is attenuation used here instead of amplification?
A: The RTD bridge output voltage is in the range 0.49 V to 0.745 V — already a reasonable signal level. The ESP32 ADC has an input range of 0 to 3.3 V (or 0 to 1.1 V for the internal reference in some modes). If the bridge signal were amplified, it could exceed the ADC's input range and cause clipping or damage. Attenuation ensures the signal comfortably fits within the ADC's input range at all temperatures, preserving measurement integrity. The linear calibration equation then accounts for the attenuation factor in converting ADC readings back to temperature. - Q: The linear calibration uses only the two endpoints (37°C and 70°C) to compute slope and intercept. What are the limitations of this two-point calibration approach?
A: Two-point calibration assumes the relationship between bridge voltage and temperature is perfectly linear between those endpoints. However, the RTD's R-T relationship has a slight quadratic component, and the bridge circuit introduces additional non-linearity (the voltage-resistance relationship in a bridge is not perfectly linear). Using only the endpoints ignores any curvature in between, causing the largest errors at mid-range temperatures. A multi-point calibration using least-squares regression across all 15 data points would give a better fit and reduce systematic mid-range errors. Additionally, two-point calibration is highly sensitive to measurement noise at the chosen endpoints. - Q: The ESP32 has a 12-bit ADC. What is the theoretical temperature resolution of the measurement system, and what limits the actual resolution in practice?
A: A 12-bit ADC has 2¹² = 4096 quantisation levels. With a 3.3 V reference, the voltage resolution is 3.3/4096 ≈ 0.806 mV per step. Using the final equation T = 276.49 · VADC − 26.4, the temperature resolution is 276.49 × 0.000806 ≈ 0.223°C per ADC step. In practice, the actual resolution is worse because: (1) The ESP32's ADC is known for non-linearity errors (integral and differential non-linearity), particularly in the middle of its range. (2) Noise in the bridge circuit and amplifier adds random variation that is larger than one ADC step. (3) The ADC's effective number of bits (ENOB) is typically 9–10 bits rather than the ideal 12, reducing actual resolution. - Q: Why is an I2C interface used to connect the LCD display to the ESP32 rather than a direct parallel connection?
A: A standard 16×2 LCD in parallel mode requires 6 to 8 GPIO pins (4 data lines + RS, RW, EN signals), and additional pins for backlight control. The ESP32 has limited GPIO pins, and many are already allocated to the ADC and power management functions. An I2C interface (using an interface driver IC) requires only 2 pins (SDA and SCL), regardless of how many devices are connected, since multiple I2C devices share the same two-wire bus using unique addresses. This frees up GPIO pins for other uses and simplifies wiring significantly, at the cost of slightly lower data transfer speed — which is not a concern for a slow temperature display. - Q: If the temperature displayed on the LCD is consistently 3°C higher than the actual temperature across the full range, how would you correct this in the ESP32 program without recalibrating the hardware?
A: A consistent offset error of +3°C means the intercept c in the calibration equation is 3°C too high. The correction is straightforward: subtract 3 from the constant term in the firmware. The corrected equation becomes T(°C) = 276.49 · VADC − 26.4 − 3 = 276.49 · VADC − 29.4. This is a software-only fix that requires no hardware changes. However, if the error were not constant but instead proportional to temperature (scaling error), both the slope and intercept would need adjustment, requiring at least two reference points for re-calibration. - Q: How would the system performance change if the water bath temperature were varied rapidly rather than gradually during the measurement?
A: Several issues would arise: (1) Thermal lag — the RTD has a finite thermal time constanttime constantA measure of how quickly a circuit responds to change. For RC circuits, τ = RC; for RL circuits, τ = L/R. After one time constant, the response reaches ~63% of its final value. (typically 3–10 seconds depending on its construction and the medium). Rapid temperature changes mean the RTD element has not reached thermal equilibrium with the surrounding water, so the resistance (and therefore measured temperature) lags behind the actual temperature. (2) The ESP32 ADC samples the voltage at discrete intervals; if temperature changes faster than the sampling rate, readings may miss peaks or transitions. (3) The Wheatstone bridge assumes steady-state resistance values; transient resistance changes during rapid heating may introduce additional measurement errors due to the bridge's finite response time.
References & Resources (Not Applicable)
This section is not required for this experiment.
Was this experiment helpful?
Your feedback helps us improve
Please Sign In to rate this experiment.