RaspberryPi projects are always lots of fun, and when combine it with displays, 3D printing and Moteinos, the result can only be awesome!
I had an older RaspberryPi and a touch display, and I wanted a portable IP camera monitor which I can mount or move anywhere. You can build a similar portable display, it will run on battery up to a few hours depending battery capacity – and it will automatically safely shutdown if the battery dips below a programmable voltage. It’s a nice convenient way to monitor your smart home interface, or an IP camera, weather or whatever else.
I had to find a suitable case and this adafruit one was almost perfect as-is. But who uses a Pi with a hard power switch? I wanted to use my own hardware (MightyBoost + Moteino) for battery power and backup, as well as a convenient power and reset button, I had to mod the case and add some holes to make everything fit. I also added some tripod mounts so I could mount this on a tripod or hang it from a shelf or a cabinet. Read on for the build details. I also put together a guide that will be maintained with any future changes to this project.
3D backbone frame
The 3D enclosure and all its parts are shared on Thingiverse, print it in your favorite or available material.
The first important piece is a frame which holds the electronics, this mounts to the display using M3 screws, I printed this from PLA (fastest draft mode) and it came out great:
Power backup and reset/shutdown control
- battery backup (in case power goes out)
- battery charging while MightyBoost USB is plugged in – ensure you have a good 2A+ USB power supply – when plugged in this powers the Pi+display and also charges the battery!
- Pi 5V boosted power from a LiPo battery
- convenient reboots and shutdowns from the push of a button
You will need a momentary push button (non latching switch), such as this one which also has the integrated status LED, and I recommend either soldering wires for power, or use high quality jumper wires such as these to ensure the voltage doesn’t dip to your Pi and then to the display.
Proceed to mounting the display board, RaspberryPi and the MightyBoost+Moteino to the frame using short M2.5 screws or similar. Add a LiPo battery and power the MightyBoost to ensure the battery is charging (red LED on if not already charged) and 5V power is ready (green LED on when battery or USB power is provided). The wiring can be seen in the photo below, you can also see the MightyBoost guide for specific details of its own wiring and principle of operation.
The wiring summary is as follows:
- Main power comes in through the MightyBoost USB port which keeps the battery charged. It falls back on battery boost when USB power is disconnected, powers the Pi+display as long as there is juice in the battery
- The Moteino controls the MightyBoost and a momentary (non-latching) button is required. In addition, an output power status LED indicator is available to show when 5V* output power is ON. These 4 button connections are seen below in yellow, and blue/green for the button’s internal LED
- The 5V* output from the MightyBoost is controlled by this button, and is wired to the Pi GPIO pins 2 & 6 (5V, GND)
- The BootOK/Shutdown signals from the MightyBoost are connected to the Pi’s pins 24 and 26 respectively (ie. GPIO8 and GPIO7), these are picked up by the shutdown.sh script we will install in the next section
- Finally, connect the display ribbon cable to the Pi, and the Display control board also needs 5V power, take it from the Pi’s extra 5V and GND pins 4 and 9 (or better: solder it directly to the MightyBoost’s 5V* output)
You can test power the setup and the Pi should boot and screen should be active. The screen shares its power with the Pi’s 5V power rail. You should see at least 5V on the display 5V pin, if not, your connections might not be good enough and the screen might become unstable, check your wiring again.
A quick test reveals the Pi+display+WiFi pulls an average ~1.4A, a hefty load on the battery. You might want to use a good quality beefy battery pack to meet the demand.
Also, if you plan to move this display a lot or use it disconnected from power, you might want to change the default ~200mA charging current of the MightyBoost to 500mA by cutting/resoldering this solder jumper:
Chromium Kiosk Mode / Software Setup
I am personally using Raspbian Lite with Chromium in Kiosk Mode, to boot directly to a webpage. I used this guide to setup my Pi and here’s a quick reference of what I installed and what I did different.
- change the default password (and optionally the hostname)
- enable SSH
- enable Wait for Network at Boot (under Boot Options)
- enter WiFi credentials (under Network Options)
- change locale to your TimeZone
- Update the Pi and install the lxde desktop and chromium:
sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get install chromium-browser unclutter lxde
sudo raspi-configagain and enable GUI boot (under Boot Options) – select Desktop/CLI -> Desktop/Autologin
- Save and reboot
sudo nano ~/.config/lxsession/LXDE/autostart, delete everything and put this content in the file – the last line is the link to your webpage you want to display:
@xset s off @xset -dpms @xset s noblank @sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium-browser Default/Preferences @chromium-browser --noerrdialogs --kiosk https://moteino.com --incognito --disable-translate
- To flip/rotate the LCD by 180 degrees run
sudo nano /boot/config.txtand add this line:
sudo rebootand the display should show you the configured URL above!
- To allow reboot/shutdowns from the power button through the MightyBoost/Moteino, you need to install the shutdown script as described in the ATXRaspi guide:
sudo wget https://raw.githubusercontent.com/LowPowerLab/ATX-Raspi/master/shutdownchecksetup.sh sudo bash shutdownchecksetup.sh sudo rm shutdownchecksetup.sh
sudo rebootagain and now the BOOTOK green LED on MightyBoost should come ON and a short press will trigger a reboot and long press will issue a shutdown
Final touches and assembly
Once everything is working, add your external enclosure, and optionally hot/super-glue some tripod mounts to the case edges. I printed them in black PET at the fastest draftest possible settings which still took 3+ hours – the caveat was the enclosure holes were less than great, which is something I can live with, print yours in PLA at finer detail if you want a nice perfect case.
The lid mounts with any thin screws you may find in your junk box. I ended up adding a little hot glue to the edges to ensure a solid bond between the case and the display:
Enjoy your new portable display!
Here’s the monitor showing my home automation Gateway: