The key scanning circuit provides the electronic interface between the key switches and the micro-controller. Digital keyboards have many key switches. At least 88*2 are required for a velocity sensitive standard piano layout, and many experimental designs call for many more. Most microcontrollers have on the order of 10-20 digital I/O pins, so some scanning circuitry is necessary for all but the most trivial keyboards.
- SN74LS138N is the only DIP 3->8 pin decoder on digikey. Nice old school TTL logic family chip.
- There are several 4514 family 24-DIP 4-16 decoders available. i.e. CD74HCT4514E, HEF4514BPN
- You can get ADC's with onboard MUX to effectively provide lots of channels.
- You can get microcontrollers with built-in ADC's on darn near every pin. (Simpler!)
Drew: I'm really happy with the atmel atmega168 that I started using thanks to the excellent work of the arduino project, which is a cheaper and easier to use branch of the Wiring Project. The standard board can be programmed over USB, and it has a cross-platform IDE that really just works, even in OS X!
Update: Developing in C for any of the chips in the AVR family looks reasonably easy. I'm tinkering around with some code in the google group subversion repository.
External Links to Scanning Circuits
- A japanese guy selling pre-programmed PICs for key scanning. It takes about five, and he charges about $20 each.
- Velocity sensing IC gets 5 octaves with no further chips, 68 pin PLCC package
- E510 Velocity sensitive MIDI chip. Changeover switch type. 16 PIN DIL 128 keys velocity sensitive keyboard scanner
- Some DIY keyboard scanners based on PIC16F84:
- A DIY project, based on microcontroller, uses 74HC138 decoder chip
- MIDI keyboard Encoder (No velocity sensing)
Circuit Board Layout and Fabrication
One fab house popular among DIYers: