Since the day I heard about and got to play with the Raspberry Pi a few years ago, I’ve wanted to make a Raspberry Pi-powered laptop.
Introduction: Raspberry Pi and Arduino Laptop
Since the day I heard about and got to play with the Raspberry Pi one a few years ago I’ve wanted to make a Raspberry Pi powered laptop out of it and now with the rease of the Raspberry Pi three I’ve decided to finally see it through. Now this isn’t my first time attempting to make a fully working laptop using a Raspberry Pi, every other time I’ve tried the project has been riddled with errors with anything from broken ribbon cables to figuring out the hinge mechanism however I’ve been able to learn from these failures and I hope to show you how to avoid them when making your own. So lets get started!
Step 1: What Do We Want It to Do
Before we can start choosing and buying the parts we are going to be using we need to figure out everything we want our laptop to be able to do, for example I want my laptop to have:
- integrated mouse (trackpad)
- long battery life
- at least 2 USB ports
- full keyboard
- integrated Arduino powered battery reader
- integrated Arduino with headers for plugging components into
- small form factor
Since we are using the Pi 3 we dont have to worry about buying a Wifi or Bluetooth dongle because it has it all integrated. Now this list is by no means exclusive, there are many other things that can be added to make this a better laptop however I think the features im adding will give it some awesome usability such as the integrated Arduino powered battery reader which will be a small OLED screen next to the main screen which will permanently show the battery percent and voltage, another feature I really like is the integrated Arduino with headers, this is basically an Arduino with male headers soldered to it, there are small holes cut in the case that allow the user to access the male pins and plug in components, so all this really is just an Arduino built into the laptop so we always have an Arduino handy.
Step 2: Parts
For this project we will need quite a lot of parts, we will need:
- x1 Raspberry Pi 3 (Here)
- x2 Arduino Micro (Here)
- x1 Seven inch Raspberry PI screen (Here)
- x3 Lithium 18650 Batteries (Here)
- x1 Powerbank circuit (Here)
- x1 USB hub (Here)
- x1 Mini USB keyboard (Here)
- x1 Male USB (Here)
- x1 SPI OLED (Here)
- Reinforced cardboard
We are also going to need the trackpad we made in a previous project, you can find the full tutorial here . Once again this is by no means an exclusive list, whats nice about these parts is that the majority arent dependent on each other so you can swap parts for whatever you want. We have alot of parts to setup so to make it easier we are going to set them up individually and then at the end we can put them all together.
Step 3: Setting Up the Pi and Screen
Lets start with our PI and screen, our screen doesn’t connect to our Pi through the HDMI port but rather through a 50 pin ribbon cable that plugs into the Pis GPIO however if you just plug it in and start up the Pi it won’t work, we need to edit some lines of code in the startup file for the Pi.
We start this by downloading a fresh Raspbian image Here , then we write it to our SD card using 7Zip (or whatever software works for you). Now once its written we need to open a file on the SD card called config.txt and add some code. What this code does is tell the Pi to send the screen data through the GPIO headers rather than the HDMI port (HDMI is the default) on startup. Putting the code in is really easy. Open the config.txt with a notepad program, for windows i’m using notepad ++, and copy this code into the config.txt file now save and close and it should work once the SD card is plugged back into the Pi. If it looks too bright or too dim turn the little petentiomoter on the screen circuit board until it looks right.
Our Pi also needs to physical modification to fit inside our case properly we are going to have to desolder one of the duel usb ports, this is done by putting a fairly large amount of solder on the pins of the USB connector and slowly rocking it back and forth until it becomes free. We do this because we need to solder a usb hub to the Pi to plug in all of our input devices.
<p>dtoverlay=dpi24<br>enable_dpi_lcd=1 display_default_lcd=1 dpi_group=2 dpi_mode=87 dpi_output_format=0x6f005 hdmi_cvt 1024 600 60 6 </p>
Step 4: Setting Up the Battery
Our battery uses 3 18650 batteries that have a capacity of 2400 mAh each, in parallel the 3 cells have a total capacity of 7200 mAh, our pi with everything plugged in draws around 1 Amp meaning our 3 cells can power the pi for roughly 4.5 – 5 hours but this can be increased by adding more batteries if you want. To build it we need to charge all 3 cells all the way up to 4.2 volts individually as connecting lithium cells is very dangerous if they have different charge states (different voltages) to avoid this its easiest to make sure they are all fully charged before connecting them.
Now we want to connect these cells in parallel to do this we connect all the positive terminals together and then connect all the negative terminals together, use thick wire as a lot of current might pass between these batteries which would heat up a thinner wire. now connect the negative and postie terminal of the batteries to the negative and positive input terminals of the power bank circuit respectively and thats all for the battery!
Instead of using a power bank circuit like I’ve used here you could use a lithium charger to charge the cells to 4.2 volts and boost converter to boost the 4.2 volts to 5 volts but this will ultimately do the exact same thing as the power bank circuit and would take up more space.
Step 5: Setting Up the Battery Display
Now to set up the battery display, this step is defiantly not that necessary as you could read the battery voltage through the Pis GPIO and display the battery level through software, however, I wanted to add this because I think the OLED screen gives the whole laptop a really cool DIY look. To make it we need to solder our OLED screen to our Arduino, the OLED im using is not an SPI version so I have to solder 7 pins to the Arduino.
The pinout is as follows:
- Rest – Pin 7
- DC – Pin 12
- CS – Pin 9
- DIN – Pin 11
- CLK – Pin 13
- VCC – 5 Volts
- Ground – Ground
Before we can upload our code we have to make our voltage probes which will connect the Arduino to the battery and allow it to read the batteries voltage we need to solder 2 10 ohm resistors in a voltage divider configuration (see photos) to the A0 and Ground pins on the Arduino which can then be connected to the battery, A0 goes to positive and Ground goes to Ground. We also need a power source for our screen so we need to solder another wire to ground and one to VIN on the Arduino which we will connect to the power bank circuit later for power.