What is home automation? What is the internet of things?
Basically, if any electrical appliance at your place starts working on its own whenever required, without any physical human prompt, then that is called home automation. Imagine a situation where the temperature of your living room goes high and you feel the need to turn on the fan. You need to stop whatever you are doing and get to the switchboard on the wall and switch on your fan. What if a device does this job for you? Now that’s  really cool isn’t it?! The way I see it,  it is medieval to have to get up from your couches just to turn on fans!

This edition’s DIY is about calculating room temperature using LM 35 TEMP sensor and Arduino. And also to make an LED glow whenever the temperature rises above a certain value.

Let’s get started!

Things you need:

  1. Arduino Uno
  2. Arduino Uno Connector
  3. Bread Board
  4. LM 35 TEMP Sensor
  5. LED pin
  6. Jumper Wires
  7. PC with Ardunio IDE

How to connect :

board

  1. Hook the 5 V power supply pin on Arduino to Breadboard
  2. Hook the ground pin on Arduino to Breadboard
  3. Take the LM 35 Temp Sensor , which comes in a 3 pin TO- series package ,fix it up onto the breadboard
  4. Connect the LM 35’s Power and Ground terminal pins to the 5V and ground pins on the breadboard, which was branched out from the Arduino Uno in Steps 1&2.
  5. Connect the middle pin of the LM 35 sensor to one of the Analog Input ports on Arduino, say A0 pin.
  6. Connect the LED pin’s positive terminal to Digital PIN 13 and the negative terminal of LED to the Ground terminal above PIN 13.
  7. Make sure the connections are accurate and aren’t loosely made.
  8. Connect the Arduino board to your PC from where you will be coding.

How to code:

You’ll need to Download Arduino Open Source Developer IDE Software for this! You’ll find the download and setup procedure in the link below:

http://arduino.cc/en/Main/Software

Make sure you download the compatible setup file for your OS and System Properties. After the Arduino IDE setup is done, open the Arduino IDE shortcut on your Desktop. You’ll see a screen like this.

Capture

After coding on this file, all you have to do is verify  and upload  and you’re good to go!

Writing your Code:

Aim of the code is to define input & output variables and calculate the analog input which is coming from the analog input pin and convert it into degree Celsius format and display the temperature. Also if the temperature calculated rises over a given threshold value the LED should glow! The temperature value should be measured every 3 or 5 seconds, as per convenience.
This is the code you will be typing out on the IDE.

roomtempsAfter uploading , you can view the working on the serial monitor.
To open serial monitor, go to Tools->Click on Serial
Monitor (or) simply press Cltr+Shift+M on your keyboard.
To raise the temperature of the sensor, simply place your finger over the sensor for the temperature to gradually rise up.
Once the temperature reaches critical value (in this case, 27  degrees Celsius), you can notice that the LED glows.

This is how a simple temperature monitor can be made using a sensor and an Arduino board! Have Fun!

Share this on: