Tag Archives: raspberry pi case

Cheap Raspberry Pi outdoor case

Here’s  a very cheap outdoor weatherproof case for the Raspberry Pi.

I’ve been experimenting with the AirPi weather sensor kit (available on Tindie). This is a lovely kit which comes bundled with an air-pressure, humidity, light, temperature, NO2 and CO sensors. The AirPi is fairly easy to solder together and comes complete with some nice software that automatically uploads your recordings to Xively. As it’s written in Python it’s also quite easy to see what’s going on – and the whole project is available on GitHub.

I did find that the software needed a bit of work (don’t expect it to be perfect out of the box), but it’s a good starting point – part of the Raspberry Pi adventure is about trying to come up with your own ideas and improving on the work done by others. It’s also particularly impressive that the AirPi was put together by an 18 year old in his spare time.

If the AirPi kit is a bit steep you can also hook up a DHT22 temperature and humidity sensor – there are tutorials available on how to setup logging on your Pi, and for about £10 you can put together a simple weather station that can take readings over time.

Since it’s more fun to take readings outside, I’ve been looking at weatherproof case options for the Raspberry Pi.

The white louvred boxes you sometimes see on street corners, outside science labs or in the middle of school fields are called Stephenson screens. These allow for the weather sensors to have air circulate around them and are carefully designed to minimise the effects of sampling error – by providing a standard way of mounting and housing scientific instruments.

As Stephenson screens are no doubt quite expensive (and my AirPi hasn’t been calibrated anyway) I’ve opted for a cheaper option, which also manages to include a few of the features of it’s more expensive counterpart. The key things I’m aiming for are:  standard (and repeatable), allows air to circulate around the sensors, and white and reflective.

Build guide

For a fiver from Wilkinsons (in the UK) you can buy a bird box which makes a cheap and effective weatherproof housing. You’ll also need a dremel (or similar small drill), some sandpaper, waterproof outdoor gloss paint, wood glue and insect netting.

Raspberry pi weatherproof case
From cheap birdbox to advanced weatherproof housing

This is a box made from softwood, so it’s very easy to work with – you can use a dremel or a junior hacksaw to make holes. The plate with the birdbox hole is removable, and the pi sits on top of a piece of cardboard which wedges inside. The spare bits of wood from the hole were used to make rests for the Pi mounting board.

I modified my AirPi kit slightly – first I adjusted the height of the header pins so that the board would fit on top of a modmypi plastic case – second I didn’t solder the light sensor directly to the board. Instead I soldered a couple of header pins to the board, and then a couple of leads to the sensor – allowing it to be fitted in a different place. In the image below you can see the light sensor mounted in a hole in the front plate – it sits behind a clear lego stud which serves as a little window.

The Raspberry Pi sits inside the box on a piece of board – I cut up the back of an old picture frame.

Depending on how you’re planning to communicate with your Pi (in this case a model A with a Wifi dongle) you might need to make a hole in the back of the birdbox for the USB to stick out. In my case the WiFi module fits snugly in the hole in the back of the bird box, which was then covered with a bit of board and painted. For power I used a low profile USB – micro cable which is hooked up to a USB terminal block inside the case (scavenged from an old digibox). The Pi is orientated inside the case so that the green and red LEDs are visible through the wide hole in the font. You don’t need to add all these bits, just bare in mind that the Airpi uses a lot of power and long USB cables might have a negative effect on your Pi’s power supply.

The measurements I used were as follows:

The board on the right fits inside the case
The board on the right fits inside the case

You might need to experiment with the materials – but the softwood is very easy to work with. You can buy wood filler if you make any mistakes.

Once you’re happy with the fit of the Pi inside the box, paint the whole thing with white glossy outdoor paint. To stop insects or anything else nesting in the box, wrap the front plate in insect netting.

How the Raspberry Pi + AirPi sits inside
How the Raspberry Pi + AirPi sits inside

Finally – test! – i’d recommend leaving the box in the rain (without your Pi) with some tissue paper inside just to check if there are any issues with water getting in. Obviously this can’t be 100% waterproof, but it’s good enough to leave your Pi on a windowsill or sheltered garden.

Raspberry Pi Camera Case – from a Holga

