Introduction: Raspberry Pi 4B 3D Printed Tablet
The concept of the project is to develop a 3D printable, Raspberry Pi based tablet. All parts (components) must be easy to obtain and readily available. It must have a battery, and it must be the primary source of power (meaning, it will charge up with a cable plugged in, but must have enough power to run without it.) It must be able to operate perfectly fine without a keyboard (meaning, everything in the user interface should work without an issue even if you don't have a keyboard and mouse plugged in.)
Note: This project uses the Raspbian OS for now, until I can find a more suitable "touch-first" solution.
- SBC: Raspberry Pi version 4B+ (4Gig RAM)
- Display: 7 inch LCD Display (with touch)
- Power Supply: PiJuice UPS (with 5000 mAmp battery)
- Camera: 1080p Camera (front-facing)
- Sound & Speakers: Sound Card, powers 2 speakers, and 2 microphones, and provides an audio jack for headphones.
- Accelerometer: Gyro/Accelerometer - to orientate the screen. (with python)
- Cooling: Fan connected to a fan-speed controller (speed is controlled in python)
- USB: Breakout USB
- Power Button
- Volume Up/Down rocker
- Power and activity LED light is redirected (using nylon) to the case.
- Bamboo wood back, with laser etched decal
Full project details:GitHub
Note: If you don't have a laser attachment, then either leave that step out, or ask a friend (gcode supplied)
- Raspberry Pi 4B+ (Or 3B+, If you use an A format board you can skip out removing the network and USB blocks) Amazon
- 7" Official Raspberry Pi LCD Display (with touch) Amazon
- PiJuice UPS PiSupply
- PiSupply 5000 mAmp Battery PiSupply
- Official Raspberry Pi 1080p Camera (Optional: extended length ribbon cable) Amazon
- Waveshare Audio HAT (Sound Card) Waveshare
- 2 speakers (8Ohm, 1Watt) Amazon
- MPU-6050 Accelerometer and Gyroscope Amazon
- HW-517 PWM Fan Speed Controller Amazon
- 30mmx30mmx7mm FanAmazon
- 128Gig SD Card (Minimun 16Gig)
- 3 Press ButtonsAmazon
- Breakout USB 2.0Amazon
- Color Wires
- 18AWG (or less) Cable
- 3MM wood (of any kind - but I used bamboo)
Step 1: The How to Video
Please Note: The video consists of a very detailed recording of all the steps I took to complete this project. Please watch the video or follow the steps below to make this project your self.
Step 2: Preparing the Components
In this step you will need to make some modifications to the parts that you have ordered. This is mainly to take the bulky parts like screw boxes and USB boxes etc, off the PCB, as we will be soldering the cables to the board.
- Raspberry Pi: Strip off the USB blocks and the network block (do not unsolder, use a cutter, to take the metal enclosure off, and cut the plastic away). Also remove all the GPIO pins except the top 6 (according to the wring diagram)
- LCD: Remove the USB block from the PCB, and remove two of the 12mm pins at the back.
- PiJice: Remove the clear plastic battery holder. Remove the black plastic insulator for the GPIO pins, and then cut (don't unsolder) the GPIO leaving only the top 6 pins (3 on the right, 3 on the left).
- HW-517: Remove the screw blocks (unsolder)
- wm8960: Remove the black plastic insulator for the GPIO, and the speaker cable block and screws, then cut the GPIO according to the wring diagram.
- Fan: Remove the heatsink
Step 3: 3D Printing
You can download all the files you need below. There is also a copy at Thingiverse, so you can use the 3D printing service if you don't have one.
3D printing Tip:
There is something about the Creality printer that will save you a lot of failed builds... Their glass surface is terrible to print on, and even though the build plate may be heated, it offers almost no adhesion and I generally don't use a brim or anything... how come? I clean the glass with pure alcohol, and then use normal paper glue Pritt Stick. It's a non-toxic glue that when heated (like from the bed) is very sticky, and bonds the PLA to the build plate. Then when the print is done and the build plate is cool, it just pops off easily. If you are in a rush, you can wash it off with water. (you would need to wash the glass off in any case after each print)
Step 4: Post-Printing
Glue each layer together with a fast bonding super glue or something equivalent. The layers should sit neatly on top of each other. Layer 1 and 2 have little catches that help to align the layer.
Take the plastic nuts that came off the PiJuice, and glue then into the provided spaces in Layer 2
Now that it is glued, you can sand the case to make it look perfect!
In order to get your case look perfect, you will need to sand. I use the following:
- Rough sand with a 100 grit, so all the layer lines are removed. Any outward facing plastic looks grey and is quite rough, but there are no visible layer lines, or fluffy bits of plastic.
- Smooth sanding - with a 400 to 800 grit sandpaper, start to work the fat surfaces smoother and smoother until it makes no difference if you are sanding, the PLA will still look slightly scratchy.
- Brasso - Use a metal rubbing compound like Brasso, to give the plastic a perfectly smooth finish.
- Finally spray one coat of Flat Black spray paint. You can use any (I used Rust-oleum) so long as it bonds to plastic.
Step 5: Wiring the Components
Use the wiring diagram to wire up all the components so that each component is wired with its corresponding colour coded cable. Once you have done this, you can insert the individual boards into the case, and join the wires together.
Step 6: Laser Etching the Wood Backplate
This step will require you to have the laser attachment to your printer, like the Ender 2. This uses the PWM of the fan speed controller as the power controller for the laser. When the fan is full, then the laser is full, and if the fan is say 10% then the laser is burning only slightly into the wood. The result is to be able to "etch" into a surface like wood. The gcode I used is provided - it sets the height of the laser to 50mm, so be sure to make the focus of the laser correct at 50mm.
Optional: You can also make your own design if you like, but then you will have to go to this site: http://nebarnix.com/img2gco/
The wood needs to be cut to 112mm x 230mm, and you will need to sand the corders to fit into Layer 3
Step 7: Installing Software
Go to https://raspberrypi.org/ click Download, click Raspbian
- Unzip the downloaded file to your desktop, and use Etcher to flash the .img file to the SD Card.
- Take the SD card out of your PC, and insert in into the SD Card slot of the Raspberry Pi.
- Start the tablet by pressing the power button on the side of the case for 2 seconds.
- The first time it starts, it will automatically resize the partition to fill the SD Card.
After that, it will restart, and you should be in the Raspbian OS welcome screen.
- Click Next
- Click Next Again
- You can skip the password setting for now
- You can dismiss the option about the black border
- Select the wireless network of your router, and enter the password. You will need to have inserted a USB keyboard at this point as there will be no onscreen keyboard.
- Skip the update at the next screen (we can do that later)
- You're Done
Now we need to set some settings so that we can access the tablet remotely.
- Click the Raspberry Pi Icon (top left)
- Go to Preferences
- Go to Raspberry Pi Configuration
- Click on Interfaces Tab
- Enable: SSH and Camera, I2C, SPI
- Click Ok, to confirm and let it reboot
The rest of the work can be done in a remote terminal in your normal PC:
- Using Putty (on Windows) or Terminal (on Mac), log into the raspberry pi tablet as:
- ssh firstname.lastname@example.org
- Default password is raspberry
- sudo su
- apt-get update
- git clone https://github.com/waveshare/WM8960-Audio-HAT
- cd WM8960-Audio-HAT
- sudo nano /boot/config.txt
- Inside nano, make the following changes:
- find #hdmi_drive=2 and remove the # (uncomment) and change this value to 1
- find dtparam=audio=on and add a # in front (comment it out)
- Add a new line with hdmi_ignore_edid_audio=1
- sudo su
- apt-get install libasound-dev
- python -m pip install --upgrade pip setuptools wheel
- pip install pyalsaaudio
Now you need to build the 3 services that make the screen rotate, volume go up and down, and the fan come on and off.
- sudo nano /lib/systemd/system/PiTabAudio.service
[Unit] Description=Pi Tablet Audio Service After=multi-user.target Conflictsemail@example.com [Service] Type=simple ExecStart=/usr/bin/python /home/pi/Raspberry-Pi-Tablet/Services/audio.py StandardInput=tty-force [Install] WantedBy=multi-user.target
- sudo systemctl daemon-reload
- sudo systemctl enable PiTabAudio.service
- sudo systemctl start PiTabAudio.service
- sudo systemctl status PiTabAudio.service
- sudo nano /lib/systemd/system/PiTabScreen.service
[Unit] Description=Pi Tablet Screen Service After=multi-user.target Conflictsfirstname.lastname@example.org [Service] User=pi Group=pi Type=simple ExecStart=/usr/bin/python /home/pi/Raspberry-Pi-Tablet/Services/screen.py StandardInput=tty-force [Install] WantedBy=multi-user.target
- sudo systemctl daemon-reload
- sudo systemctl enable PiTabScreen.service
- sudo systemctl start PiTabScreen.service
- sudo systemctl status PiTabScreen.service
- sudo nano /lib/systemd/system/PiTabFan.service
[Unit] Description=Pi Tablet Fan Service After=multi-user.target Conflictsemail@example.com [Service] Type=simple ExecStart=/usr/bin/python /home/pi/Raspberry-Pi-Tablet/Services/fan.py StandardInput=tty-force [Install] WantedBy=multi-user.target
- sudo systemctl daemon-reload
- sudo systemctl enable PiTabFan.service
- sudo systemctl start PiTabFan.service
- sudo systemctl status PiTabFan.service
- sudo reboot
Now we can install the PiJuice tools and services:
- sudo apt-get install pijuice-gui
That's all folks!
Step 8: The Final Product
You should be all done now and can test the various features.
I found some nice black screws that fitted nicely into the plastic nuts that we glued into the corners. I drilled out the holes a bit so the nut head is sunk in a bit.
Runner Up in the
Raspberry Pi Contest 2020