Room Temperature Measurement with Raspberry Pi

We have mostly covered all the Basic Components interfacing with Raspberry Pi in our Raspberry Pi Tutorial Series. We have covered all the Tutorials in simple and detailed manner, so that anyone, whether he has worked with Raspberry Pi or not, can learn from this Series easily. And after going through all the tutorials you will be able to build some High Level projects using Raspberry Pi.

room temperature measurement with raspberry pi
Room Temperature Measurement with Raspberry Pi

So here we are designing first application based on the previous tutorials. The first basic application is aĀ Reading Room Temperature by Raspberry Pi. And you can monitor the Readings on computer.

As discussed in previous tutorials, there are no ADC channels provided internally in Raspberry Pi. So if we want to interface any analog sensors we need an ADC conversion unit. And in one of our tutorials we have Interfaced ADC0804 chip to Raspberry Pi to read an analog value. So go through it before building this Room Temperature Thermometer.

ADC0804 and Raspberry Pi:

ADC0804 is a chip designed to convert analog signal in to 8 bit digital data. This chip is one of the popular series of ADC. It’s an 8bit conversion unit, so we have Ā values or 0 to 255 values. The resolution of this chip changes based on the reference voltage we choose, we will talk more about it later. Below is theĀ Pinout of ADC0804:

Now another important thing here is, theĀ ADC0804 operates at 5VĀ and so it provides output in 5V logic signal. In 8 pin output (representing 8bits), every pin provides +5V output to represent logic’1’. So the problem is the PI logic is of +3.3v, so you cannot give +5V logic to the +3.3V GPIO pin of PI. If you give +5V to any GPIO pin of PI, the board gets damaged.

So to step-down logic level from +5V, we will be using voltage divider circuit. We have discussed Voltage Divider CircuitĀ previously look into it for further clarification.Ā What we will do is, we use two resistors to divide +5V logic into 2*2.5V logics. So after division we will give +2.5v logic to PI. So, whenever logic ā€˜1’ is presented by ADC0804 we will see +2.5V at the PI GPIO Pin, instead of +5V.

LM35 Temperature Sensor:

Now for Reading Temperature of Room, we need a sensor. Here we are going to use LM35 Temperature Sensor. Temperature is usually measured in ā€œCentigradeā€ or ā€œFahrenheitā€. ā€œLM35ā€ sensor provides output in degree Centigrade.

As shown in figure, LM35 is a three pin transistor like device. The pins are numbered as,

PIN1= Ā Vcc – Power (Connected to +5V)

PIN2= Signal or Output (connected to ADC chip)

PIN3 = Ground (Connected to ground)

This sensor provides variable voltage at the output, based on temperature. For every +1 centigrade rise in temperature there will be +10mV higher voltage at the output pin. So if the temperature is 0ā—¦ centigrade the output of sensor will be 0V, if the temperature is 10ā—¦ centigrade the output of sensor will be +100mV, if the temperature is 25ā—¦ centigrade the output of sensor will be +250mV.

Components Required:

Here we are usingĀ Raspberry Pi 2 Model BĀ with Raspbian Jessie OS. All the basic Hardware and Software requirements are previously discussed, you can look it up in theĀ Raspberry Pi Introduction, other than that we need:

  • Connecting pins
  • 1KΩresistor (17 pieces)
  • 10K pot
  • 0.1µF capacitor
  • 100µF capacitor
  • 1000µF capacitor
  • ADC0804 IC
  • LM35 Temperature Sensor
  • Bread Board

Circuit and Working Explanation:

The connections which are done for Connecting Raspberry to ADC0804 and LM35, are shown in the circuit diagram below.schematic room temperature measurement with raspberry pi

For more detail: Room Temperature Measurement with Raspberry Pi

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Scroll to Top