Close
0%
0%

mini (Pi)QWERTY USB keyboard

USB hid keyboard ... etc. for Raspberry PI

Similar projects worth following
10x5cm
based on SAMD21 and 56 colorful buttons

Interfaces

- micro USB HID
- USB HID on 4pin header
- serial
- I2C

WHY?

there is no small wired USB HID keyboard for RPI

Keyboard is designed as 2 layers

  • first top layer - holes and button names
  • second layer - buttons and controller

ALL FIT in one 10x10cm PCB ORDER

MICRO CONTROLLER is very powerful is exactly ARDUINO ZERO ...256Kb FLASH you can write

your own keyboard driver in simple arduino IDE

WITH I2C header you can ...

  • Add RFID NFC reader
  • Add display and get feedback from computer (like terminal)
  • add sensors (temp, humidity, pressure, light)

You can also create standalone computer :)

sch - 710.03 kB - 05/22/2018 at 13:08

See BOM
Download

brd - 176.84 kB - 05/22/2018 at 13:08

Download

sch - 532.01 kB - 05/18/2018 at 21:54

See BOM
Download

brd - 85.85 kB - 05/18/2018 at 21:54

Download

sch - 537.12 kB - 05/18/2018 at 21:11

See BOM
Download

View all 8 files

  • 56 × Tactile switch chose color and heigh as you want ;)
  • 1 × Atsamd21e18 main controller, arduino zero compatible
  • 1 × mcp1700 Power Management ICs / Linear Voltage Regulators and LDOs
  • 1 × micro USB connector
  • 2 × LED Fiber Optics / Emitters

