Raspberry Pi temperature (and humidity and pressure) logger – full instructions!

A while ago I reported on progress towards a Raspberry Pi based environmental logger.

Well, it has proved to be quite popular at work (several laboratories now use them to log temperature and humidity values for around £100 each device) so I wrote up pretty much all the instructions on how to build one (including the necessary software installation and case details).

Here are the instructions (Word file, PDF file)

Here is a diagram of the stripboard layout (and here is the Fritzing file for it). Note this is shown with the copper tracks uppermost whereas in reality they are underneath the board).

Enjoy!

 

 

 

 

 

 

 

 

 

Work on these loggers was mostly in my own time, but additional inspiration and funding came from the EMRP project ‘LUMINAR‘. The EMRP is jointly funded by the EMRP participating countries within EURAMET and the European Union.
emrp_eu_small_logo

luminar_logo_small

Main site moves into the blog

I decided that the main Jartweb site (actually on the same servers) was looking a bit old and tatty, plus it did not behave properly on browsers on smartphones and tablets, so I decided to copy across the old content into the blog, creating new pages for each item.

When I get a moment, I’ll replace the original pages with redirects to the new blog pages and hopefully work out how to do the photo galleries properly as they don’t work at all in mobile browsers as they use a whole range of outdated tech.

Fingers crossed!

Warm May Bank Holiday weekend again

Is the weather this year repeating that of last year?

In preparing this post on the latest riverside walk, I noticed another post from almost the same date last year. The similarity being the nice sunny warm weather in May. This time last year the weather was nice and sunny in early May then cooled off and became rainy for early June. Will it do the same again this year?  The BBQ planners need to know…

Raspberry Pi temperature logger

Raspberry Pi (boxed) temperature logger

OK, so a while ago I built a little temperature measuring system using an Arduino Uno, an Arduino ethernet Shield, a real time clock module and some digital 1-wire temperature sensors. I hooked up a serial interfaced LCD display to display information such as IP address, time, date and the temperature readings and sat it running and logging data to a micro SD card.

Where I left the post, I was planning on implementing more functions to the system, basically to serve web pages containing graphics (temperature charts) as well as store data and to implement an email alerting system.

But I ran into a basic problem that is the limited memory on the Uno. From yesteryear I remembered doing some Z80 assembler programming and writing some BASIC programs on a Sinclair Spectrum with only 32 kB of memory. I think that probably led me into a false sense of freedom on the Uno; with my skills limited to programming in wiring, I just could not cram in all the functions I wanted on this small device.

Truth be told, the Uno was really a stopgap whilst I was waiting for my Raspberry Pi to be delivered.

Well, now it’s here, or rather they are here, as I ended up buying two. Well, actually three, but the last one is owned by work …

I decided that the best way forwards with the higher resolution temperature logger/server project was to do it all on a Raspberry Pi. I bought one to start playing with and then realised that some of the configurations I had set up on the Pi had to be changed to trial alternative software hardware solutions and rather than keep changing the same single Pi, I bought a second one to experiment with. This also let me take a Pi away for Xmas leaving the other one running 24/7 to continue logging, as a sort of unattended test.

Having arrived at the optimum software/hardware configuration, I got work to order the various parts from their main electronics supplier (RS) and then built a copy if the optimised system for them, modifying the SD card contents to match the IT systems at work (and getting permission from the IT department to connect the device). So now three Raspberry Pis are running different versions of my system, two at home and one at work. All three log temperatures. One logs my router and itself (!) as well. That was my first Pi and the one that I crammed with most trials.

All three Pis are running Raspbian, generally the latest version (2013-02-09) but Pi1 is lagging slightly behind on the updates. For some reason, I had issues getting it to accept the main updates via sudo apt-get upgrade – it tended to red-light (the Pi’s version of BSOD) after restarting. I might try another upgrade soon after taking an SD card backup.

Pi1 is running MRTG and CACTI, for data capture. It interfaces to a pair of DS18B20s via a breadboard and to the same Sparkfun serial interfaced LCD (PPLCD-09395) that I used on the Arduino.

