A Temperature Sensor with Arduino

After getting the Arduino Uno for Christmas last year, I set about doing what every geek does after getting bored of the usual blinky blinky pin 13 stuff, and started thinking about what I could do with it that was cool, and maybe even useful.

I decided to make a temperature sensor, using the cheap and easy-to-use LM35 integrated circuit, which is a compact package that looks just like a transistor.

LM35

LM35

It offers a linear 10mV per degree C voltage change with temperature and so requires minimal mathematics to covert the analogue input into a temperature reading.

The current temperature, and a running minimum and maximum are displayed on an LCD display (using the LiquidCrystal Library), with the pushbutton allowing the maximum and minimum to be reset. The temperatures are calculated using a circular buffer providing a running mean value over 10 samples.

SD card hack

SD card hack

The project also writes the temperature values to an SD card using the SD Library, which was attached via an awesome hack I came up with involving soldering a pin header directly to it, although in this case it’s a micro-SD adaptor to allow for changing the card more easily. The pinout is almost exactly lined up to make this hack work!

 

Temperature Sensor

Temperature Sensor

What I like about this project is that it combines all the usual cool things a beginner would want to do with their Arduino. Sensor reading, LCD screen output, SD card read/write, and button capture (which will be done with an interrupt, when I get a chance to do it).

The code, and Fritzing schematic, can be found on my GitHub page.

About Tris

Tris is a software engineer with a PhD in image analysis. He likes real beer, photography, electric guitar based music and Unix operating systems.
This entry was posted in Arduino, Hardware. Bookmark the permalink.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>