Here’s version 1 of the Holga Raspberry Pi Camera – a hackable, programable camera with a 5 megapixel sensor and HD video capabilities, in retro camera form.

My original concept was to do something like this:

Pi Camera Module camera case sketch
Everything and the kitchen sink

And I managed to build something like this:

Pi Camera Holga Case
And here’s how it turned out..

The Holga is an ultra-cheap medium format camera – if you shop around you can get one for about £15-20 – the model I used for this was the Holga Camera 120N (120 N) (Plastic Lens / Hot Shoe) with the Raspberry Pi Model A – although with a bit of modification it would work with the larger model B. Potentially by soldering the power supply and USB directly to the Pi you could make this a slimmer fit, but I wanted something that didn’t modify the Pi in any way.

The model A Pi fits quite well – you just have to remote the 2 plastic struts inside the case, and peel off the foam that secures the film reels inside the case. I had to remove the plastic panels that enclosed what would have been the flash (my Holga came without one). I cut up a cheap USB extension cable to mount on the top of the camera – and to plug into the side of the Pi. In order to make it fit with the right angled micro USB on the other side I needed to solder and make my own USB cable (you’ll need the shortest USB plug available – I used a poundland retractable USB cable as the source for mine).

If you don’t want to bother with the soldering you could probably just drill holes in either side of the case – there is room, and the plastic is easy to cut through.  

I also added a couple of plastic struts to locate the Pi in place – it’s a snug fit so doesn’t rattle around inside the case.

With the Pi removed you can see how it sits in the camera:

Pi Camera Case without Pi (rear view)
Here it is with all the wires

The yellow wires go to the flash hotshoe – the green to the trigger button on the side of the lens housing, and the red to the power button.

Pi camera case with Pi fitted
Here it’s sitting in it’s case. Snug.

The camera module sits inside the lens with the ribbon cable carefully wrapping around the board and over to the socket – I experimented with Sugru to hold the camera board in place (which would work) but wanted it to be removable, so opted to cut up a piece of spare plastic and drill a hole for the module to peek through – it’s a fairly firm push fit which holds it in place. The lens can still be rotated a little to make it easy to level the Pi camera.

For the power switch I used the same circuit as for the Motorola Lapdock, and added it to the lens mount. I’ve also added a press button on the other side to use to take photos – this will be (eventually) wired to the GPIO.

Pi Camera Detail
Here’s a closeup

Despite it’s cheapness the case feels solid – most of the modifications could be done with a sharp craft knife, apart from a few places where the plastic was thicker or I needed to make holes and a dremel was needed. There’s a lot of empty space inside this case so plenty of room to add things later (I wanted to add a speaker and a few other outputs and inputs, so will do later..)

Overall this was a fun project – all the messy cables and glue are neatly hidden (I went a bit overboard on the glue gun when soldering my USB extension cable) and the case was fairly easy to work with.

The case also has a nice screw mount for a tripod – handy for securing the Pi with camera to things.

Making it more than ‘just a camera’

Replicating a simple Camera with the Pi and Holga (HolgaPi? Piga?) would be a bit boring so my aim with this project is to provide a nice case with the possibility of extending it beyond what I could achieve with a normal compact camera.

At the moment the GPIO isn’t connected to the shutter button or flash trigger – i’ll do this next and write up the method in another blog post.

Things to do:

  • Think of a name
  • Calibrate the viewfinder
  • Write / find some code to make the camera operate over a network. As it lacks a screen the idea of putting all the camera controls into a web app makes sense
  • Add an LED indicator to the viewfinder
  • Add a speaker and think of some sound effects for the camera to make
  • Make use of the flash hotshoe (I’m thinking of using an opto-isolator for this, as some flashes have high trigger voltages running through them)
  • Add some more inputs – this could make the basis of a camera trap. Would be fairly easy to make this rainproof. As it is it would work with a Makey Makey…
  • Write some code to make the GPIO stuff work. I’m relying on this blog post to learn how.
  • Spray it red / green to match with the Pi look, neaten up the lens mount where the glue has discoloured the plastic
  • Investigate batteries or solar power
  • See if I can add a filter mount
  • Send a detailed proposal to the Lomo people to ask them to make a modified Holga case for the Raspberry Pi

Update: check out the following posts in the series.