Skip to content

a8ksh4/paper-pi-handheld

Repository files navigation

Paper Pi Handheld

This is the Raspberry Pi E-Ink Handheld, an art project with a few goals in mind:

  • Implement a reliable battry power and charging system
  • Custom thumb Keyboard with the Miryoku layout that I wanted more experience with. Also an opportunity to hand-wire a Keyboard.
  • Put this eink dispiay to use. It's console centric, and seemed like a good opportunity to get better with console tools. E.G. becoming proficient with "tmux". And the Keyboard layout makes emacs ctrl/alt key combos easy, so I might spend some time there instead of vi.
  • Further develop my 3D design skills.

Hey, we were featured on hackaday! https://hackaday.com/2021/04/27/paper-pi-is-an-ergonomic-cyberdeck-meant-for-thumbs/

So, it turns out it's kind of dumb typing with thumbs. It's slow. A few folks have agreed that this would be better with shoulder buttons to at least use the index finger for the function buttons. I totally agree. I've stated sketching up a setup with a rear facing keyboard, though, and I have a nuc laptop that's higher in the queue to work on. So this build will likely never see an update.

For now, though, it works great and I'm learning new stuff improving how it works. It was really convenient this week for testing network ports while running wires at home.

Profile Photo

Profile PhotoProfile PhotoProfile PhotoProfile PhotoProfile Photo

Parts List

  • Raspberry Pi 4 2GB
  • Waveshare 4.2" E-Ink Display
  • Keyboard
    • Mini Soft Touch Push-button Switches (6mm square) surface mount
    • Small Perfboards
    • Signal diodes
    • 2.54mm pins
    • Supermecro Controller
    • Micro Swiss pins and sockets
  • GPIO/Power Controlls
    • Generic 6mm clicky buttons
    • IM232 6-pin Slide Switch
    • 10k ohm (pull up) resistors
  • Battery and Power
    • 4 x ~3ah 18650 cells used
    • Retro Psu for charging and 5v
    • Anmbest 5PCS 1S 3.7V 4A 18650 Charger PCB BMS
    • Nickel Strip
    • USB-C breakout
  • PLA filament
  • Wire
  • Polyimide Tape
  • #2-28 Thread Size, 1/4" Plastec Screws

Software

OS

Using the Server Ubuntu 20.10 build. This worked out of the box with no customizaton needed aside from network setup and changing the default account name.

EDIT 2021-12-20: re-doing this with 21.10.

Helpful setup commands:

  • If you changed the account name from ubuntu to something else:
cd /home
sudo mv ubuntu ubuntu.old
ln -s ubunutu your_acct
cd ~
  • Add needed packages to work with gpio and eink display
sudo apt install git libjpeg-dev zlib1g-dev wiringpi mlocate  python3-rpi.gpio
pip install papertty
# Probabl not needed:
sudo apt install gpio-common virtualenv python3-lgpio
  • Git repos checkout
cd ~/git
git clone https://gitlab.com/norris.daniel/paper-pi-handheld.git 
git clone ...
  • Venv setup

  • Service enable

ln -s /home/ubuntu/git/paper-pi-handheld/service/papertty.service /etc/systemd/system/papertty.service
ln -s /home/ubuntu/git/paper-pi-handheld/service/gpio.service /etc/systemd/system/gpio.service

  • Improve Power use by turning off hdmi:
tvservice -o

Display

Setting this up in Ubuntu was a bit of a cludge trying to get the needed libraries installed and I didn't document it well. Will have to capture better notes next time. Its much more simple to set up on Raspberry PI OS. However, Ubuntu seems to better support the variety of terminal sizing used in PaperTTY, so I'm glad to be using it.

Using the fantastec PapirTTY module from here: https://github.com/joukos/PaperTTY

See:

  • bin/start.sh
  • service/papertty.service

I added a check in start.sh to look for marker files under /tmp from the gpio service to trigger different font sizes. And the Block cursor is MUCH easer to follow than the default line.

Commands notest from setup on Ubuntu 21.10: if you changed your user acct name from ubunutu to something else:

mkdir git; cd git

virtualenv --python=/usr/bin/pypy3 papertty_venv_pypy . papertty_venv_pypy/bin/activate pip3 install papertty

GPIO and Power

The GPIO service starts up gpio_buttons.py, which:

  • in turn configures five buttons to run specicific commands as root and
    • touch files and restart the PaperTTY service to toggle resolution
    • initiate a shutdown
    • tbd...
  • every two minutes checks the voltage from the RetroPSU via I2C and puts it in /tmp/battery_voltage
  • if the battery voltage is below 3.2, broadcasts a warning with the 'wall' commad. The .bashrc sets up PS1 to pull the voltage from the file and puts it on the prompt for reference.

See:

  • bin/gpio_buttons.py
  • service/gpio.service
  • .bashrc

Keyboard

The keyboard firmware is built with qmk, with the Miryoku branch checked out and applied to a 3x5_3 layout.

See:

  • kb

General process to build the firmware for this keyboard:

  • Install qmk
  • cd ~/qmk_firmware
  • git remote add manna-harbour git@github.com:manna-harbour/qmk_firmware.git
  • git fetch manna-harbour
  • git checkout --track manna-harbour/miryoku
  • cp this_repo/kb ~/qmk_firmware/keyboards/handwired/kb
  • And then build and flash the firmware:
    • make handwired/kb:manna-harbour_miryoku:flash
  • Or with querty layout:
    • make handwired/kb:manna-harbour_miryoku:flash MIRYOKU_ALPHAS=QWERTY

Construction

Keyboard

It's a verry standard 5x3_3 layout, with total 10 columns and 4 rows. I tested a few button types to find something that felt nice and reluctantiy settled on the surface mount buttons shown top-left here:

kb

They worked out much better than I expected. It turned out to be pretty easy to solder them in between the pins, and the pins were perfect for soldering the diodes and wires to.

kbkb kbkb kbkb kbkb

Battery

Nothing exciting. I took 4 cells with similar capacity and internal resistance, paired them with a bms to protect against over-discharge and over-charge.

baba baba

The batteries with bms are put in parallel and connected to the RetroPSU. I don't have a good photo of the RetroPSU...

Charging

GPIO buttons

The GPIO buttons are wired with a 10k pullup resistor to the 3.3v pin on the pi. When the button is pushed, the pin is grounded. I've tried GPIO buttons on a previous project using only the PIs internal pullup, but it seemed succeptable to noise and would trigger when plugging in power or other interference. So the external pullup is a good idea. I have another project where I'll probably solder the resistors right to the bottom of the pi rather than on a breakout board. Should simplify the breakout and keeps the 3.3v at the pi.

gpgpgp

Case

The standard design process for stutt like this, afaik, is sketch, extrude, sketch, extrude, repeat. I really like designing in onshape. The model for this project is visible here: https://cad.onshape.com/documents/13dcc4cd36db3b0ea3155a7a/w/e8b5185664b2f77b660e3fdd/e/d6a897af7acc9e3dde9fd0a4

I think if you create an (free) account, you can copy it and modify or export it.

os

The initial sketch is extruded many times to make a shell:

osos

And then details are added. Example slot for the RetroPSU and spot to screw in the usbc charge port. I couldn't use the port built into the PSU because of its orientation and lack of planning for it in this design.

os

Example of a sketch on a surface and subsequent extrude to add openings for the pi HDMI and audio ports:

osos

About

An E-ink Handheld Linux Computer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published