On day 2 of Raspberry Pi Camera ownership I decided it was time to make the new RasPiCam into a camcorder that could be taken anywhere and used to shoot video.
Hold on, there’s issues with that aren’t there? Sure there are, but there’s ways round ’em too ;) So here’s how I did it.
I’ll be taking this to the Cambridge Jam tomorrow. :)
- 1 Switching regulator
- 1 Bluetooth serial adaptor
- 1 Raspberry Pi with latest updated Raspbian
- 1 Raspberry Pi Camera
- Connectors for battery, reg and Bluetooth adaptor
- 1 power source (I’m using a lipo battery)
- 1 Bluetooth-enabled mobile device (Phone, tablet etc.)
- 1 Bluetooth console app (I’m using BlueTerm for Android)
- a case of some sort to put it all in
So here’s the end result including a comparison with a “proper” camcorder costing 10 times as much. ;)
No screen – YET
I don’t have a screen for it yet, but I hope to fix that in the near future. :)
OK. On with the details…
First hurdle for independence is we need power. 5V can be supplied to the GPIO header, where there are two 5V pins (good – we need both of those) and several GND pins.
Since I want an efficient power conversion, and since I have a stack of lithium polymer (lipo) batteries already, a switching regulator is the best option. I bought a stash of these on ebay back in September 2012. They’re a couple of pounds each (£2/$3). Google LM2596S regulator to find them.
Wires are recycled from an old PC. I have a box full of wires. I used a couple of 2 pin female header connectors to attach the power wires on the regulator outputs…
I’m using Pin 25 (GND), and Pin 2 (5V).
I set the voltage of the regulator to 5.20 V, which is near the top end of the spec, but gives us a bit of headroom. I’ve connected the regulator inputs to red and black wires and a male Deans type connector. All my lipos have female Deans on. It would be nice if we could fit it in the case too. A bit of heatshrink to insulate it and we’re sorted. (See regulators photo at top)
OK, so we’ve got power. Now hurdle 2…
How are we going to control it?
You could use wifi, but you need a network or a portable hotspot for that. You only really need a command line interface, so a BlueTooth serial adaptor fits the bill perfectly. It just so happens I got one last Saturday and got it working within about half an hour, thanks to an excellent blog article by Miguel Grinberg
It’s nice and small, so I figured it could go in the case. How to connect it though? Remember the leaning header of Pi5A? I had all sorts of header connectors in stock from that, so I picked out a 2×4 female angled header and soldered up the connections. I got it wrong twice, not remembering I needed to cross Tx and Rx and messing up GND and Tx as well, but once I’d got that correct it was OK. The last two pins on the Bluetooth adaptor need to be crossed over, so I had to snip the connector and use a couple of small wires. (See labelled photo above for connections).
I advise you get your Bluetooth adaptor set up and working with jumper wires before soldering things to it.
So we now need an app on our mobile device to be able to log into the Pi via Bluetooth. I’m using BlueTerm. It’s OK, but I can’t yet get it to send a CTRL+C signal, which can be a bit limiting.
Raspberry Pi, RasPiCam and fully updated Raspbian
You need the latest Raspbian on your Pi to be able to use the camera.
sudo apt-get update
sudo apt-get upgrade
Then wait until it finishes. Could take a while (maybe nearly an hour if your distro is old). You’ll also need a Raspberry Pi Camera module.
Just in case
I crammed my regulator into my Yoctopuce case. It just fits. I was hoping to fit it in so it wouldn’t cover the main CPU/GPU/RAM, but it wouldn’t fit. So chances are it might get warm with a source of power and a source of heat so close together. The only thing I can do about that is to take it out. If it becomes a problem, I will.
The Bluetooth adaptor fits well. The camera is “white-tacked” to the back. Liz told use to use Blu-Tac, but I disobediently defied because white was all I had :p
My concept was that it would all fit and the case could stand on end (the USB end) when no wifi dongle is plugged in. To achieve this I did have to press in the two little sticking out “lugs” on the USB hub.
It was tricky getting the case back together with all these bits inside, but somehow, with a liberal sprinkling of cursing and swearing, I got it done. (Sorry, I’m not disassembling it again for the photos :p ) Here’s what it looks like…
Plug and Go
So now all I have to do is plug in a battery (anything from 6 to 35V will work with this regulator) connect my phone or tablet using BlueTerm. Login, and start shooting video.