Arduino remote thermometer

By | 14/05/2012

As part of our course at Haaga-helia (held by Tero Karvinen – this is my final project. Our project actually as this was done with my classmate Niko. So what we did is a “remote” thermometer. Niko has a LM35 thermometer on his arduino which is connected to his computer. The arduino sends the temperature to the serial port, from where a python program uploads it to the net. My python program retreives the information and sends it to the arduino through the serial port. Depending on the temperature the arduino will move the “indicator” to the corresponding position.

What we used:

2x Arduino uno
a LM35 thermometer
a micro servo
5-6 jumper wires

a cardboard box
a dvd
a knife

I used an Asus eee pc 901 (os: Ubuntu 12.04). Python came as default installation and the arduino ide is easy to install by opening the terminal and using the following commands:

sudo apt-get update
sudo apt-get install arduino

We started off by Connecting 2 arduinos to different computers in order to test our respective programs: transferring and receiving. You can find Niko’s code in his blog at The blog is written in finnish so you might want to use an online translator.

and here is my code starting from the python code fetching the data from the internet:

import urllib2 # Connecting to the internet
import serial # serial port (usb)
import time

ser = None

ser = serial.Serial("/dev/ttyACM0")
print("Serial port " + ser.portstr + " opened.")

response = urllib2.urlopen('') # get info # save info
html=float(html)#convert string to float (also known as double)

if html>=30:
	print("Receiving: %s" % html)
	print("Sending: 5")

elif html>=20:
	print("Receiving: %s" % html)
	print("Sending: 3")	

elif html<20:
	print("Receiving: %s" % html)
	print("Sending: 1")

And the actual arduino code:

#include <Servo.h>
char variable;
Servo servo;

void setup()



  //pinMode(13, OUTPUT); Test with a led. Now replaced with the servo.write -statements


void loop()


  if(Serial.available() > 0)


    variable =;

    if(variable == '1')


    if(variable == '2')


    if(variable == '3')


    if(variable == '4')

    if(variable == '5')




After the programs worked to our liking we decided to use a dvd disk as the indicator by taping it on the servo. As the case we decided to use a cardboard box.

We cut a hole on the box so that the dvd only shows a part at a time and drew some helpful pictures on the dvd.

To keep the servo in place we sliced a hole on both sides of the box to add a layer and taped the servo on it.

And a video of it working. In the video we change the values directly to the website instead of using the actual program in order to demonstrate the changes on the thermometer.

And more pictures of the project below:

One thought on “Arduino remote thermometer

  1. Pingback: Oma prototyyppi, Hellemittari! »

Leave a Reply

Your email address will not be published. Required fields are marked *