Unlike many modern microcontrollers, RP2040 doesn’t come with a native capacitive touch peripheral. This doesn’t mean you can’t do it – the usual software-driven way works wonderfully, and only requires an external pullup resistor! In case you wanted a demonstration or you have a capacitive touch project in mind, this lighthearted video by [Jeremy Cook] is a must watch, and he’s got a healthy amount of resources for you in store, too!
In this video, [Jeremy] presents you with a KiCad schematic and an PCB design you can use to quickly add whole 23 capacitive touch sensing inputs to a Pi Pico! The board is flexible mechanically, easy to assemble as [Jeremy] demonstrates, and all the pins involved can still be used as regular GPIOs if you’d like. Plus, it’s fully open-source, can easily be assembled on your own, and available on Tindie too!
Of course, such a board doesn’t get created for no reason – [Jeremy] has a healthy amount of musical creations and nifty ideas to show off. We quite liked the trick of using old PCBs as capacitive touch sensing, using copper fills as electrodes – which has helped create an amusing “macropad of macropads”, and, there’s quite a bit more to see.
If capacitive touch projects ever struck a chord with you and you enjoy music-related hacking, [Jeremy]’s got a whole YouTube channel you ought to check out. Oh, and if one of the musical projects in the video caught your eye, it might just be the one we’ve featured previously!
There is no spoon.
Interesting how this combined with TnyUSB on the RP2040 quickly turns any conductive object into a Keyboard/MIDI/… device integrated with the host operating system.
No need to write driver or plugin with any software, just plug the spoon!
I have the same thing on the blue pill (keyboard or MIDI, no driver), without needing an external resistor. ( https://github.com/arpruss/ADCTouchSensor/tree/master/examples ) I remember making a play-dough piano for my daughter with it.
All this is handy for a simple project where you need an input but don’t want to bother with any buttons–you can just touch a pin.
Another option is to use an esp32-s2 for touch projects, it’s very cheap, supports 14 touch inputs and you can run circuitpython if you want to.
We see what you did there! 🤣
What, no input protection, not even series resistors?
Thanks so much for the writeup!
As far being as open source, I haven’t released the EDA files, but the code is available.
OTOH the video largely shows how it was designed.
A nice implementation of touch switches in CMOS, in a drum machine kit.
https://paia.com/touchsw/
I believe this is the software implementation being used here: https://github.com/adafruit/circuitpython/blob/main/shared-module/touchio/TouchIn.c
Hey, Thanks for the video!
is this scalable?
for example adding 128 capacitive touch sensing inputs using the same technique?
You can get by with the internal pulldowns. I’ve got an implementation that does this with no extra components in PIO with interrupts and mostly debounces the signal (it can get false positive changes that need to get filtered out by the CPU). https://github.com/forshee9283/pio-touch