Greetings all! This is my take on a Raspberry Pi-based laptop. Can I call it a cyberdeck? That seems to be in vogue, so I will.
I was originally going to go x86/amd64 with one of these shelled but: 1) It was well-worn and had a loose hdmi port, in soldering that on I ended up loosening some of the solder beads under the eMMC memory and the computer blue-screened when it heated up (which I found out after forcibly removing the eMMC chip when disposing of the unit) and 2) I used the screen for a computer status display, which I came to like and didn’t want to disassemble. Could I have bought new (and ebayed) ones to make a slimmer and arguably better laptop? Sure, but then I’d be spending another $150-$200 on this project that I didn’t want to. If you’re interested in a build with components like that, I’d highly recommend this build log from sudomod.
Back to the pi! I had the following materials sitting around from other projects:
- Pi 4 8gb model – I bought this for $75 in 2019/2020…you can still get it for that if you live by a Microcenter
- Osyoo 5 inch screen - ~$50…the viewing angles aren’t the best (unless they changed the screen to IPS in the past couple of years) but it’s one of the best smaller DSP screens on the market imho
- 4000 mah lipo battery – for this project it’s critical you use something with 7mm height…I have higher capacity batteries with 11 mm height, but then I’d have needed to make a new bottom and didn’t want to
- 30-gauge stranded silicone coated wires – I love these and you can find rolls on amazon for cheap
- 5-pin switching headphone jack – originally these were going to have speakers…I opted not to install those
- 30 mm fan
- teensy lc – for the kb…I’d recommend going with something more standard like a pro micro knockoff as this was a pain to find firmware for (but I’ll link it for you so you don’t have to!)
- sd card extension cable – I wanted to be able to switch out OSes on the fly…also it seems retro to have a disk drive, so why not.
Here’s what I bought specifically for the project:
- ampripper 3000 – $25…there’s a surprising lack of 5 volt high amperage (3A) ready-made chargers. There’s also a surprising lack of chargers that also support pass-through charging. Like, I really like these as a small form factor charge/discharge board. Originally, they were marketed as a pass-through charging board, but that was a misnomer and re-reading the posting they’ve removed that. That being said, if you wire one to whatever format charging port you’re using + the battery and the other to the battery + discharge, you can make a pass-through charging setup pretty nicely.
- USB-C port breakout (just 6 pin, not 22 pin)
- pinephone keyboard - $60
- 18 pin 1mm pitch fpc to dip breakout board
I’ll start with why I chose the pinephone keyboard, because that dictated the design of the rest of the device. I knew that I wanted something small form-factor. I also didn’t want to use low-profile mechanical switches—it would take a long time to design and get a pcb (I was impatient) and I was worried handwiring for something intended to be mobile would jostle things loose. Maybe that’s silly, but it constrained my design decisions.
I also didn’t want thumb typing. I had a blackberry back in the day and while I loved that phone, it was not the best long-use typing experience. I write occasionally and wanted something I could use for that. *Spoiler and shameless plug: I’m currently making a handheld with an Xbox 360 chatpad for more portable/limited use. If you want to see that, check out my youtube channel where I’ll be doing regular build logs.*
I thought the pinephone keyboard had everything I needed (honestly, it was love at first sight when I saw it) and I’d just be able to swap out everything on the top side of the hinge for the computer module. The keyboard is insanely well documented and is supported by community volunteers (shout-out to Meji who is amazing for developing and running with it). The drivers are open source and Meji made blog-style entries about their work with the phone and keyboard.
I later came to learn that while the pinephone keyboard is revolutionary for making a phone into a pda, it was totally inappropriate for this project. That boils down to two things: 1) interfacing with the pi would have been more difficult that I envisioned, 2) power delivery didn’t work for the pi. That being said, even gutted with the only things left over from the original being the shell + keyboard assembly, I’m still very happy with it and couldn’t find another comparable product. It also challenged me to find workarounds.
With respect to the interface, the funny thing with the pinephone keyboard is that it uses a usb-hid microcontroller (the PEM85F684A) as the keyboard brains but communicates over i2c. The i2c pins were originally exposed for debugging while usb provided the primary hid interface. Meji turned that on its head out of necessity – the pogo pins on the back of the pinephone expose i2c for general interface and usb is used for debugging. Ingenious work, to be sure, but for my uses that meant I 1) needed to get the i2c to work on the pi (despite the pi not having a dedicated interrupt line, which is required by the keyboard) or 2) make my own firmware that used the usb connection.
You’ll notice that my bill of materials specifies a teensy lc as the keyboard controller. That’s because stupid me forgot that you can’t back-charge the IP5209 power bank microcontroller, which is the charge/discharge chip for the pinephone keyboard. It’s included in the documentation in numerous places, so I only have myself to blame. That being said, I fried it by trying to MacGyver a power circuit that would provide sufficient voltage to the pi when plugged in. The IP5209 provides 5v 2a *generally* but when plugged in to a power source only provides 4.5v, which is insufficient to power a pi (or even the stick pc I originally envisioned using).
In any event, it was straightforward enough to just remove the electronics and put in my own. I replaced the 6000 mah battery that came in the pinephone keyboard because it’s really 2x 3000 mah batteries and I didn’t want to have to deal with a balancing circuit and overcharge protection for them. You don’t *actually* need that if the batteries aren’t being used heavily and both start with the same charge from the factory…but it’s kind of dumb to just wing it with what could easily be an explosive situation.
The keyboard uses the teensy-lc darknight keyboard firmware. It’s one of the few premade teensy-lc keyboard firmware, is very easy to just customize and use, and works incredibly well in spite of being designed for a split keyboard. The secret is that it’s wired like a standard keyboard, just with some longer row wires. I actually also built one of those at the conclusion of the pi project; I had an extra teensy sitting around and got a box of Kalih Silvers from EVGA on clearance for $10, so was a no brainer for me. Perfect work setup with my laptop.
The top of the laptop was comparatively easy to figure out. I desoldered the female USB 2.0 ports from the pi and soldered wires to one set of headers for the teensy. The pi is attached directly to the screen which screws to the back of the case. The fan screws to the case, as does the 3.5mm jack and the sd card port. I tacked the ampripper down with some Loctite Fun-Tak I had sitting around. Based on experience from other projects, that provides a good-enough-for-me connection between the case and electronics.
Wiring is relatively straightforward. There’s routing of the fpc cables for the screen and sd card extension—those fold easily and are held in place with double-sided tape. I plugged the 3.5mm jack into the Pi’s jack with a jury-rigged extension cable. The rest of the cables traverse the hinge between the pi and the keyboard:
- six wires for power – 2x usb-c charge port to ampripper, 2x from ampripper to battery, and 2x from ampripper to switch (there are another 2x from the ampripper to pi, but those remain in the upper housing)
- four wires for usb between the teensy and one of the usb 2.0 ports
The wires from the keyboard route into the upper housing, are bridged by JST connectors to wires in the upper housing, and terminate at their respective destinations. If I did a rev 2, I’d swap the JST connectors for smaller ones, but it’s what I had on hand.
All in all, it works pretty well for what I need, which is accessing O365, libreoffice and light coding practice. YouTube works well on it, but with the smaller screen it’s uncomfortable for me to use without my glasses. Text surprisingly isn’t too bad. I use it weekly.
If I had to change anything for a V2:
- move the screws at the bottom of the upper-housing…I misjudged the distance on those and it scratched the keyboard housing (miffed about that) and the keyboard sits a little open without weight on it
- use some other, smaller connectors for the wires traversing the hinge
- not have speakers be an afterthought…I like listening to music while I write and I was going to use the speakers from a couple of old LG V20s I had sitting around and no longer use. They didn’t fit well and if I’d considered them as more than “being on the sides of the screen” when originally designing the whole thing, I probably would have been able to fit them in well.
- think about a better power on/off solution…I rerouted the ampripper switch from the upper assembly, where it was inaccessible, to the lower assembly where it’s only marginally less accessible. It’s reachable with a pen or other small object through the hole left by removing the original keyboard power button cover. If I weren’t so lazy, I’d swap the 0.4mm nozzle on my printer with a 0.2mm nozzle and try to print a switch cover that way (the 0.4mm nozzle wasn’t low enough resolution).
As I said above, I’m working on a smaller more pocket-sized version built around a pi zero 2, an xbox chatpad (or at least the guts of one), and a pimoroni hyperpixel 4 I have lying around. If you want to see what I think goes into one of these, how I select components, and how I design it then please check out my youtube channel, GamingInSecurity. I play games and talk about information security and law (currently a CISO and was an attorney for some time). I’ll also be doing other electronics projects. The channel’s relatively new, so take that for what you will. I’ll also be posting updates here, or something, when I have the new “cyberdeck” ready.