View all 6 components

  • Firmware is done, is simple but effective

    bobricius08/13/2018 at 21:44 0 comments

    Keyboard have 4 layouts switchable with FN button.

    • lowercase letters
    • uppercase letters
    • CTRL + lowercase letter
    • CAPS LOCK

    of course tweaking is unlimited, you can make own layouts

    LAYOUTLEDsLetters
    1 - lowercaseA - OFF
    FN - OFF
    ESC, numbers, arrows, Backspace
    2- uppercaseA - ON
    FN - OFF
    TAB, symbols, Delete
    Arrows:
    UP - Page UP
    DOWN - Page Down
    LEFT - Home
    RIGHT - End
    After any button press go back to Layout 1
    3- CTRLA - OFF
    FN - ON
    Letter = CTRL + Letter
    Numbers = F1 to F10
    Return = SHIFT + Return
    After any button press go back to Layout 1
    4- CAPS LOCKA - ON
    FN - ON
    Same as mode 2
    After any button press stay in Layout 4
    #include <Keypad.h>
    #include "Keyboard.h"
    const byte ROWS = 7; //four rows
    const byte COLS = 8; //four columns
    byte rowPins[ROWS] = {15, 18, 16, 19, 28, 31, 30}; //connect to the row pinouts of the keypad
    byte colPins[COLS] = {3, 4, 5, 6, 7, 8, 9, 14}; //connect to the column pinouts of the keypad
    //define the cymbols on the buttons of the keypads
    char directKeys[ROWS][COLS] = {
      {'`', '1', '2', '3', '4', '5', '6', 1},
      {KEY_ESC, 'q', 'w', 'e', 'r', 't', 'y', ';'},
      {'[', 'a', 's', 'd', 'f', 'g', 'h', 39}, //39 is '
      {']', 'z', 'x', 'c', 'v', 'b', 'n', '-'},
      {'7', '8', '9', '0', KEY_DOWN_ARROW, KEY_RIGHT_ARROW, KEY_LEFT_ARROW, KEY_UP_ARROW},
      {'u', 'i', 'o', 'p', '.', '/', ' ', '='},
      {'j', 'k', 'l', KEY_BACKSPACE, 'm', 92, KEY_RETURN, ','}
    };
    char shiftKeys[ROWS][COLS] = {
      {'~', '!', '@', '#', '$', '%', '^', 1},
      {KEY_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', ';'},
      {'{', 'A', 'S', 'D', 'F', 'G', 'H', 34}, //34 is "
      {'}', 'Z', 'X', 'C', 'V', 'B', 'N', '_'},
      {'&', '*', '(', ')', KEY_PAGE_DOWN, KEY_END, KEY_HOME, KEY_PAGE_UP},
      {'U', 'I', 'O', 'P', '>', '?', ' ', '+'},
      {'J', 'K', 'L', KEY_DELETE, 'M', 92, KEY_RETURN, ','}
    };
    char fnKeys[ROWS][COLS] = {
      {'`', KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, 1},
      {KEY_ESC, 'q', 'w', 'e', 'r', 't', 'y', ';'},
      {'[', 'a', 's', 'd', 'f', 'g', 'h', 39}, //39 is '
      {']', 'z', 'x', 'c', 'v', 'b', 'n', '-'},
      {KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_DOWN_ARROW, KEY_RIGHT_ARROW, KEY_LEFT_ARROW, KEY_UP_ARROW},
      {'u', 'i', 'o', 'p', '.', '/', ' ', '='},
      {'j', 'k', 'l', KEY_BACKSPACE, 'm', 92, KEY_RETURN, ','}
    };
    char capsKeys[ROWS][COLS] = {
      {'`', '1', '2', '3', '4', '5', '6', 1},
      {KEY_ESC, 'Q', 'W', 'E', 'R', 'T', 'Y', ';'},
      {'[', 'A', 'S', 'D', 'F', 'G', 'H', 39}, //39 is '
      {']', 'Z', 'X', 'C', 'V', 'B', 'N', '-'},
      {'7', '8', '9', '0', KEY_DOWN_ARROW, KEY_RIGHT_ARROW, KEY_LEFT_ARROW, KEY_UP_ARROW},
      {'U', 'I', 'O', 'P', '.', '/', ' ', '='},
      {'J', 'K', 'L', KEY_BACKSPACE, 'M', 92, KEY_INSERT, ','}
    };
    
    // Create 3 new key layouts
    Keypad directLayout( makeKeymap(directKeys), rowPins, colPins, sizeof(rowPins), sizeof(colPins) );
    Keypad shiftLayout( makeKeymap(shiftKeys), rowPins, colPins, sizeof(rowPins), sizeof(colPins) );
    Keypad fnLayout( makeKeymap(fnKeys), rowPins, colPins, sizeof(rowPins), sizeof(colPins) );
    Keypad capsLayout( makeKeymap(capsKeys), rowPins, colPins, sizeof(rowPins), sizeof(colPins) );
    byte Layout = 0;
    char Key = 0;
    #define ledaA 27
    #define ledFn 17
    void setup() {
      Keyboard.begin();
      pinMode(ledaA, OUTPUT);
      pinMode(ledFn, OUTPUT);
      digitalWrite(ledaA, LOW);
      digitalWrite(ledFn, LOW);
      directLayout.begin( makeKeymap(directKeys) );
      shiftLayout.begin( makeKeymap(shiftKeys) );
      fnLayout.begin( makeKeymap(fnKeys) );
      capsLayout.begin( makeKeymap(capsKeys) );
    }
    
    void loop() {
      switch (Layout) {
        case 0:
          digitalWrite(ledaA, LOW);
          digitalWrite(ledFn, LOW);
          Key = directLayout.getKey();
          break;
    
        case 1:
          digitalWrite(ledaA, HIGH);
          digitalWrite(ledFn, LOW);
          Key = shiftLayout.getKey();
          if (Key >= 2) {
            Layout = 0;
          }
          break;
    
        case 2:
          digitalWrite(ledaA, LOW);
          digitalWrite(ledFn, HIGH);
          Key = fnLayout.getKey();
          if (Key >= 2) {
            Layout = 0; //
          }
          if (Key == KEY_RETURN)
          {
            Keyboard.press(KEY_LEFT_SHIFT);
          }
          if ((Key >= 'a') && (Key <= 'z'))
          {
            Keyboard.press(KEY_LEFT_CTRL);
          }
          break;
    
        case 3:
          digitalWrite(ledaA, HIGH);
          digitalWrite(ledFn, HIGH);
     Key = capsLayout.getKey();
    ...
    Read more »

  • firmware is unbelievable simple

    bobricius06/19/2018 at 18:51 4 comments

    Half of firmware working, I need write Shift / FN support. , is incredibly simple.

    I regret that I used such a powerful processor.

    Sketch uses 11808 bytes (4%) of program storage space. Maximum is 253952 bytes.

    #include <Keypad.h>
    #include "Keyboard.h"
    const byte ROWS = 7; //four rows
    const byte COLS = 8; //four columns
    char Keys[ROWS][COLS] = {
      {'`','1','2','3','4','5','6','X'},
      {KEY_ESC,'q','w','e','r','t','y',';'},
      {'[','a','s','d','f','g','h','*'},
      {']','z','x','c','v','b','n','-'},
      {'7','8','9','0',KEY_DOWN_ARROW,KEY_RIGHT_ARROW,KEY_LEFT_ARROW,KEY_UP_ARROW},
      {'u','i','o','p','.','/',' ','='},
      {'j','k','l',KEY_BACKSPACE,'m',92,KEY_RETURN,','}
    };
    byte rowPins[ROWS] = {15, 18, 16, 19,28,31,30}; 
    byte colPins[COLS] = {3, 4, 5, 6,7,8,9,14}; 
    Keypad customKeypad = Keypad( makeKeymap(Keys), rowPins, colPins, ROWS, COLS); 
    void setup(){
      Keyboard.begin();
    }
    void loop(){
      char customKey = customKeypad.getKey();
      if (customKey){
      Keyboard.press(customKey);
      delay(100);
      Keyboard.releaseAll();
      }
    }

  • First quick preview​

    bobricius06/18/2018 at 11:37 3 comments

    You can adjust button height with spacers between boards. Of course you can use any button sizes an colors,
    this button height is hard explainable (etc. my distributor have only this height with 1N switch force) but on real device is very interesting, of course in any height nobody can say that keyboard is comfortable. but 1N force version is very soft and easy to press.

    One bad is, every color have different switching force.

    Please understand this is only technology preview no new fashion line and all keyboard is only for short writing.

  • Boards in fab ...

    bobricius05/23/2018 at 21:19 0 comments

    I am just ordered boards ... blue soldermask, in future all colors :D

  • Front board

    bobricius05/22/2018 at 08:05 2 comments

  • new layout

    bobricius05/21/2018 at 08:28 0 comments

  • Keyboard 56 buttons

    bobricius05/21/2018 at 06:52 0 comments

    better layout more buttons and always in good dimensions :)

    7.4874 sq in (3.9150in x 1.9125in) / 4830.57 sq/mm (99.44mm x 48.58mm)

  • LCD ...

    bobricius05/20/2018 at 20:28 0 comments

    I started new project based on this keyboard

    https://hackaday.io/project/158479-pocket-computer-terminal

  • 2 constructions possibilities

    bobricius05/19/2018 at 20:55 0 comments

    - 2 layers bottom with buttons and top layer with nice silk (exactly like old Russians guys)
    (effective use 10x10cm cm PCB order 1. half layer buttons an logic + 2. half layer front panel)

    - buttons only and silkscreen .... more hardcore look

  • Keyboard is ergonomic ... :)

    bobricius05/18/2018 at 21:26 0 comments

    Russian engineers it solve years ago when make clone of ZX spectrum

View all 10 project logs

  • 1
    Soldering

    Solder all components, buttons, Atsamd21E18

  • 2
    ICE connection

    Connect gnd, vcc, reset, swd, swc wires to Atmel ICE programmer

  • 3
    Write bootloader

    chose Arduino ZERO in board menu, then use Write bootloader command

View all 4 instructions

Enjoy this project?

Share

Discussions

ꝺeshipu wrote 06/25/2018 at 15:56 point

  Are you sure? yes | no

bobricius wrote 06/25/2018 at 21:14 point

interesting, Odroid-go is my next game console ;)

  Are you sure? yes | no

