Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/tutorials/tutorial_1_breadboard_keyboard.md

91 lines
4.6 KiB
Markdown
Raw Normal View History

2016-05-10 15:05:25 +00:00
Tutorial 1 - breadboard keyboard
2016-05-09 14:05:08 +00:00
================================
2016-05-10 15:05:25 +00:00
When you finish this tutorial you will have a working keyboard and understand how a key matrix works.
2016-05-09 14:05:08 +00:00
## Why a breadboard keyboard is useful
2016-05-10 17:15:47 +00:00
All the tutorial example sketches run on breadboard keyboards that have 2 to 8 keys.
2016-05-09 14:05:08 +00:00
Breadboard keyboards have row-column matrices and diodes just like the big keyboards.
2016-05-10 17:15:47 +00:00
A breadboard is the easiest way to learn keyboard electronics.
Electronics are fickle, and you won't get everything right the first time.
There is a learning curve.
Compared to PCBs, breadboard keyboards are easier to learn on because:
2016-05-11 15:25:48 +00:00
* Mistakes are easily corrected; no soldering and desoldering
2016-05-09 14:05:08 +00:00
* Parts can be reused in many different configurations
* A small keyboard is easier to trouble shoot
Breadboard keyboards are useful for:
* learning keyboard electronics - diodes, micro controllers, I/O expanders
2016-05-10 15:05:25 +00:00
* learning the firmware development workflow
2016-05-09 14:05:08 +00:00
* prototyping circuits before making a PCB
2016-05-11 15:25:48 +00:00
## Breadboard keyboard starter kit
The parts needed to build all the tutorial Breadboard Keyboards are listed in [breadboard_keyboard_supplies.ods](breadboard_keyboard_supplies.ods).
Wire cutters (or nail clipper) is the only required tool.
A multi-meter is useful for trouble shooting.
2016-05-09 14:05:08 +00:00
## How a breadboard works
To understand the breadboard keyboard you will need to know the internal parts of a breadboard:
* power rail
2016-05-10 17:15:47 +00:00
* terminal strip
2016-05-09 14:05:08 +00:00
These are explained in [How to Use a Breadboard](https://learn.sparkfun.com/tutorials/how-to-use-a-breadboard)
2016-05-11 15:25:48 +00:00
## How a keyboard matrix works
This excellent article explains how the microcontroller, matrix, switches and diodes work together:
[How a Key Matrix Work](http://pcbheaven.com/wikipages/How_Key_Matrices_Works/)
2016-05-09 14:05:08 +00:00
## Building a basic breadboard keyboard
The basic breadboard has 4 switches and a microcontroller.
2016-05-10 15:05:25 +00:00
![breadboard keyboard with 2 rows and 2 columns](images/breadboard_keyboard_2x2_labeled.jpg "2x2 breadboard keyboard")
2016-05-09 14:05:08 +00:00
The key matrix has two rows and two columns.
Breadboard power rails are repurposed as matrix rows.
2016-05-10 15:05:25 +00:00
Short bare wires connect terminal strips into matrix columns.
Switch-diode pairs connect rows to columns.
2016-05-09 14:05:08 +00:00
The green rectangle on the right is the Teensy 2.0 microcontroller.
The matrix rows and columns connect to the microcontroller via jumper wires.
Breadboard keyboard assembly instructions:
1. Cut leads to length.
* tactile-switch-lead length 6 to 8 mm
2016-05-10 15:05:25 +00:00
* diodes 22 to 24 mm total end-to-end length, and save the cut offs for steps 2 and 3
2016-05-09 14:05:08 +00:00
2. Insert parts into the breadboard as shown in the picture.
2016-05-10 15:05:25 +00:00
* diode cut offs connect terminal strips into columns
* diodes are orient with cathode (banded end) towards the row (power strip)
* switches connect diode to columns
2016-05-09 14:05:08 +00:00
3. Insert jumper wires connecting Teensy2 to the matrix rows and columns.
* follow pin connections table (below) and consult pinout diagram in
2016-05-10 15:05:25 +00:00
[Teensy2_pinout.txt](../doc/Teensy2_pinout.txt)
2016-05-09 14:05:08 +00:00
2016-05-11 18:46:53 +00:00
todo add a schematic
2016-05-11 15:25:48 +00:00
2016-05-11 18:46:53 +00:00
<!-- This schematic was written by consulting the micro-controller's datasheet and using the ?? tool.
this table might not match the sketches, replace with a schematic
2016-05-11 15:25:48 +00:00
2016-05-09 14:05:08 +00:00
**Teensy 2.0 pin connections table**
| Pin number | Row Column |
|------------|-------------|
2016-05-11 15:25:48 +00:00
| 21 | row_0 |
2016-05-09 14:05:08 +00:00
| 20 | row_1 |
| 0 | col_0 |
| 1 | col_1 |
2016-05-11 15:25:48 +00:00
-->
2016-05-09 14:05:08 +00:00
## Compiling and loading the keyboard firmware
2016-05-10 15:05:25 +00:00
Follow the [keybrd Library User's Guide](../doc/keybrd_library_user_guide.md) to set up the Arduino environment and to compile and load keybrd firmware onto the keyboard's controller.
2016-05-09 14:05:08 +00:00
## Bigger breadboard keyboards
2016-05-10 15:05:25 +00:00
Sometimes its useful to prototype a full keyboard matrix before designing the PCB.
2016-05-09 14:05:08 +00:00
Several breadboards can be tied together into one.
2016-05-10 15:05:25 +00:00
![big breadboard keyboard](images/breadboard_big.jpg "breadboard_big.jpg")
2016-05-11 15:25:48 +00:00
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">keybrd tutorial</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/wolfv6/keybrd" property="cc:attributionName" rel="cc:attributionURL">Wolfram Volpi</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.<br />Permissions beyond the scope of this license may be available at <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/wolfv6/keybrd/issues/new" rel="cc:morePermissions">https://github.com/wolfv6/keybrd/issues/new</a>.