Digital thermometer using arduino and LM35.

This article is about a simple three digit digital thermometer using arduino. Range of this thermometer is from 0°C to 99.9°C. There is also a provision for displaying the temperature in °F scale. Three terminal analog temperature sensor LM35 is used as the sensor here. LM35 can measure temperatures between -55°C to +155°C. The supply voltage range is from 4V to 30V DC and the current drain is 60uA. The LM35 is available in TO-92 package and it is very easy to use. The output voltage of the arduino increases 10mV per °C rise in temperature. That means if 25 °C is the temperature, then output voltage of the sensor will be 250mV. Circuit diagram of the digital thermometer using arduino and LM35 is shown in the figure below.

Circuit diagram.

Temperature sensor LM35 is connected to the arduino through the analog input pins. A0 pin of the arduino serves as the supply voltage source for LM35 and A2 pin of the arduino serves as the ground. Arduino reads the voltage output of the LM35 through the analog input pin A1. Digital pin 4 is used for interfacing the °C/°F selector switch to the arduino. Digit driver transistors Q1, Q2 and Q3 are interfaced to the digital pins 1, 2 and 3 of the arduino respectively. Multiplexed segment lines a to dp are interfaced to the digital pins 5 to 12 of the arduino respectively. Resistors R9, R10 and R11 limits the base current of the corresponding transistors. Resistors R1 to R8 limits the current through the corresponding segments.

About the program.

The voltage output of the LM35 is scanned using the analogRead function. The analogRead function will read the voltage at a particular analog input pin and converts it into a digital value between 0 and 1023. If 30°C is the temperature, the LM35 output will be 300mV. The code value=digitalRead(sensor) will read this voltage, convert it into a digital value and stores it in the variable “value”. So, for 30°C the number stored in variable “value” will be 3oomV/(5/1023)=61. This number is multiplied by 5 to get 305 a decimal point is place before the last digit while displaying on the seven segment display.The result will be 30.5°C.

The program also checks the status of the unit selector switch by reading the digital pin 4. If this pin is held high the temperature is displayed in °Celsius and if this pin is low the temperature in °Celsius scale is converted to °Fahrenheit and then displayed. The method used for displaying the number on the three digit seven segment display is same as that of used in Voltmeter using arduino.

Can this project be modified to switch on a appliance like a cooler when the temperature reaches a certain point above a standard of eg. 25 and switch it off when 25 is reached again and switching on another appliance like a heater when the temp drops below 25 ? I’m specifically refering to water temp and the temp is measured with a temperature probe ? What would the circuit diagram look like and the software ?
Thanx in advance