The back keyboard cover is secured using small plastic "snaps" around its perimeter.
Using a small plastic prying tool (like the type you use to open cellphones), carefully separate the housing at one of these clips.
Then, slide your tool all the way around to release the rest.
There are two ribbon cables connecting the front and back of the keyboards. We'll need to remove these.
Gently flip open the two halves of the keyboard so that you can access the keyboard's innards. Remove the three small screws from the black plastic keyboard electronics cover. Then, set the cover aside.
For clear the multi-pin ribbon cable, carefully slide the ribbon cable connector retention tab using a small flathead screwdriver. This will release the ribbon cable.
The other ribbon cable is actually just a grounding strip -- for this one, simply remove the tape from the keyboard key side.
Here you can see the two halves of the keyboard. The keyboard PCB can be removed by depressing two small tabs that secure it in place.
Use a box cutter, Dremel, or wire cutters to remove the cross-hatch support material adjacent to the PCB section. This is where all of our electronics will go.
I wanted to add this blue power LED that will illuminate when the Pi is on. I also wanted to add a power button that will safely turn the Pi on and off. These are optional for your project, of course, but I think they add a lot of functionality. :)
On the left-hand side of the case (when using the keyboard), drill two small holes for the power LED and button. The size of these holes will vary based on the size of your LED and button. I drilled a 3mm hole for my 3mm LED and a 5mm hole for my tiny power button.
Later, we'll secure the Pi in place using foam tape. You can use hot glue if you wish, but I find foam tape is easier to remove later if need be.
Secure a piece of foam tape to the Pi but leave the backing in place.
Next, we'll need to cut some holes into the back of the keyboard for the Pi Zero ports.
If you're adding a battery to your keyboard like I am, you only need to cut holes for the mini HDMI port and micro USB data port. We won't need a hole for the micro USB power port since the power input lives on the charging circuit for the battery (more on that later).
If you aren't adding a battery, also be sure to cut a hole for the micro USB power port.
Marking the holes
To mark the holes, line the Pi up inside the back of the case and use a sharp permanent marker to mark the top and length of each port.
Cutting the holes
This can be done using a drill or Dremel. I found the easiest way to cut the holes is to drill holes at the end of each "port opening" using a super small drill bit. You can then drill additional holes along the length of the port, and then remove excess material using a Dremel or box cutter.
The PowerBoost 1000C circuit board increases our battery's 3.3V to the 5V needed by the Pi, while also charging the battery and adding safety circuitry. If you plan on adding battery power to your keyboard to make it totally portable, this is necessary!
Add a piece of foam tape to the back of the PowerBoost, mark a hole for its USB port, and cut the hole.
If you aren't putting a battery into your keyboard, skip this step and instead cut a hole for the Pi Zero's micro USB power port.
Next, we'll need to solder the power button to the Pi's GPIO header.
Using a few lengths of wire, solder the power button circuit per the instructions in our Pi power button guide. That guide also includes instructions on a few scripts you'll need to run for the power button to work. You can add those scripts at the end.
Next, we'll need to create the power LED circuit. I wrote a separate guide on adding a power LED to the Pi; use that guide to get it up and running!
Powering from the outside
If you aren't putting a battery in your keyboard, skip this step -- your Pi will be powered directly via USB from the outside (by connecting a power cable to the Pi's power port).
Powering from the inside
You can also derive power by soldering the Pi's 5V/GND pins on the Pi's GPIO header directly to the power pins of one of the keyboard's full-sized USB ports (more information on GPIO below).
Powering via battery
If you are putting a battery in your keyboard, you'll need a way to get power from the PowerBoost/battery to the Pi. Normally, the PowerBoost feeds power to the Pi via USB. However, I wanted to avoid running additional cables outside the Pi. Therefore, we'll power the Pi using its GPIO header.
It is hotly debated whether it's safe to power a Pi by connecting power to its expansion header. The header doesn't have the same protection circuitry as the Pi's power port; thus, supplying far too much current (or incorrect voltage) could theoretically damage the Pi.
Nonetheless, the Pi Zero W is only $10, so this is a calculated risk I'm willing to take. :) As long as you don't use an incorrect power supply or do anything else odd, your Pi will be fine.
Solder your connections as follows:
Pi 5V (pin 2) => PowerBoost 5V Pi GND (pin 6) => PowerBoost G or GND
If you aren't sure which pin is which, Pinout.xyz can help you identify your pins.
We're almost done!
Remove the foam tape backing and secure the Pi and PowerBoost in place.
Then, secure your power button. My power button uses a threaded nut, but yours might need to be glued into place.
Finally, use hot or super glue to secure the LED in place.
I'm using a 2000mAh Lithium-Polymer (LiPo) battery from Adafruit. This battery should run the Pi and keyboard for at least 4 hours. When a power supply is connected to the PowerBoost, it will use that instead while it simultaneously charges the battery.
Connect the battery's JST connector to the PowerBoost. As soon as the battery is connected the Pi will boot; so be extra careful not to short anything.
I placed the battery sort of between the PowerBoost and Pi. The battery will stay in place since it's a tight fit.
You'll need this small male-male micro USB cable to act as a jumper cable and connect the Pi's data port to the keyboard's micro USB port. I opted for this approach so that the keyboard could still be used with other Pis.
So if you wanted to use the keyboard as a normal keyboard, you could just disconnect the cable from the keyboard's micro USB port and connect another computer there instead. This is especially handy if you're working on a Pi project that needs GPIO access.
Advanced: Avoiding the external "jumper" cable
It's possible to avoid the external cable entirely by soldering directly to the keyboard's micro USB port. Since the micro USB port's pins are so small, you'll want to solder to the traces instead.
To do this, locate the data PCB traces coming from the keyboard's micro USB port, carefully scrape away a bit of the trace's protection layer, and solder small wires that connect to the Pi's data micro USB port (either with a cable or via trace soldering).
Make sure no parts of your new circuitry are touching the top of the case; if they are, use a bit of Kapton tape to prevent them from shorting against the case.
Reattach the black plastic cover using its three screws.
Then, Reconnect the keyboard ribbon cable and grounding strap.
Finally, snap the case back together.
I recommend labeling your USB ports so that you (and others) know what each port does. I used a label maker and put the labels on the bottom for extra cleanness.
The LED is shining, the power button turns the Pi on and off, and you can disconnect the cables for a battery-powered Pi on the go.
In the future, I'd love to create a version that has GPIO access and perhaps also add a micro SD card extension for external card accessibility.
Let me know what you think!
Questions? Ideas? Post in the comments section below. I'd love to hear from you!