Keyboard

The keyboard is a PocketType miniature ortholinear 40% keyboard kit available from  Mechboards - https://mechboards.co.uk  with numbers and symbols accessed by layer keys. It is microswitch based and OK for thumb based typing rather than touch typing. The kit requires a ProMicro format based controller, which is what attracted me, as I realised that I could install Espruino on the NRF52840 based [Nice!Nano](https://nicekeyboards.com/nice-nano/) controller which is combatible with the ProMicro pinout. The kit comes with blank keycaps, as pictured below. I have labelled these with transfers and then sealed them with clear nail varnish. The transfer set was for a standard set of characters - thus the creative use of orientation to label arrow keys etc.

The first software I implemented for the PockeType keyboard was a keyboard scanner written in Espruino. To save power this is normally quiescent but the first keypress activates it and it continues scanning for 5 seconds after the last key event. Espruino includes a module which makes it easy to get the keyboard to appear as a bluetooth HID keyboard to other computers.

To help me with using the keyboard layers, the mappings above are displayed when the bluetooth keyboard app **kbdble** is active.

Displays

Each display is a 2.13" (250 x 122 pixel ) reflective display with an ST7302 hardware driver. This display is similar to a Sharp Memory Display in that has no backlight and it permits much faster updates than Epaper displays. In low power mode with frame refresh set to 4Hz, each display uses on average 30 microamps. It is a versatile, in that, in high power mode it can update at a 32Hz frame rate with current consumption still less than 1 milliamp.

I developed the display driver using an Espruino Puck.js, as pictured above, which is powered by a CR2032 coin cell. The ST7302 permits display pixels to be updated in 24 pixels chunks, however, my driver only implements full screen updates since this takes just 10ms and partial updates might in fact be slower due to the quite complex mapping from the Espruino graphics buffer to display pixels. Consequently, the driver for each display uses a 4125 byte buffer with pixels stored in ST7302 order.

The Nice!Nano controller has 21 I/O pins. Scanning the keyboard requires 16 pins (4 rows and 12 columns) leaving 5 pins free which is just enough to drive the displays (clock, data, data/command and 2 x chip select pins - the reset pin is connected to a pullup resistor and I use S/W reset in the driver).

The low-power nature of the displays and the NRD52840 processor means that quiescent current is around 100uA. Consequently, the 1200mAH LIPO battery should only need to be charged once or twice a year - which has made solar charging less urgent, although it would be nice.

Software

All of the software is written in Gordon Williams's  Espruino https://www.espruino.com/ which is Javascript tailored for embedded applications. Espruino comes with extensive support for graphic operations and a huge set of support modules. It is interpreted which means that Espruino programs can be both written and executed on the Pocket Pad.

Pocket Pad's software is organised as a set of apps. Each app is an Espruino storage file with a name in the format *appname.app.js*. The system will display the app with an icon image if a file *appname.icon* exists, otherwise, it uses a default icon. Installing a new app is thus simply copying a file into the NRF52840 flash storage which is elegantly supported by the Espruino's   WebIDE.

Editor App

The only software needed to make the Pocket Pad a self contained Espruino program development device was an editor as pictured above. The editor can open and edit all of the Javascript files stored on the device. Of course, this means that it is possible to cause a crash that can only be repaired using the WebIDE, however, it also means the device can be used to upgrade itself and fix problems on the fly. The editor uses the arrow keys to navigate and select text, and supports the usual copy, cut and paste operations.

Clock App

Espruino has support to get both Android and Apple notifications over bluetooth. Consequently, when the clock app is running, it registers for Apple (ANCS) notifications and displays them as shown for an iPhone notification above. Pocket Pad time can be synchronised with my iPhone using the CTS service from the Pocket Pad Settings app.

Pocket Pad software, including Espruino firmware can be found on my Github repository here.

 Construction

While this is very much a hacked together prototype, the end result has proved to be quite robust, however, immersion would clearly kill it. The PocketType keyboard kit comes with a clear perspex base plate which I have cut down to use as a protector for the displays. The displays are soldered on to a piece of matrix board and the connections to the controller can be seen in the picture above. I was able to use the holes for an LED to mount a battery connector. The display board and keyboard are now mounted on a larger piece of perspex using brass stand offs.

For a future version, I cannot decide between a clamshell on the lines of a Psion PDA or a tablet format which would be more robust as hinge-less.