jareklupinski wrote 06/14/2018 at 13:18 point

Or a trackball with two little buttons for right and left click! https://www.sparkfun.com/products/retired/9308 I had to give up on finding these in mass quantities, but they're pretty easy to find in tens on ebay :) I used it here https://hackaday.io/project/3555/gallery#54542401aadb0f0f1ab9883eb15ad92c

  Are you sure? yes | no

bholroyd wrote 06/11/2018 at 12:23 point

There's a nice large area to the right of the the board, above the mcu. any thoughts on what to put there, maybe a trackpad?

Also have you thought about adding some shoulder switches between the 2 pcb layers? (not neccesarily on the shoulders) Space or Shift, left and right, or user programmable keys might be good candidates for moving off the front panel.

  Are you sure? yes | no

bobricius wrote 06/11/2018 at 12:54 point

Trackpad, maybe in next version. Shoulders i think no, boards are on way, I want see and taste in hand.

  Are you sure? yes | no

reldred wrote 06/09/2018 at 05:50 point

Looks brilliant. Combined with an RPI, Pimoroni's Hyperpixel screen, and a big old lipo cell I think this would make the perfect little handheld.

Looking forward to being able to throw money at you.

  Are you sure? yes | no

bobricius wrote 06/11/2018 at 12:57 point

