Capacitive Touch on the micro:bit

Trigger a circuit with a touch… no ground required!

Note: This post describes a hack to use capacitive touch on the micro:bit V1.5 but shortly after doing this, the micro:bit V2 came out, featuring real capacitive touch.

Out of the box the micro:bit has three touch pins which relies on a person touching not only the pin they want to trigger, but also to touch ground. Typically a person holds or touches something connected to ground, and then with their other hand touches one of the touch pins. This is how the Makey Makey works as well. It’s like capacitive touch (or capacitive sensing) but it’s not exactly. [It’s resistive touch.]

With a bit of experimentation we found that you can do capacitive touch on the micro:bit (sort of) so we wrote up a guide how to do it for the Brown Dog Gadgets Project Database called Capacitive Touch.

Two things to note about this one, first we are using the pins for analog input and while there are three more pins that do analog input on the micro:bit we found their performance to be a bit more unreliable than pins 0, 1, and 2. Of course since this is really just a hack, don’t let that stop you from using them. Second, there is no calibration done on the pins. For one of our Invention Board projects using capacitive touch we do a calibration at start so the pins know what is touched and what is not touched, as it can often change depending on the environment. The code we present does no calibration, but we’ll probably add that in the future.

As usual we’re using Maker Tape along with a LEGO baseplate and a Bit Board. (If you want a Bit Board to go with your micro:bit, we’ve got a Kickstarter campaign running now.) Capacitive touch is a lot of fun, and I’ve used it for many projects over the years. And yes, you can certainly incorporate other objects or surfaces besides Maker Tape.