Overview

RaspberryPi projects are always lots of fun, and when combine it with displays, 3D printing and Moteinos, the result can only be awesome!

If you have an older older RaspberryPi and an official touch display, you can build a portable display that 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. You can monitor such things as your smart home interface, or an IP camera, a weather webpage or whatever else.

Here’s the monitor showing my home automation Gateway:

3D Printed Parts

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:

 

Electronics

Prepare the MightyBoost and Moteino for mating, solder the headers and program the Moteino with the MightyBoost sketch using an FTDI-Adapter or equivalent USB-serial adapter. This combo will provide:

  • 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.

Power analysis

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:

Pi Software Setup

For a nice lean and speedy setup, I recommend 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:

First I installed Raspbian Lite using Etcher on a 4GB card (non Lite doesn’t fit anymore!). 

  • Run sudo raspi-config:
    • 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
  • Run sudo raspi-config again and enable GUI boot (under Boot Options) – select Desktop/CLI -> Desktop/Autologin
  • Save and reboot
  • Run 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.txt and add this line:
    lcd_rotate=2
  • sudo reboot and 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 reboot again 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 & 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!