DIGITAL CENTIGRADE THERMOMETER Using LM335 & LM741 & Arduino

by TangoEco5 in Circuits > Arduino

10 Views, 0 Favorites, 0 Comments

DIGITAL CENTIGRADE THERMOMETER Using LM335 & LM741 & Arduino

Picture1.png

This Digital Centigrade Thermometer is designed to provide accurate room temperature measurements using the LM335 Precision Temperature Sensor, with signal processing handled by two LM741 operational amplifiers and an Arduino for data acquisition and visualization. The system is initially calibrated at 25°C, dynamically tracking temperature fluctuations and displaying results on an LCD screen in multiple units, including Celsius, Fahrenheit, and Kelvin.

Supplies

20250405_200648.jpg

LM335 Precision Temperature Sensor (1)

LM741 Operational Amplifiers (2)

Arduino Uno R4 (or similar Arduino board) (1)

LCD Display (16x2) with I2C module (1)

Potentiometers (3)

Resistors (7)

Capacitor (1)

Breadboard (1)

Jumper wires (various lengths)

9V Batteries (3)

Battery connectors for the 9V batteries

Power supply (if not relying solely on batteries, a bench power supply would be useful)

How It Works:

Picture1.png
  1. The LM335 sensor provides an output voltage corresponding to the temperature in Kelvin.
  2. A potentiometer is used to calibrate the sensor at room temperature (25°C).
  3. The first LM741 amplifier buffers and stabilizes the sensor’s output voltage.
  4. The second LM741 amplifier is in the differential configuration outputs the difference of the reference voltage (2.731V) and the sensor’s output to determine Celsius temperature in mV.
  5. The Arduino reads the output voltage from the second amplifier using analog pin A0.
  6. The LCD display presents temperature readings in Celsius (°C), Fahrenheit (°F), Kelvin (K), and voltage (mV) readings from the second amplifier (Vout).


Breadboard Description

Picture2.jpg
  1. Power supply rails set up to provide +5V to the top rail and +5V to the bottom rail.
  2. Temperature Sensor (LM335) from left to right; Adjustment, V+ and V-.
  3. Potentiometer to calibrate the temperature sensor. (See Step 5, Sensor Calibration).
  4. Calibrated sensor output (V1).
  5. First Operational Amplifier (LM741) used as a buffer with 0 gain (output = V1).
  6. Potentiometer uses the +5V power rail and outputs + 2.731v which is the inverting input of the 2nd Operational Amplifier (V2).
  7. Second Operational Amplifier is configured as differential amplifier which outputs the difference V1 and V2.
  8. The output of the second amplifier is the temperature in Celsius but in millivolts. This output is divided by 10 to give out the actual temperature in Celsius (Processing done by Arduino via A0 pin).
  9. Ground wire connects to Arduinos ground pin
  10. Negative Power Supply: a potentiometer is used to reduce the -9V from the battery to provide -5V to both operational amplifiers.

Arduino Integration

Picture3.jpg
  1. Arduino Uno R4 powered by a 9v battery.
  2. Gound wire from breadboard.
  3. A0 pin used to read the output from the second amplifier (see # 8 from Breadboard Description)
  4. A capacitor was used to minimize the noise caused but the LCD display and Bench Power sources.
  5. LCD display pins.


. LCD Display System

Picture4.jpg
  1. Temperature Sensor (LM335)
  2. Thermometer showing 21°C.
  3. LCD power, ground, SCL and CDA pins connected to the Arduino.
  4. LCD displays Temperatures in Celsius (C), Fahrenheit (F), Kelvin (K), and voltage(V) from the second amplifier read by pin A0 in millivolts.


Sensor Calibration:

Calibration.png

The LM335 temperature sensor was calibrated at room temperature (25°C) by adjusting a potentiometer, with its wiper pin connected to the sensor's adjustment pin, to achieve an output voltage of 2.982V (2982mV). The LCD now displays 25.39 when the thermometer is at 25°C.

Code:

This Arduino code reads temperature data from an LM335 Precision Temperature Sensor, processes it using analog input A0, and displays the results on an LCD screen. The program first converts the sensor's voltage output (in millivolts) into Celsius, then calculates Kelvin and Fahrenheit using standard temperature conversion formulas. The values are printed to the Serial Monitor and displayed on a 16x2 LCD, updating every 3 seconds.

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Initialize the LCD: 0x27 is the default address, 16 is the width, and 2 is the height
LiquidCrystal_I2C lcd(0x27, 16, 2);

const int sensorPin = A0; // Analog pin for the sensor
float sensorValue; // Raw analog reading
float voltageOut; // Sensor output in mV
float temperatureC; // Temperature in Celsius
float temperatureK; // Temperature in Kelvin
float temperatureF; // Temperature in Fahrenheit

void setup() {
pinMode(sensorPin, INPUT);
Serial.begin(9600);

lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
}

void loop() {
// Read sensor value and calculate voltage
sensorValue = analogRead(sensorPin);
voltageOut = (sensorValue * 5000) / 1024; // Convert to millivolts (mV)

// Calculate temperature directly from voltage
// Since 1°C corresponds to 10 mV:
temperatureC = voltageOut / 10;

// Convert Celsius to Kelvin
temperatureK = temperatureC + 273.15;

// Convert Celsius to Fahrenheit
temperatureF = (temperatureC * 1.8) + 32;

// Print values to the Serial Monitor
Serial.print("Temperature(ºC): ");
Serial.print(temperatureC);
Serial.print(" Temperature(ºF): ");
Serial.print(temperatureF);
Serial.print(" Temperature(K): ");
Serial.print(temperatureK);
Serial.print(" Voltage(mV): ");
Serial.println(voltageOut);

// Display values on the LCD
lcd.setCursor(0, 0); // Top line
lcd.print("C:");
lcd.print(temperatureC);
lcd.print(" F:");
lcd.print(temperatureF);

lcd.setCursor(0, 1); // Bottom line
lcd.print("K:");
lcd.print(temperatureK);
lcd.print(" V:");
lcd.print(voltageOut);

delay(3000); // Update every 3 seconds
}

Sources

  1. “Arduino Libraries.” GitHub, 4 Apr. 2025, github.com/arduino-libraries.

Guide for LM35, LM335 and LM34 Temperature Sensors with Arduino | Random Nerd Tutorials. 15 July 2019, randomnerdtutorials.com/arduino-lm35-lm335-lm34-temperature-sensor/.

  1. “LM335.” Ti.com, 2015, www.ti.com/product/LM335.
  2. “LM335 - STMicroelectronics.” STMicroelectronics, 2025, www.st.com/en/mems-and-sensors/lm335.html.
  3. “LM741.” Ti.com, 2015, www.ti.com/product/LM741.
  4. Floyd, T. L. (2018). Electronic Devices-Conventional Current Version (10th ed.) [Review of Electronic Devices-Conventional Current Version]. Pearson.