PocketType - Espruino Bluetooth Keyboard & Display

Posted on
  • I could not resist this PocketType keyboard kit from Mechboards when I saw it advertised at a very reduced price. I wanted to see if I could program it in Espruino as the sockets on the keyboard for a Pro Micro ATmega32U4 board are also compatible with a nice!nano board based on an NRF52840 processor.

    When I got the kit, I realised that there were enough spare pins to drive a display - in fact two low power ST7302 based displays as can be seen in the photo below.

    The top display in the picture is running a Bangle style launcher and the bottom display is a Terminal console. The bottom right key can be used to direct the keyboard output to an app running in the top display or to the console in the bottom display. In addition, the device can be made to appear as a bluetooth keyboard to another computer by running the keyble app.

    The keyboard is powered by a rechargeable LIPO battery. The keyboard matrix scanner is activated by pressing any key and I was pleased that it starts fast enough to capture the first key press. The end result is that the overall standby current consumption is less than 100 microamps. The spare lipo battery I used is 1200mah, so with light use, I will next have to charge it again some time in 2025.

    PocketType is a 40% keyboard with numbers and symbols accessed by using layer keys. The kit comes with blank keycaps which I have labelled with transfers and then sealed 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.

    With the addition of a simple text editor, the device is definitely a candidate for a deckchair/sun lounger programming tool - although it has to be said that typing on the microswitch based PocketType keyboard is thumb based and fairly slow.

  • Wow, that's awesome! I love the two displays.

    I'm not sure how the scanning is done, but there's a hack in the KeyPad module which (IMO) is quite nice: https://www.espruino.com/modules/KeyPad.­js

    You basically just pull down and watch all rows, then set all columns high (or vice-versa). Then when a key is pressed down you see that a pin has changed state and at that point you scan to see what changed (and I guess maybe keep scanning until the key is released). That way you don't have to waste a bunch of power scanning - you know as soon as any key is pressed.

  • Oh, missed this post completely. This is very nice. Love the dual display idea too :-)
    nice!nano clones are quite cheap on aliexpress so good source of small 52840 boards with usb and lipo charging chip.

    Few links
    https://zmk.dev/ ZMK firmware - keyboard firmware for these boards, based on ZephyrOS so most likely not using SoftDevice for BLE.
    https://github.com/joric/nrfmicro/wiki/A­lternatives - the SuperMini NRF52840 / Pro Micro is quite cheap on aliexpress

  • Those clones look crazy cheap, for example https://www.aliexpress.us/item/100500603­5267231.html

    £4.90 - I can't even buy a nRF52840 chip for that from mouser/farnell/etc, let alone the whole board with charging circuit!

    I wish I knew who makes them and I could order a bunch and resell them

  • @Gordon Thanks, I missed the keypad module but that is exactly how my scanner works. To make sure nothing is missed, I keep the scanner active for 5 seconds from the last key event after the first keypress wakes it up then it goes back to waiting for a key interrupt as you describe.

    @fanoush In fact, I started with some of the Aliexpress modules and in some ways, you get what you pay for. The quiescent current of the nice!nano is around 10 microamps while the Aliexpress module is more than 140 microamps.

    I now have a basic editor working and I can now hack all its software on the device itself. Hope to post a video of it soon.

  • yes, it is documented that scratching off some specific resistor near usb connector helps, it is 5K pull up to vcc by mistake but cpu can drive that pin too after the resistor is removed, have that cheap board too but did not test this yet. and the leak is when driving that pin low which turns off power to external stuff so if not used for anything it may be pulled high to prevent the leak(?)

  • I saw that too but I think it’s related to switching off the 3.3V supply pin so I do not think it helps if you do not switch off the 3.3V. That is, it’s a pullup on the pin which controls the 3.3V

  • OK, so I had to scratch it off. When it was there and D13 was pulled down it draw like 500uA, when pulled up it was still about 145uA (from 4.2V battery). When I scratched it off it still draw about 145uA when pulled up as before however when pulled down it turned off power to VCC pin and went down to normal 5uA idle when radio is not used. So the 140uA is the 3.3V voltage regulator when it is turned on. Which is not that great if you need to power something from 3.3V like the display. Does nice!nano have more efficient 3.3V regulator going to EXT_VCC pin? Anyway, nrf52840 can produce 3.3V (or 1.8V) by itself too when powered from VDDH (5v from usb or 4.2 from battery). And indeed the VDD pad near SWD gives 3.2V even if the regulator is turned off so maybe it could handle that low power display more efficiently.

    So overall it is good board with that resistor scratched off. Also the antenna is as good as my other boards, better than watches like Magic3. It can find xiaomi thermometer advertising over coded phy behind several walls which Magic can't. And rssi for that thermometer is about the same as on my phone or 52840 dongle from same location.

  • Thanks, that is interesting, I will try it on the boards I have. Yes, I think the main difference is the 3.3V regulator. The full schematic for the nice!nano can be found here https://nicekeyboards.com/docs/nice-nano­/pinout-schematic. There are two versions. I think the AliExpress board is like V1 except that the resistor should be 2M not 5K. I have the V2 board which has a different circuit for the external 3.3V.

    Can you post a photo of the location of the 5K resistor.

  • It is marked in red on that wiki page https://github.com/joric/nrfmicro/wiki/A­lternatives
    search for "Workarounds". I just crush it in the middle with small flat screwdriver but could be desoldered too.

    Also down on that page for nice!nano v1 "Regulator: AP2112K (code G3P, up to 600 mA, leaks 55uA), you can replace it with XC6220 (up to 1A, leaks 8uA)" so the voltage regulator leaks less than half of this cheap board. however if you power LED from it it draws much more anyway and if you need much less then the VDD pad could work (or GPIO pins).

  • I have posted a more comprehensive description of this on Hackaday https://hackaday.io/project/195010-pocke­t-pad/ . It has also been picked up by a Hackster writer here.

  • That's excellent! Really glad hackster picked it up too!

  • Here is the video of the editor in action writing the traditional hello world program. The typing is a little painful as I am used to using this keyboard with my thumbs.


    There is an example of cut and paste at the end of the video.

  • That's really cool! I like the "split screen" layout, sort of a physical IDE.

    Something I've been dreaming of for a while is a mobile LoRa texting device with a low-power display and a Blackberry keyboard. It could be a Pixl.js + BB Q20 keyboard + LoRa + antenna + battery in a handheld format. A bit like the old Cybiko, which had two-way text messaging over radio as early as 24 years ago. Or like an early Blackberry, only with LoRa.

    A related idea is to build a rudimentary social mesh network on top of this.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

PocketType - Espruino Bluetooth Keyboard & Display

Posted by Avatar for jeffmer @jeffmer