Introduction: DIY Ultra Portable Raspberry Pi Laptop
As you may have seen in a previous project we made a Raspberry Pi and Arduino laptop out of some cheap parts and cardboard. As you might have guessed cardboard isn't the best material to make a laptop out of.
So in today's project we are going to recreate that laptop but this time it will be smaller, faster and neater. In this project we will make use of a Pi 3b+, Autodesk's Fusion 360 design software and 3D printing.
The software and hardware used in the project is pretty straight forward however if this is your first Pi project I would recommend starting somewhere a little easier. Let's get started!
Step 1: Parts and Tool List
So for this project, you will need quite a few tools and parts. The components we will use are as follows:
Raspberry Pi 3b+
Any Pi since the Pi 2 will work but the newer ones add the benefit of built-in WiFi and faster speeds.
Get it here
Adafruit 3.5 inch TFT Screen
Now, normally we would be able to use any GPIO screen we want. However, because of a very specific driver we are using (which we will talk about later) we are going to need to use one of the tested and working screens. I chose the Adafruit screen the Wave Share 3.5 inch TFT screen will work as well.
Get it here
All In One Mini-Keyboard
Next, we will need a Mini USB all in one keyboard. We are going to go for the all in once option because its compact, cheap and has a built-in touchpad which will make navigating our Pi computer a lot easier.
Get it here
5000 mAh Power Bank
Now to power the whole thing we will need a slim power bank. I've found that any power bank that has a 5000 mAh lithium cell. Which is very thin and log making it perfect for this project. We want to avoid any power banks that use the 18650 cells as these are too large.
Get it here
We will also need the following:
- 2 x USB female ports
- Micro SD Card
- Roll of PLA filament
- White primer spray paint
- Sand Paper
- Super Glue
We will also need the following tools
- 3D printer (Im using the Ender 3)
- Glue Gun
- Computer (For flashing)
- Wire Cutters/Strippers
Step 2: Get Everything Ready
Before we can start designing cases and painting things we are going to need to get all of our parts ready. This means stripping the pi down to only the parts we need, taking the casing off the power bank and soldering everything together.
Stripping the Pi
Now because space is tight we will need to remove any unnecessary parts from the pi. We will be desoldering the LAN port, both dual USB ports and cutting the GPIO shorter (But not completely off! We still need to solder the screen to the GPIO).
Now if you've never desoldered before I highly recommend watching a tutorial before you give it a try. I normally pool a big blob of solder over a component and rock it back and forth while it falls out.
Taking apart the power bank
With this step we need to be extremely careful as lithium cells can catch fire or even explode if they are punctured or not handled with care. With that being said we can start taking apart or power bank. I found mine was held together with plastic clips that could be broken to get the cell and battery management circuit out. A BMS - Battery Management system is in charge of making sure lithium cells charge at the right voltage, don't undercharge and don't overcharge so it's very important to keep the circuit that came with the power bank.
Taking apart the keyboard
Now the last thing to take apart and get ready is the all in one keyboard. The only thing we need to do is unscrew the two pieces and set them aside.
Step 3: Designing the Case
For this part we going to take a little shortcut to save some time on printing and designing. We are going to use the top of the keyboard case as the top of our laptop and the bottom of the keyboard case for the bottom of our laptop. We will simply just 3d print and insert for the middle to make space for the pi and battery and then we will print a screen holder.
The reason for this is it would take a bunch of time to redesign the keyboard and key cutouts and then we would have to reprint them. Using what we already have helps us save time and save plastic.
The way I did this was to take a photo of the keyboards case next to a ruler and then import that into Fusion 360. I then traced the outline of the case onto a new sketch and then extruded it to the height of the Pi, I also then added charging holes, USB holes, audio jack holes and a hole for the HDMI port. Now before we can print it we need to design a hinge to attached to the screen.
Designing the hinge
The hinge will be the only moving part for this project so we need to ensure that for one it's really strong and secondly that it can actually hold the weight of the screen.
So to test this I created a little simulation in Fusion 360 for a little hinge. The basic concept is that there is a piece that looks like a U with a hole through it and there's a piece that looks like a T with a hole through it. The T piece fits into the U piece and the two holes line up. A nut and screw is then inserted into the holes and tightened. This causes the U piece to tighten around the T piece increasing the friction. Once its tightned enough the friction is high enough to hold the weight of the screen.
A smaller and neater hinge was that created and printed which uses the same principle just in a smaller size.
Step 4: Wiring Everything Up
So now for the very time extensive step, we are going to start wiring everything up and again because of the amount of things we need to wire up we will be doing all of it in steps.
Wiring the screen to the Pi
Now before we start wiring up the screen I want to pass over some of my failures onto you so you can hopefully avoid them. The first time I wired up my screen (Which was a good 30 minutes of work) nothing worked, the screen wouldn't turn on. After days of troubleshooting and rewiring, I discovered that the wires I had used to connect my screen to my Pi were too thin and did not allow enough current to pass through, leaving the screen dead. So if you choose to make your own do be sure to use thick enough wires.
The wiring of the screen is very straight forward, the screen sits on the Pi like a shield. We of course cant keep it like this because of our screen and pi are quite far from each other but this means all we have to do is solder a wire from each GPIO to the matching pin on the screen. Make sure each wire is at least 15CM long so it can reach the screen part of the casing.
Connecting keyboard and USB ports
Earlier we removed all the USB ports from the Pi, now we will be adding some of the back for access on the outside of the case. So we will need to solder two of the USB pads to our female USB ports with some wire. Make sure the wire is at least 5 CM so the USB port can reach the outside of the case.
Next we will wire up the keyboards USB transmitter to the other spare USB port and finally, we will solder the keyboards charger to the last spare USB port so that the keyboard is always powered.
Connecting the Battery
Earlier we took apart the slim 5000 mAh battery, if you happened to disconnect the lithium cell from the BMS that's no problem however now is the time to reconnect it. Make super sure that the red wire is going to the positive (+) input and the black wire is going to the negative (-) input. Then we will solder wires to the output of the BMS, this output is the USB port and will be outputting 5 volts which is what our Pi needs.
To connect this output to the Pi we need to turn the Pi around and take a look at the solder points on the back, these allow us to solder the power leads directly to the Pi rather than using a USB Micro Cable. We need to look for a solder pad labeled PP2 (5v +) and PP3 (Ground - ). Connect the positive wire to PP2 and ground to one side of a switch and the other side of the switch to PP3, this will allow us to turn on and off the device.
Step 5: Software
Now with everything wired up we can install the software to make it useful. We will start by taking the Micro SD card and plugging it into another computer so we can flash it with the Raspberry Pi software. This software is named Raspbian and can be downloaded from here.
To install the software onto the SD card im using:
However I don't want to go into detail about how to install the software because Raspberry Pi's guides on this are much better, find out more here.
Now once the software is installed we need to install the screen drivers. We could just use Adafruits TFT screen driver however I've found it to be quite slow and extremely laggy in use. After some research I found that there are ways to fix it but for the most part they didn't work for me. And so i'm going to be installing a driver named FBCP -ili9341 which is a self described "Blazing fast display driver" so I think it should fit well.
Installation is completely custom to your screen so you'll need to check the Git page here to see how yours is installed. If you're using the same one as me here are my flags that worked:
cmake -DSPI_BUS_CLOCK_DIVISOR=8 -DADAFRUIT_HX8357D_PITFT=ON -DDISPLAY_SWAP_BGR=OFF -DSTATISTICS=0 -DDISPLAY_CROPPED_INSTEAD_OF_SCALING=OFF -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=ON -DSINGLE_CORE_BOARD=ON -DHX8357D=ON
And here's some changes to the Boot.txt file:
/boot/config.txtdisable overscan=1 framebuffer_width=480 framebuffer_height=320 #hdmi_force_hotplug=1 hdmi_group=2 hdmi_mode=87 hdmi_cvt=480 320 60 1 0 0 0 overscan_scale=1
And finally we can installed some software on top of Raspbian to make it a little more fun and usable. I highly recommend installing RetroPie as this allows us to use this little hand held device as a retro gaming machine as well.
Step 6: Printing and Assembling the Case
Now with our case designed, we can start printing it. You can find the printable STL files in this step here are my slicer settings:
- Infill - 100%
- Quality - High
- Supports - Yes
- Rafts - No
Im also use the slicer simplify3D however I have tested these settings on Cura as well and everything worked as it should on the Ender 3. The whole print took around 7 hours altogether.
Like we discussed before most of our case is going to be made up mainly the casing of the keyboard with just a screen and a spacer being placed in-between.
The Base of the laptop
We will start by putting the base of the laptop together. We do this by taking the top of the keyboard case and gluing it to the insert we printed. I highly recommend staying away from hot glue for this part of the project as hot glue doesn't stick as well to these plastics. For gluing these parts together I highly recommend using super glue or some sort of epoxy. Once these parts are glued together give the edges a light sanding with some 600 grit sandpaper to ensure a smooth finish.
Making the Screen Casing
Now with the base nearly done we can start making the screen. We need to take the screen with all of its wires and slot in into the back of the screen casing. I used a fair amount of hot glue here to secure the screen to the casing. I did not use super glue as I wanted the ability to readjust this. Once the screen is secure we need to run the wires through the hole at the bottom of the screen near the hinge. This keeps them out of the way. Once this is all done we can glue the face of the screen on.
Now before we can finish up the case we need to install all the electronics. I mounted everything together inside the base with hot glue and epoxy however if you have the time I would highly recommend going back and using screws and nuts.
Step 7: Giving It Some Color
Now with most of the case together and the circuits all installed we can start finalizing the case and painting it. So first things first we need to glue the bottom of the case onto the spacer, this will finalize the casing so make sure everything inside is working as it should.
Now with the casing done, we can start painting the casing to get rid of the 3D printed look. For this, I recommend some thick primer white spray paint. This does a great job of getting rid of the layers that 3D prints often have. To start it's probably wise to start off by coving everything delicate with some masking tape so we can start spray painting. Make sure you cover the:
- HDMI Port
- Audio Port
- USB Port 1
- USB Port 2
- The Hinge
- The Screen
- Charging Port
- The Power Switch
Once this is done we can spray the whole thing with 3 coats of the white spray paint, leaving it for about 20 minutes in between sprays.
Once this drys the laptop is now essentially a blank canvas for you to do whatever you want. Personally, I'm not the best artist so I handed it to my friend and asked her to paint a cherry blossom on it which I think turned out amazingly. Everything was then covered in a final clear coat for protection.
Step 8: Finished!
With that the Mini Pi Laptop is done! Now if you are seriously considering making this yourself here are a few notes I made while using the laptop daily for a week or two.
- Screen is too small for work - I had though I could use this little laptop as a writing machine. Its got a very nice little keyboard, great battery life and is pretty comfy however the issues is the screen is just too small to focus on any sort of office work. After just an hour of typing and reading on this little screen can cause some eye strain.
- Use while charging - Now this is very important. The first version of this that I built used a power bank that couldn't be used while charging. This means you can only use the laptop while the battery is charged. So do make sure that the power bank you choose can output 5 volts while being charged so you can use the laptop while it charges.
- No speakers, again - Now this actually didn't bother me at all because I always use headphones and plug them into the headphone jack but if this is an issue for you I would highly recommend installing some small speakers on the device.
- Great for gaming! - This little device makes a great gaming machine! The keyboard we used has nice finger triggers on the back and the keys are all nice and clicky. Once RetroPie is installed this machine becomes really fun. I found myself playing for several hours each time.
- Good for video - This device was also great as a little video player while commuting. The screen isnt huge but its big enough to watch videos and the battery life is great. It doesn't quite compete with a modern smart phone because of their screen size but it has its place in my heart.
So I hope that helps you in making an informed decision on whether or not to make this little guy. I will say it was great fun and I really enjoyed the build and think you will to.
As always if you have any questions or concerns I will be in the comments section to try my best to answer them. thanks so much for viewing!