Hi everyone. I recently took part in an episode of The Pi Cast from Tom’s Hardware during which I presented my latest project: a Mini (or Tiny!) Raspberry Pi Cyberdeck. You can see the full episode below. Of particular interest is, around the 56s mark, I show how small this really is – Banana for scale!
I thought it would be worth blogging about the build, showing you what I used to make the thing and some of the challenges I faced while doing so. I should say that I thought about doing this after seeing someone on Reddit do something similar, but not quite as small (I’ve lost the actual post now!). And, of course, I was inspired by Brian Corteil’s fine example of a Cyberdeck that is an altogether larger, more sophisticated project which you can see below:
Bill of materials
- Innox Varicase 1 (mini flight case) – now discontinued – size: 180mm x 110mm x 55mm. Closest ones I can find now: JoyFan (Amazon); MayYou (Amazon). I make no guarantee about the quality or reliability of the Amazon sellers – they just happen to be the same size.
- Raspberry Pi Zero 2 W. (Or from The Pi Hut – I wanted some other bits from Pimoroni, so I got the Zero 2 from there.)
- Turnigy 2200mAh 3S 25C LiPo Pack. (Don’t forget to grab a LiPo charging bag if you need one!) I had a charger from previous robotics projects.
- LiPo battery monitor (for making sure you don’t run the battery down too low).
- XT60 connector to connect to the LiPo to take the power.
- Pimoroni Enviro+ (although, the basic Enviro will be fine, too – I already had the +)
- Waveshare 5 inch HDMI display (the one I have is a bit older. I liked this one because the HDMI and USB ports were on the same side). Also from Waveshare. Basically, you want one where the Pi does not mount on the back of it.
- 64GB microSD card (get a decent one – this is a Pi Zero 2 W we’re working with, not a super-fast machine, so give it all the advantage you can!)
- Rii K01 2.4Ghz mini wireless keyboard (the sort that comes with a USB dongle, not the Bluetooth version – I’ll explain why later). There are lots of different versions of this one – lots of languages. Make sure you get the one you want!
- Adjustable step-down buck module (this converts the LiPo’s power down to 5.2V-ish for the Pi).
- Rotatable 3-port USB hub.
- Short USB cable.
- DIY HDMI parts – Right-angled mini plug; Ribbon cable; Straight HDMI plug
- Power toggle switch – one like this will do. I had a batch of red ones.
- Momentary button (non-latching). You can use pretty much what you’ve got in your parts – I had one of these.
- Multistranded silicon wire (better than single-core or bell wire for flexibility, and you need the flexibility in the little flight case!).
- Heat wrap for the wires.
- A fuse (I bought a kit containing several different ones) to protect the LiPo.
- Soldering iron.
- Side cutters.
- Heat gun.
- Drill (eventually!).
Getting the Pi Zero 2 W and powering on
The first thing to do was to get hold of another Raspberry Pi Zero 2 W. Not easy post-pandemic, but I did manage it eventually! Keep an eye on rpilocator.com for now – or follow them on Twitter/X for alerts. I then to hooked it up with all the various cables one needs for the Zero, put Raspberry Pi OS onto the SD card and booted it up.
You can see how small the flight case is in the picture above!
The next thing I needed to do was to get the Pi powered by the LiPo battery. A 3S LiPo gives approx 11.1V, which is obviously too much for the Pi which wants 5-5.2V. I grabbed hold of an adjustable buck converter that takes a high power feed and converts it (steps it down) to whatever voltage you need, courtesy of a small adjustment pot at the top. Here it is with the pot turned to approximately what I needed. I later adjusted it to 5.1V to give the Pi some headroom.
You’ll see that the output of the converter goes into an Enviro+ board that is plugged into the Raspberry Pi Zero 2 W. This is where things get a little convenient. I knew I wanted some kind of sensor display for the project, and I happened to have an Enviro+ already. With a little experimentation, I found that I could take the voltage out of the converter and “shove” it into the GND and 5V pins of the Enviro+ and this would power the Pi. Marvellous. There is a cheaper board – the plain Enviro – so you might want to consider that. I also realised that I could add a control button to the Enviro+ by soldering a button to the other GND and #4 (GPIO 4), so I did that as well. The nice thing about the Enviro is that it breaks out “just enough” pins to make it easy to add things on. Those I2C (SDA/SCL) pins are just begging for more sensors – I don’t have any more room in the case, though!
Fuses and switches
I added a fuse (and I forget what rating, but it was fairly scientifically determined) and the toggle switch to allow me to just shut off the power if I wanted, and also protect the battery from any backflow.
I had a screen hanging around – a 5 inch touch screen from Waveshare. This one was ideal because a) the Pi didn’t directly mount onto it like some others and b) all the relevant connectors were on the right hand side – in this case, USB for the touch screen (and power) and an HDMI input. I knew somewhere I’d seen a DIY ribbon cable for the HDMI and so I had a look on The Pi Hut and found a right-angled mini HDMI plug to plug into the Zero and then a straight HDMI plug for the screen input. I bought a ribbon cable which turned out to be just right and connected that up as well.
You can see the cable assembly above on the right hand side. You’ll notice a small USB cable going from the Pi to the screen – this is for the touch screen and to power the screen – fortunately just the one port does both.
Fixing the screen to the case
Attaching the screen to the top of the case was an interesting challenge. Ideally, I decided, I didn’t want to drill the lid – that way it would be fairly weather-resistant. I tried glue, I tried double-sided tape, I thought about 3D printing some brackets… None of the ideas really warranted further exploration. The back of the screen (as you will see below) wasn’t flat, either, so I had that to contend with. Unfortunately, both the glue and the tape were not resistant to the little bit of heat generated by the screen, so the screen just fell off after about half an hour!
Eventually, I “bit the bullet” and decided to drill the lid, using M2.5 spacers to bring the lid slightly forward. It was much more secure that way!
At one stage in the past, I was collecting portable keyboards like there was no tomorrow. I had…
- a Rii mini 2.4Ghz keyboard with touchpad on the side
- a folding Bluetooth keyboard
- a larger Rii bluetooth keyboard with touchpad at the top
- and a slim, foldable Bluetooth keyboard.
Here’s a picture of three of them:
And then my life got complicated. The folding one on the left was perfect size-wise to fit in the case and it would give me an almost full-sized keyboard. The one you can see all of on the right was smaller, but has a grid layout with small keys, making it less than ideal for doing a lot of typing on. The thin one at the top was just too long to really make it work, so was discarded.
I decided I’d try both of the other two. The foldable keyboard was, as I said, just the right size to fit in the case… until I added the spacers to the back of the screen and then the darn thing wouldn’t close. I persevered with it, though, as I reasoned I could fix it to the outside of the case with a bit of 3D printing. However, I found that the Bluetooth connection was very unstable. Plus, I couldn’t get it to automatically pair, so I’d have to use the not-exactly-accurate touch screen to connect each time. No good, really.
I then thought I’d try the other one, the mini keyboard – it has a 2.4Ghz dongle, so the next thing I needed was another USB port. I made do to start with – I bought a USB splitter cable which allowed me to have an extra USB port. This did work… sort of… However, the trackpad was sporadic and unsteady, moving the mouse pointer almost randomly. I thought that, as it was quite old, that I’d probably damaged the keyboard at some point.
I was left with buying a new one, but do I go for Bluetooth or 2.4GHz? I settled for another 2.4GHz one in the end, a slightly newer model of the faulty one, as I thought I’d likely not have much luck with Bluetooth again.
To my delight, when it arrived from eBay, it worked marvellously. The USB splitter cable, though, just took up too much room. So, I bought a rotatable USB hub which was as small as I could get, which plugged into the little pre-existing microUSB shim.
Finally, it all came together.
And with the last component in place, the hub (pointed at by my wounded finger), I had my mini cyberdeck project completed!
First of all, I want to eventually try some pen testing with the cyberdeck, so I burned another SD card with Kali Linux on it. That’s for another blog, though. On the Raspberry Pi OS SD card, I grabbed the Pimoroni Enviro code and hacked it about to allow me to switch between modes – one mode is the standard display of all the stats from the Enviro+ from Pimoroni. The other mode shows stats on the CPU, memory and disk usage. I also added the IP address to the standard Enviro script as this comes in handy occasionally to be able to ssh into the Pi. You can find the code here on GitHub.
That’s all, folks
The project is as complete as it’s going to get, I think, and I’m very pleased with the result! Feel free to share your own cyberdeck build links in the comments below! 🙂