Analog temperature detector using uA741 OPAMP

What is an “OPAMP”?

Fig1 (b)

An operational amplifier (or an op-amp) is an integrated circuit (IC) that operates as a voltage amplifier. An op-amp has a differential input. That is, it has two inputs of opposite polarity. An op-amp has a single output and a very high gain, which means that the output signal is much higher than input signal.

opamp

Vout = AOL[(V+) – (V-)],

Where AOL = Open loop gain of opamp

 

 

Ideal characteristics of a OPAMP:
1. Opamp has high input impedance & low output impedance.
2. Zero common mode gain or infinite common mode rejection.
3. Infinite open loop gain AOL.
4. Infinite bandwidth.

** opamp is used as differentiator, integrator, comparator, current – voltage converter, voltage- current converter, etc.

Parts List for the circuit :

1. IC LM35, Opamp (LM741)
2. Resistance- 10K, 470 ohms(2), 2K pot.
3. LED (red, green)
4. Wires
5. Bread board
6. Digital Multimeter
7. 12 v Battery

“HERE IN THIS PROJECT WE USE OPAMP AS A COMPARATOR”

Fig2
Circuit Diagram of the project & -Vcc should be grounded

Theory: This project uses IC LM35 as a sensor for detecting accurate centigrade temperature. Linearity defines how well over a range of temperature a sensor’s output consistently changes. Unlike thermistor, linearity of a precision IC Sensors are very good of 0.5°C accuracy and has wide temperature range. It’s output voltage is linearly proportional to the Celsius (Centigrade) temperature.

The LM35 is rated to operate over a -55° to +150°C temperature range. It draws only 60 µA from its supply, it has very low self-heating, less than 0.1 °C in still air. LM35 Operates from 4 to 30 volts. Output of IC is 10mv/degree centigrade. For example if the output of sensor is 280 mV then temperature is 28 °C. So by using a Digital multimeter we can easily calculate the degree temperature. For trigger point you should set the voltage of pin 2 of IC 741 by using preset or potentiometer. Our aim of this project is not to construct a thermometer but to activate or deactivate a device at a particular margin temperature. For simplicity we have used 2 LEDs for indication of both low (Green) and high (Red) temperature.

Working principle: The output of IC2(LM35) increases in proportional to the temperature by 10 mV/°C , this varying voltage is feed to a comparator configuration of IC 741 (OP Amplifier). At first we set sensitivity (set a voltage by varying the 2KΩ pot) at pin no.2 . If we consider that the sensitivity voltage as V1 & The output of LM35 (pin no. 3) as V2, then we can describe easily that what is happening. If voltage V1> V2 ,then the output of the comparator at +Vsaturation , then the green LED is on and the red LED is off. When the temperature increases that the output of LM35 is also increases, after a certain time when voltage V2 cross the voltage V1 then the output of the comparator at –Vsaturation , then the red LED is on and green LED if off. When V1=V2 then the output is 0 and two LED is in off state. We have used IC741 as a non-inverting amplifier. As a comparator the output voltages will be

                                   Vout  = +Vsat   when V1>V2
                                               = -Vsat    when V1<V2
                                               =  0           when V1 = V2 

Fig3
Bread board setup
Written by : Sourav Tamli 

Interfacing LM35 temperature sensor with Arduino

Previous post describes what a temperature sensor is & about how to test the well known & well available analog temperature sensor in the market, the LM35 temperature sensor.

This article will describe how to interface LM35 with Arduino, a well known open-source development platform. There are many versions of Arduino available in the market. We are using Arduino UNO board here. It contains a micro-controller ATMEGA328, the brain of the platform, six numbers of Analog input pins, 14 numbers of digital pins out of them 6 numbers of pins are PWM ~ (Pulse Width Modulation) pins.

Arduino UNO R3
Arduino UNO R3

INTERFACING:

LM35 has three pins, pin no.1 is +Vcc, pin no.2 is Output & pin no.3 is Ground. As it is a analog temperature sensor so the output pin of the LM35 will be connected to the Analog Input pin of Arduino. Other pins to the 5V & GND pin. 

temp

pin

The hardware part is done.

Coding Part:

Coding part of this is simple. We will use the Serial Monitor to visualize the response of LM35. Later interfacing another display like LCD or 7 segment LED with the arduino we can also make this project more compact.

code
Code for this project
  • float temp : “temp” is a float variable
  • int tempPin = 0 : declaration for the Analog Input pin(A0)
  • Serial.begin(9600) : declaration for the Baud Rate of the serial port which is 9600.
  • temp = analogRead(tempPin) : the function analogRead is to read analog data from the tempPin
  • Serial.print() : To print something in the serial port
  • temp = temp * 0.48828125

0.48828125 where this number came from??

This is (+Vcc * 1000 / 1024) / 10

Where  +Vcc is the supply voltage = +5V, 1024 is 2^10, value where the analog value can be represented by ATmega the actual voltage obtained by VOLTAGE_GET / 1024.

1000 is used to change the unit from V to mV & 10 is a constant as each 10 mV is directly proportional to 1 Celsius in LM35.

So (5.0 * 1000 / 1024) / 10 = 0.48828125.

Now connect the Arduino to the PC, open the arduino software and upload the code to the arduino. Now press Ctrl + Shift + M, this will open the serial monitor & you can see your room temperature. Done!

serial data
Serial Data

Analog Temperature Sensor

Active Analog Temperature Sensors :

There are varieties of analog temperature sensors around us. The main function of a active analog temperature sensor IC is to provide an output as voltage which is proportional to the temperature of the surroundings. Few of them are LM34, LM35, TMP 35/36/37, MCP9071 etc. These devices does not require any external calibration. A simple ADC (Analog to Digital Conversion) required for digital processing. 

 

Quick overview on the LM35 Analog Temperature Sensor

 

lm35
LM35 Temperature Sensor

 

  • Low cost, well available Analog Temperature Sensor
  • Calibrated directly in ° Celsius (Centigrade)
  • Linear + 10 mV/°C Scale Factor
  • 0.5°C Ensured Accuracy (at +25°C)
  • Rated for Full −55°C to +150°C Range
  • Low Self-Heating
  • Low impedance output, 0.1W for 1 mA Load
  • Operates from 4 to 30 V
  • Also suitable for Remote Applications

 

 

 Pin Configuration : Pin 1 : +Vcc (4 to 20 V ) , Pin 2 : Output, Pin 3 : Ground (GND)

LM35 pinout
LM35 Pin Configuration

 

 

 YOUR OWN DIGITAL THERMOMETER

It is very interesting to work with new things, when a primary stage of testing success brings mental satisfaction on the work & we go for more advanced implementation which increases the knowledge & allow us to think and face practical.

As LM35 is calibrated  directly in ° Celsius (Centigrade), so using only a multimeter it can be used as a digital thermometer for both Basic Centigrade Temperature Sensor & Full-Range Centigrade Temperature Sensor. Fig. 1 & Fig. 2 describes the circuit for those.

 

circuit 1
Basic Centigrade Temperature Sensor
circuit 2
Full-Range Centigrade Temperature Sensor

 

The Basic one on the breadboard

circuit
Breadboard Setup

Breadboard wiring

 

insulation
Use heat sink tubes for insulation between three pins

Time to test!

room temperature
Normal Room Temperature which is 32.8 ° C
increase
Increase in room temperature when a hot object is placed near the sensor (36.3 ° C)
Decrements
Temperature decreasing to room temperature when hot object is removed

Leave a reply if I missed anything!