keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

tutorial_1_breadboard_keyboard.md 4.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. Tutorial 0 - breadboard keyboard
  2. ================================
  3. When you finish this tutorial you will have a working keyboard and understand how its key matrix works.
  4. [breadboard keyboard with 2 rows and 2 columns]
  5. (images/breadboard_keyboard_2x2_labeled.jpg "2x2 breadboard keyboard")
  6. ## Why a breadboard keyboard is useful
  7. A breadboard is the easiest way to learn keyboard electronics.
  8. Electronics are fickle, you won't get everything right the first time, there is a learning curve.
  9. Breadboards make the learning electronics faster and fun.
  10. Breadboard keyboards have row-column matrices and diodes just like the big keyboards.
  11. Compared to full size keyboards on PCBs, breadboard keyboards are easier to work with because:
  12. * Parts can be reused in many different configurations
  13. * A small keyboard is easier to trouble shoot
  14. * Mistakes are easily corrected because no desoldering
  15. Breadboard keyboards are useful for:
  16. * learning keyboard electronics - diodes, micro controllers, I/O expanders
  17. * learning the firmware development process
  18. * prototyping circuits before making a PCB
  19. * testing firmware concepts before building the keyboard hardware
  20. ## How a breadboard works
  21. To understand the breadboard keyboard you will need to know the internal parts of a breadboard:
  22. * terminal strip
  23. * power rail
  24. These are explained in [How to Use a Breadboard](https://learn.sparkfun.com/tutorials/how-to-use-a-breadboard)
  25. ## Breadboard keyboard starter kit
  26. The parts needed to build all the Breadboard Keyboards in the keybrd tutorials are listed in [breadboard_keyboard_supplies.ods](breadboard_keyboard_supplies.ods).
  27. Wire cutters (or nail clippers) is the only required tool.
  28. A multi-meter is useful for trouble shooting.
  29. ## Building a basic breadboard keyboard
  30. The basic breadboard has 4 switches and a microcontroller.
  31. [breadboard keyboard with 2 rows and 2 columns of keys]
  32. (images/breadboard_keyboard_2x2_labeled.jpg "2x2 breadboard keyboard")
  33. The key matrix has two rows and two columns.
  34. Breadboard power rails are repurposed as matrix rows.
  35. Short bare wires connect switches into matrix columns.
  36. Diodes connect switches to rows.
  37. The green rectangle on the right is the Teensy 2.0 microcontroller.
  38. The matrix rows and columns connect to the microcontroller via jumper wires.
  39. Breadboard keyboard assembly instructions:
  40. 1. Cut leads to length.
  41. * tactile-switch-lead length 6 to 8 mm
  42. * diodes 22 to 24 mm total end-to-end length, and save the cut offs, they will be used in steps 2 and 3
  43. 2. Insert parts into the breadboard as shown in the picture.
  44. * orient the switches such that the leads are on separate terminal strips
  45. * orient diodes with cathode (banded end) towards the row (power strip)
  46. * use the diode cut offs to connect switches into columns
  47. 3. Insert jumper wires connecting Teensy2 to the matrix rows and columns.
  48. * follow pin connections table (below) and consult pinout diagram in
  49. [Connecting Teensy 2.0 to a Keyboard](connecting_teensy2_to_keyboard.md)
  50. **Teensy 2.0 pin connections table**
  51. | Pin number | Row Column |
  52. |------------|-------------|
  53. | 21 | row_0 | todo this table might not match the sketches
  54. | 20 | row_1 |
  55. | 0 | col_0 |
  56. | 1 | col_1 |
  57. ## Compiling and loading the keyboard firmware
  58. Follow the [keybrd Library User's Guide](todo /doc/keybrd_library_user_guide.md) to set up the Arduino environment and to compile and load keybrd firmware onto the keyboard's controller.
  59. ## How a keyboard matrix works
  60. Now that you have built your first breadboard keyboard, you can dig in and learn how it actually works.
  61. This excellent article explains how the microcontroller, matrix, switches and diodes work together:
  62. [How a Key Matrix Work](http://pcbheaven.com/wikipages/How_Key_Matrices_Works/)
  63. ## Bigger breadboard keyboards
  64. Sometimes its useful to prototype the full keyboard matrix before designing the PCB.
  65. Several breadboards can be tied together into one.
  66. [big breadboard keyboard](breadboard_big.jpg "breadboard_big.jpg")