Pi2 is running a modified version of the code from NETTEMP for data capture, and display. A single DS18B20 is interfaced using a 1-wire to USB adaptor from Sheepwalk (model: DS9490R). At the moment, NETTEMP requires a device like this since it relies on Digitemp for its 1-wire interfacing. It also runs an experiment using Dygraphs to produce a zoomable temperature graph.

Pi3 is running CACTI for data capture, a pair of DS18B20 temperature sensors (RS: 5402805), a 16 x 2 LCD display (RS: 5326436) and sits inside a slightly too large plastic box (RS: ) which our nice engineering team machined to fit the ethernet and USB sockets of the Pi and a cutout for the LCD screen. A couple of extra holes for the sensor cables and a hole for the USB power lead complete the hardware. Inside the case, the LCD is connected to the GPIO using a 26 way ribbon cable and push fit IDC connector. Several of the ribbon wires are separated (torn away…) to connect to the DS18B20s in a rather amateurish way. So I don’t think I’ll be showing pictures of that bit of the build !

More about the choices behind the various hardware/software options will follow in a later posting. Essentially, I was trying to find a system that had all the functionality I needed but that would also be robust, maintainable, scalable, and usable by people other than me.

PS if anyone is looking for a nice engineering/kickstarter project for the Raspberry Pi, I would love to see the following case:

Big enough for a Pi and a display (e.g. 16 x 2 LCD, 16 x 4 LCD, small display screen).
Nice material, perhaps aluminium.
Ability to mount to something (e.g. magnetic back plate, plus wall mounting screw holes).
Integral PSU or moulding for USB power lead to the socket on the Pi with cable relief gland.
Light pipes for the LEDs.
Some form of breakout connector for the GPIO pins.


There are several nice cases out there, but few of them are much bigger than the Pi itself, meaning there is no room to mount other items in the case, such as an LCD display and the necessary cabling. I really would like a case that fits all of the above hardware inside in a neat and tidy fashion, and lets the case mount somewhere. For home use, I would like a really nice looking case, perhaps something like the Proto Armour Raspberry Pi Enclosure Kit which has almost everything I want, except the extra room for the display, same with this case from PiHolder.com (both these are USA based but ship to Europe, but I’m wary of the import duties and tax on such items).

 

Anyway, time for a few pictures from the logs.

 

Monthly temperature plot from modified Nettemp code - click to enlarge

 

2 DS18B20 temperatures tracking each other (from Cacti)

 

snr Traffic Graph

MRTG's ADSL modem SNR ratio - oh dear, what happened at 7 pm?

 

 

Raspberry Pi - load average (from Cacti)

 

Finally a rather large graph generated by Dygraph, based on a simple text file data store, updated every minute:

 

Dygraph temperature plot - click to enlarge

 

 

Thames Clipper

A few pictures from a round trip on one of the Thames Clipper ferry services. This was an exceptionally warm afternoon in May 2012 a week before the rainy Diamond Jubilee celebrations on the same river! The Thames Clipper service is a nice way to travel along the river from Westminster end, out as far as Woolwich arsenal. For the stretches after Tower Bridge, the speed is de-restricted and these powerful boats really rip along the water – there is an amazing deceleration as the engines are cut on approach to each pier.

Well worth a trip on one – work one into your schedule for a day’s sightseeing – or even buy two tickets for the round trip and stay on the boat the whole time, admiring the views.

 

 

 

 

 

 

 

 

 

Here are some videos to show the speed of the Clipper when not under speed restriction:

Clipper (1)

Clipper (2)

Clipper (3)

More TV … brace yourselves

As part of a new BBC4 series on Measurement, a film crew has been working at NPL, filming various items for the three hour-long episodes. The presenter of the series is Marcus du Sautoy, and he and the film crew spend some time with me in the dimensional metrology laboratories, filming some interviews and some interesting items of equipment.

Marcus du Sautoy and me, with Nanosurf 4

Marcus inspects Nanosurf 4

The series aired on BBC4 in early summer 2013 as the 3 part series ‘Precision: the measure of all things’.

Fortunately for the viewing public, my scenes were left on the cutting room floor 🙂 Apparently they filmed far too much to be included and had to perform severe edits to fit the running time.

You lucky people…!