Hyperpixel screen is nice for small computer

  Are you sure? yes | no

fabian wrote 05/31/2018 at 09:56 point

this is not usefull for not english languages. in Polish are: ąźćżół 

add alt-gr and pgup/down for vi/terminal

  Are you sure? yes | no

bobricius wrote 06/02/2018 at 18:10 point

This is basic design. You can create own layout. I am from Slovakia we have much more special characters.

  Are you sure? yes | no

Vikas V wrote 05/30/2018 at 04:03 point

Cool project and build idea. Which PCB design software do you use?

  Are you sure? yes | no

bobricius wrote 05/30/2018 at 06:41 point

eagle

  Are you sure? yes | no

Lee Cook wrote 05/23/2018 at 11:31 point

Nice!!  Just thinking, you could reduce the amount of PCB designs (some site make them cheaper if you only have a single "design"), by using surface mount switches and having the fascia on the back of the switch panel.

https://www.ebay.co.uk/itm/4-5x4-5x3-8mm-to-9mm-SPST-SMD-SMT-Momentary-Button-Push-Tactile-Switch-PCB-4-Pin/222522814411?hash=item33cf64afcb:m:mnmuH_LYpRS30vLHg8-RXJw

Of course the layout becomes a little more wacky because of mirroring....

  Are you sure? yes | no

bobricius wrote 05/23/2018 at 11:46 point

Hi, I have only one design "last" all other pictures are only evolution. I use TH buttons because they have smaller footpint and can be much better aligned for hand soldering. ebay switches are good, I have about 1000ps but they are hard to press.

 I have some genuine buttons from tme.eu, they are soft to press and exist in more colors, of course price is higher

  Are you sure? yes | no

danjovic wrote 05/22/2018 at 17:46 point

Very cool! 

How about reduce the amount of keys by adding a key for symbols and another for numbers?  Then...
Q would be 'q'
SHIFT Q would be Q
NUMBR Q would be 1
SYMBL Q would be !
FUNCT Q would be F1 

After all this is a compact keyboard.

PS: Dont forget the CONTROL key for yielding 'standardized' keys like TAB (CNTROL I) and so on...

  Are you sure? yes | no

bobricius wrote 05/22/2018 at 19:44 point

possible but there is no reason for reducing keys, there is lot of space and enough GPIO pins. I this case keyboard look like on ZX spectrum. I think that button layout is perfect and max utilize all space. there is no problem change front panel and with software you have unlimited tweaks.

  Are you sure? yes | no

ActualDragon wrote 05/22/2018 at 13:39 point

Awesome project, for some reason, I can't upload the files to upverter.com, so i'll be designing my own based on your schematics. Just to be sure, this is the chip, right? https://upverter.com/upn/revision/f4f04f4c40883c4a/

  Are you sure? yes | no

bobricius wrote 05/22/2018 at 19:45 point

yes micro controller is atsamd21e18 you can use smaller memory variants. I chose 18 because is used in arduino zero

  Are you sure? yes | no

ondrejtoral wrote 05/20/2018 at 19:32 point

Great project, I will keep an eye on this. Hope surplus kits will be on tindie soon!

  Are you sure? yes | no

Ryan Mitchell wrote 05/19/2018 at 06:20 point

This is utterly brilliant, I was shocked to see this, it's so damn close to something I worked on years ago, it's uncanny.

Actually, I think I put some pics up here, let me look, ah, yeah:

https://hackaday.io/project/12946-ukiboard-a-keyboard-for-the-age-of-glass

I've been planning on digging up the files and finishing it for a while, I've wanted to make an Orange Pi wearable for a while now, so it (or your project) would be great.

That said, never having done any SMD work made building it quite a pain, and I kept running into bug after bug that eventually I chucked it in (Some short on the power supply area, interference on the Gyro, don't get me started on using QFN by hand).

All this and I didn't even know about the custom keyboard community, I was doing it all from scratch. Such a coincidence I ended up using the 32u4 like most of these boards, I just thought it was a good chip and liked the USB support. 

Anyway, best of luck! We really do need a nice mini keyboard for our Pi's and wearables, it'd be great if you succeeded in where I TEMPORARILY HALTED ATTEMPTS.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates