by snm, December 2nd, 2017
Have you ever wanted to make your own laptop? I did, and this was my first attempt: Building a small custom Raspberry Pi Zero laptop in a cardboard box. This is a continuation of that article, making several minor improvements including moving it to a larger case, adding a breadboard for prototyping, and an improved power indicator LED on the front panel from the USB hub. Codename: ztop2, for Raspberry Pi Zero laptop, generation 2.
Having soldered-on jumper wires on the OLED display module, supported only by sticking the pins through cardboard, was a sore point in the old laptop design. A 20-pin female adapter could plug into the display module, but I didn’t have one on hand, and would like to improve the expandability of this device as well, so I opted to plug it into an 830-tie breadboard. The springs in the breadboard holes provide structural support:
Now the jumper wires can be desoldered and plugged into the breadboard. But you may recall one of the wires pins was broken (second from the right), and I was low on jumper wires anyways, so I ordered these replacements: Dupont line 120pcs 10cm male to male + male to female +female to female jumper wire Dupont cable for arduino. 40 each of jumpers with female-female, male-female, and male-male connectors:
One disadvantage is they are a bit shorter (10 cm) than the others I have, but it’ll do for prototyping (brown wire on right):
Even though these jumpers wire get the job done, they aren’t as elegant as I’d like. To remedy this, ordered a GPIO cable and breakout board: $2.67 from Aliexpress Raspberry Pi 3 40 Pin Extension Board Adapter +40 Pin GPIO GPIO Cable Line For Banana Pi M3 /Raspberry Pi 2/ For Orange Pi PC
There are other alternatives, Adafruit sells what they call a Pi T-Cobbler for $7.95 and Sparkfun has a Pi Wedge with a serial connector on the side, for $9.95. The board I got from Aliexpress is labeled “PI GPIO-T Plus V2.4”.
For the wiring, see Monochrome 2.7” and 2.42” 128x64 OLED displays on a Raspberry Pi Zero, copying here with the jumper wire colors to assist in my rewiring:
|OLED Module Pin
|Pi Zero Pin
|P01-18 GPIO 24
|data/command, the fourth wire of “4-wire SPI” (sic)
|P01-23 GPIO 11 (SCLK)
|P01-19 GPIO 10 (MOSI)
|MOSI, master out slave in (MISO is not connected, no slave output)
|P01-24 GPIO 8 (CE0)
|Chip enable/select 0
|P01-22 GPIO 25
The socket on the GPIO-T board is keyed, but how do we know what way to plug in the ribbon cable into the Pi? I guessed the wrong way and the Pi drew excessive current, but reversed it and it worked: the ribbon cable is supposed to be plugged in facing outwards, the key towards the inside of the board.
Wire up with jumper wires again:
Then using breadboard wires, tidying it all up:
To monitor the power usage, bought a “USB safety tester”: Digital Display 3V-30V USB Tester Current Voltage Charger Capacity Doctor qc2.0/3.0 quick charge power bank meter voltmeter. Similar to a charge doctor. It can be plugged in inline, monitoring the power draw from the battery:
When idle but fully powered up, the laptop draws about 500 - 600 mA at 5 volts.
The small cardboard box was just enough to fit the keyboard and other components, but very cramped, and cannot comfortably fit the 840-tie breadboard. To allow room for expansion, switched to another cardboard shipping Sparkfun box, but substantially higher:
Check out how roomy it is inside:
Shoved in all the components:
Now to build it.
First some tweaks so it fits better.
The micro USB plug on the “PWR IN” connector is unnecessarily bulky. But it is actually not needed, the Pi can be powered through the 5 volt and ground pins on the GPIO header. To save my micro USB cable, I sacrificed an unused mini USB cable (who uses mini USB anymore?), split it open:
The black and red wires are V- and V+ respectively as you might expect, the white and green are D+/D-. Is the shielding ground? Turned to USB device cable shield connection - grounding it or not? for insight: in this cable, the shielding connects to the connector shield on both sides, but is separate from the V- (ground) wire. It doesn’t have to be, but I connected the shield to ground.
Measuring with a multimeter confirms the red wire is +5 volts. The wires are stranded, not easily breadboardable, to fix this I soldered them onto a 2-pin 0.1” header which can plug into the breadboard power rails (using the upper rails for 3.3V, lower rails for 5V):
The external USB ports in Building a small custom Raspberry Pi Zero laptop in a cardboard box were provided by a Monoprice Aquamini 4-port hub, which I turned upside-down to hide the annoying red power indicator LED. For this upgrade, I took it apart, prying apart the plastic shell with nothing plugged in:
There’s that pesky bright red LED. Desolder (back of PCB labeled “HUB-107-2”, two holes above it are for the indicator):
How about replacing it with a soft diffused green?
But I’d like to see the light outside of the case. Fortunately I had a 2-pin cable, with hammer headers (not unlike these), so I soldered it in the LED’s place, and folded the LED’s leads back on themselves to snugly fit into the plug:
Cut a hole on the front of the case and push the LED through. Sadly, while moving the Pi from the older version of this laptop the activity LED lifted from the board, along with the bulkier LED I soldered onto it (too much stress):
This is worth fixing, but for now, we have a front LED showing the USB hub power. Note that the USB hub is powered even when the Pi is “off!”. A phantom load, slowly draining the battery unless it is disconnected. So this external USB hub power indicator serves as a harder indicator of if there is any power:
Finally, left the hub’s plastic shell off (primarily because I couldn’t thread the LED cable through its small hole, but also to reduce bulkiness), then cut holes in the cardboard case for the two external USB ports:
The laptop is starting to come together!
I had some trouble with this one, the USB-to-Ethernet adapter has a longer cord to allow a straight shot to the back, and not long enough to allow exposing the port on another side. Settled on looping the cord through:
Considered removing the DVI-to-HDMI adapter, and exposing HDMI directly (through the HDMI-to-mini-HDMI adapter), but the micro USB data cable on the back of the Pi Zero sticks out too far to fit the HDMI port through the back of the laptop. This may be solvable using a right-angle USB plug, but not any USB cable will do, since it allows plugging USB-A devices into it (expanded via a hub), a special “on-the-go” (OTG) cable is required, I have this one: USB OTG Host Cable - MicroB OTG male to A female. This is an area of improvement (maybe go with a Ethernet Hub and USB Hub w/ Micro USB OTG Connector while we’re at it?), but for now, I stuck with the DVI port so it moves the Pi far away enough from the back of the case:
Another downfall is the port and Pi are raised up from the bottom of the case, because of the short length of the GPIO ribbon cable. Could be improved by adding a false bottom, but for now, it hovers in midair.
Back view of the DVI port and Ethernet port:
Again there’s a lot to be improved on here, but for now I taped the battery in the corner, plugged the USB safety tester (power usage meter) into it, then the USB-A cable which connects to the headers for +5 V GPIO on the breadboard.
A power on/off switch and/or a selector to allow external power would be really nice, not this time but now that the power supply lines are on the breadboard, a future improvement could be more easily made. There’s always a lot more to make better.
Here we go:
This new upgraded laptop looks about the same as in Building a small custom Raspberry Pi Zero laptop in a cardboard box, but has much more breathing room internally. Especially with the internal breadboard, easing future prototyping experiments. And when the laptop is closed, you can’t even tell it is more than a box: