This broken old Merlin handheld game is now a tactile, practical case for a Raspberry Pi High Quality Camera.
The interchangeable camera lens peeps out from what was the battery cover on the rear, and on the front, the matrix of buttons has been replaced by a HyperPixel four inch capacitive touchscreen. Still, video, timelapse and slow motion modes are all available on the colourful touch menu, as well as the option to bulk-upload the captured photo and video files to Dropbox.
Additional touches include a handy tripod mount in Merlin's base, and hardware buttons to manually capture images and video.
Lockdown TeardownOrdinarily my projects are inspired by finding a piece of Old Tech at a secondhand sale or in a charity shop, then building around it, but right now that's not really an option. When I heard that a new Raspberry Pi High Quality Camera module had been released I wanted to make a project with it straightaway, so after quickly placing my order I had to dig through what I had "in stock" in the workshop to provide the outer case.
This old Merlin was definitely the right choice - really tactile and just the right size to fit in the camera module, a full sized Raspberry Pi and the HyperPixel touchscreen I've been sitting on for several months.
The case came apart really easily, just two screws and some snaps, leaving me with the broken old internals - interestingly the original buttons were a membrane type, like you see inside computer keyboards.
Fit the ScreenAt this point I was still waiting for the camera to arrive, so I began fitting the touchscreen into the case.
Firstly I had a blast with the rotary tool and cutting disk, I find this to be a great way to chop away sections of plastic with pretty decent accuracy - I definitely erred on the side of caution this time though and left myself lots to file away around the edges.
Still, I had plenty of time, so it was a pleasure filing down the hole to just the right size for the screen. Before glueing the screen in place I wired two push-buttons to its breakout connections - the Hyperpixel screen uses literally every available GPIO pin, so this was the only way I would be able to attach hardware buttons to the Pi.
Touch CodeI knew I'd need some kind of user interface, so I began my research with Dan Aldred's Night Vision project - I remembered he'd used a Hyperpixel touchscreen, camera and Guizero together so it seemed like a good place to start.
My final code doesn't bear much resemblance to his, but it definitely pointed me in the right direction! Importantly it turned me on to Guizero, which is a real delight to work with, it's straightforward and powerful, and helped me create a functional, good-looking camera menu in Python, in a couple of hours.
To help transfer the captured images to other devices I also added in a script to synchronise the capture folder with DropBox. This sounds tricky but I used an exact copy of the example file from the Dropbox Python SDK - and it worked straightaway (launched from the Guizero script using Subprocess) - all I had to do was add in my Dropbox OAuth2 access token - very satisfying.
After setting the main Guizero menu script to run on startup, I also added in a small additional script to handle the hardware button presses.
The new camera module arrived partway through my menu-building, and at that point I realised that deciding to use the touchscreen had been a (completely by accident) fantastic idea - with the high quality camera you need to adjust the focus and exposure for almost every shot, and having the nice big screen built-in was a real help.
One of my favourite parts of the menu is the "focus" option, which just shows you the camera preview for 15 seconds while you get the focus just right.
The other brilliant thing about the Guizero menu is that you can use it over a VNC connection, turning your cellphone even into a full-on remote control. I often use this setup when trying to bathing birds on camera, watching out of the window with controls at the ready.
All of the code mentioned above is on GitHub - It's a fully working version, but on my local build I'm changing the menu options practically every day at the moment, I may even add in another row of icons soon to cover things like long exposure and timelapse shots.
Fit the CameraThe camera finally arrived and for once I thought I was organised - the rest of the build was complete, all I had left to do was fit it and start taking photos. You can see where this is going.
I had my 35mm "lego tree" drill bit all ready to cut a hole for the camera in the Merlin's rear battery cover, but then I had the bright idea to remove the label from it first, you know, to make it a neater job. And of course the best way to remove a label is to pop the part into hot soapy water. Turns out my water was waaaay too hot, and the battery cover curled up like a fortune-telling fish. The label came off of course, but the part was destroyed in the process.
So now I had to build a new bracket to hold the camera module. Digging through some boxes I found a screen from an old and very broken LED game, which was roughly the right size. After cutting the hole and filing it to shape I then fitted the camera with small bolts and used Sugru mouldable glue to fix the assembly securely to the case. It actually looks quite cool, being partly see-through, but I'd definitely have preferred to stick with the original plan. Lots of lessons learned!
Buttons & ExtrasAlthough the Merlin case wouldn't have been my normal first choice, I was determined to make it work well practically.
Adding in the physical buttons really helped with this - the touchscreen controls are great, but when holding the Merlin Pi with two hands it's really satisfying to be able to start a capture with a thumb press, and not have to look at the screen.
I also added in an on/off toggle switch for the power. I'd originally hoped to have a battery inside the case, as I did with the Apollo Pi, but soon realised that realistically the Merlin would be mostly either plugged in to the mains, or attached to a large external battery pack (for example when being used as a camera trap).
With that in mind I wired in a panel-mount Micro USB socket to the case, connected to the Pi via the toggle switch. This made it nice and easy to switch power supplies, and I found that a 10, 000 mAh USB would last for a full day of birdbath-monitoring, even with WiFi attached and occasional uploads to DropBox to make sure the focus was set properly.
Lastly I stripped a tripod connector from an old flash gun and added it to the Merlin's base - this was a hugely worthwhile addition, and being able to easily switch tripods has been a big help, especially when setting the camera up around the garden.
AssemblyIn a break with tradition the assembly went quite smoothly, the most fiddly part was connecting up the camera cable while simultaneously holding the two halves - that little connector always feels really fragile!
One of the best things about this build was its relative simplicity, not too many interconnected things and a very straightforward case - it clipped together straightaway and was secured with the two large bolts. I've had it apart a couple of times since the initial assembly to make tweaks and had no drama at all. I have several projects I wouldn't even dare remove screws from, so it makes a big difference to know I can go back & make changes at a later stage.
Never FinishedThe main objective of the Merlin Pi was to build a user-friendly case as quickly as possible, so that I could get on with the really fun part - messing about with the new High Quality camera. Overall the project turned out a lot nicer than I expected, the screen was an absolutely perfect fit and even the disaster of the melting battery door didn't ruin the appearance too much. (I'm still keeping my eyes peeled for another broken Merlin though to re-do it)
I love how its character changes depending on what tripod it's connected to, I used a long-legged one for some garden captures and it looked like some kind of strange red bird stalking the garden. It also frightened off most of the nature, prompting a rethink and some camouflage. I hope to mount it on my car at some point for some fast(ish) moving video, and I'm sure there'll be lots of other situations to try out the camera.
I haven't said much about the camera itself - from the little I've seen so far it's a huge improvement over the previous versions. I've captured some photos I'm very proud of (a pile of bacon rind in perfect focus is my favourite) and the video quality seems smooth and sharp - it's definitely not an instant point & shoot but it pays back in quality any investment you make with time & effort.
Thanks for reading and stay safe everyone.
My other Old Tech, New Spec projects are all at https://www.hackster.io/martin-mander/projects
More details are on the website at http://bit.ly/OldTechNewSpec. and I'm on Twitter @OldTechNewSpec.
Comments