Skip to content

How to create capable, small, USB keyboards with the DFRobot Beetle board. One to 25 keys are easily achieved. This repository covers hardware and software needed.

Notifications You must be signed in to change notification settings

babarrett/beetle-small-keyboards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 

Repository files navigation

Beetle Small Keyboards

Overview:

Sometimes you don't need many keys for a project, and the Arduino Beetle has 10 I/O pins plus a USB port for small projects. This combination is ideal for:

* USB based keyboards (or mice)
* Handwired (although PCB options are possible too)
* One to 10 keys are trivial
* Up to 25 keys are not much harder, though a PCB would help.
* Pogramable with macros, layers, supported by TODO: {TMK | QMK | Easy AVR} software
* Numeric pads (often 17, 19, 21, or 22 keys)
* Converting key "switch testers" to macro pads.
* Simple, inexpensive hardware

Initial project: 4 foot switches

My first project based on this technology is a foot-operated set of 4 (or 8) switches. The plan is to support four modifier keys, to be foot-operated. They are: Command (or Windows), Option, Control, and Shift.

The thought is that these could be used to support users with some hand problems.

This project will not require the manufacture of any printed circuit boards, and the switches will be hand-wired to the Beetle.

Parts count, and expenses are low.

Because the Beetle has 10 I/O pins available, and I only need 4 (or 8), I'll (hand) wire then directly.

Additional project

Again, with 10 I/O pins it is possible to do a standard keyboard scanning matrix of 5 x 5 (up to 25 keys), or 4 x 6 (up to 24 keys, with a scan layout that more closely matches the physical). These matrixes will require a diode at each switch to prevent "ghosting."

For example, searching Amazon for: numeric pad USB, most numeric pads have 17, to 22 keys on them, so the little Beetle will be quite capable for this application.

Parts list

Parts for 4 switches Qty Jameco URL
Adafruit Beetle 1 $9.95 2213325
5 Black RCA jacks 2 $1.95 229921
4 RCA sockets (1x3") 2 $0.49 319429
Case 1 $4.95 675462
USB-A to USB-micro B 1 $1.95 2196086
Foot switches (4) 4 $14.00 (Tatoo, drom China)
---------------- --- --------
Estimated total $33.29

Alternate part options:

  • Beetle $7.90 Digikey. USB + 10 I/O; 20mm x 22mm
  • 3.5 mm socket (need 4+) $0.74ea Digikey
  • 3.5mm jack (need 4+) $0.84ea Digikey
  • Case 3.6 x 2.25 x 1". Serpac 111i project box. Install RCA sockets in top. digikey $4.50
  • (for expanded experiments) 5v, 8 bit shift reg. $0.43 Digikey

Basic Beetle Specifications:

Parameter Value
Microcontroller ATmega32u4
Clock Speed 16 MHz
Operating Voltage 5V DC
Digital I/O Pins 10
PWM Channels 4
Analog Input Channels 5
UART 1
I2C 1
Micro USB 1
Power Ports 2
Flash Memory 32 KB (4KB used by bootloader)
SRAM 2.5 KB
EEPROM 1 KB
Size 20x22x3.8mm

Related / Alternate projects:

IO Port Mapping Beetle to Arduino Ports:

        
          Beetle    Digital   PWM   Analog
        Silkscreen	  Pin   Channel Channel	UART	    I2C
            RX	        0	                Serial-RX
            TX	        1	                Serial-TX
            SDA	        2	                            SDA
            SCL	        3	     3	                    SCL
            9	          9	     9	  A9		
            10	        10	  10	  A10		
            11	        11	  11	        
            A0	        A0	        A0		
            A1	        A1	        A1		
            A2	        A2	        A2		

        Power:
          Beetle
        Silkscreen	Description
            +           VCC
            -           GND

Getting Started

Development resources:

  • Summary on Deskthority
  • All the code and documentation on GitHub
  1. Plug-it in
  2. Blue LED on the Beetle should flash
  3. macOS:
    • Apple menu, About this Mac
    • Click System Report...
    • Select USB from the left column
    • Look for Arduine Leonardo in the USB tree
  4. Windows:
    • TODO:
    • aa

Load the new software

Development order for Beetle experiments (Arduino-only code) √ reset keyboard/controller after completing task √ 4-function calculator operations in floating point timing 1.5 million times. Time millis and report. Use random numbers?

  • Repeat timing with BigNumbers
  • Create a calculator that takes character array (string) input, treats each as a keystroke. Repeat 100,000 times. Report elapse time & result.
  • Repeat calcs and timing with "BigNumber" -- https://github.com/nickgammon/BigNumber
    • Mac OS X calculator seems to display and retain up to 19 digits
    • Arduino LCD display is 2 x 16 characters. (We could use more and have "guard digits") some 4x20 displays too
  • Sun serial (1200 baud, start, stop, inverted) by Ben Rockwood
    • https://github.com/benr/SunType5_ArduinoAdapter_SoftwareSerial
    • sunSerial(10, 11, true); // rxpin txpin, reverse logic (yes); connect to serial pads under Beetle
    • Light LED on every correctly received serial character. Blink twice if error
    • Connect to G80-9009 via breadboard (no DIN needed)
    • Look to see if any charactrs come through a) for main Kbd; b) for ancillary keys.
    • Install Sun scan code table, and output to USB for verification.
    • Pull request for Ben Rockwood's Sun to USB adapter. (docs)
    • Increase 6KRO to many, many KRO with buffer
  • Sun keyboard scan code resources

Using usb keyboard: https://www.pjrc.com/teensy/td_keyboard.html Google: arduino sending scan codes to usb keyboard

Hardware tasks

2-wire Arduino to LCD project:  http://www.instructables.com/id/2-Wire-LCD-interface-for-Arduino-or-Attiny/
and again (2011): http://3g1l.com/blog-cheap-arduino-2-wire-lcd-display-0
and again (2012): https://scargill.wordpress.com/tag/2-wire-lcd-for-arduino-a-working-example/
and again:        https://playground.arduino.cc/Code/LCD3wires
or "just buy it" ebay search: arduino 2 wire lcd. 4 x 20 = less than $10
                                                  Module dimension: 99mm x 60mm x 12mm.
                                                  Viewing area size: 64.5mm x 16mm



Sun kbd to USB via Beetle:
  Load code, test, point Sun-only codes for F13-F24 or so. Test.  
  
keyboard.println() is broken. Space instead of \n.
scan codes instear od keyboard.print
Buffered USB for > 6 KRO

About

How to create capable, small, USB keyboards with the DFRobot Beetle board. One to 25 keys are easily achieved. This repository covers hardware and software needed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published