This is a short demonstration of different ways to use my Touch Keyboard PCB, revisiting the following previous projects:
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
This builds on the tutorials listed in the previous projects above.
If you are new to Arduino, see the Getting Started pages.
Parts list
- Arduino Uno
- Optional: DIY “touch” shield from Arduino Touch Piano – Part 2.
- OR: MPR121 board or shield.
- 8 ohm speaker or old headphone speaker
- 1x 220Ω resistor
- Breadboard and jumper wires
Arduino Touch Keyboard Revisited
The above diagram shows how to connect the “green” touch keyboard to my DIY touch shield from Arduino Touch Piano – Part 2. If you are building on solderless breadboard following any of the capacitive touch tutorials online, then you just need to know that the pins are in the following order (from left to right above):
- GND – C – C# – D – D# – E – F – F# – G – G# – A – A# – B – C
In the sketch from my previous projects, these are connected to the Arduino pins in the following order: D3 through to D11, then A0 to A3. D2 is the “common” pin for the touch circuit.
You can find the code for this one on GitHub here.
Arduino 12-note Keyboard Revisited
The above diagram shows how to connect the “silver” pcb in “stylus” mode. Each pad is connected to an INPUT_PULLUP pin and the stylus is connected to GND. Every time the stylus touches a pad it is the same as a button being pressed and pulling the pin LOW.
In this example this will trigger the playing of an Arduino tone() through a speaker connected via a 220Ω resistor to D12.
You can find the code for this one on GitHub here.
Alternative Configurations
Some other possible configurations and uses might include:
- Using an “off the shelf” touch module but extending the provided pads to the keys of one of these pcbs. See: Instant Touch Music.
- Connecting either of the boards to one or more MPR121 breakout boards or shields. See: Arduino MPR121 Touch Piano and Arduino MPR121 MIDI Touch Piano.
- Stringing several stylus keyboards together and “scanning” each in turn, using code similar to that found here: Pi Pico MIDI Matrix Decode – Part 4.
Trying these out is left as an exercise for the reader!
Closing Thoughts
This shows a few ways in which the Touch Keyboard PCB might be used. The two described in full can be seen in action in the video. I’ve not tried the others, but I see no reason why they won’t work too.
Do let me know in the comments if you have other ideas.
Kevin