Fork me on GitHub

Project Notes

#396 CapacitiveTouchOrgan

A simple chromatic scale organ, controlled with a Freescale/NXP MPR121 Proximity Capacitive Touch Sensor and an Arduino.

Build

Here’s a quick demo..

clip

Notes

The MPR121 is a capacitive touch sensor. Originally produced by Freescale (now NXP), the part is end-of-life but still widely available, especially on breakout boards like this one.

MPR121_module

Both Sparkfun and Adafruit have procude boards and tutorials at one point.

I think I first picked up one of these modules after watching Julian Ilett’s video:

clip

Voltage Matching

The MPR121 is a <3.6V device, but I’m testing it here with an Arduino Uno running at 5V. The Uno conveniently provides 3.3V, which is fine to power the module, but that doesn’t help the I²C bus and interrupt.

Although I believe some have run the I²C at 5V without immediately destroying the module, I’m running the bus through a level shiter module.

Since the interrupt is output from the module (active low), it doesn’t need level shifting.

Code

The CapacitiveTouchOrgan sketch implements a simple 12-tone (chromatic scale from C5/523.25Hz) organ:

  • on interrupt from the MPR121..
  • uses the Adafruit_MPR121 library to get touch state via I²C/Wire
  • sounds the corresponding tone on pin 8

Uses:

Breadboard Construction

Breadboard

Schematic

Here’s an initial breadboard build:

CapacitiveTouchOrgan_bb_build

Organ Construction

I decided to use 12 old 5 cent coins for touch control, and mount it on some Ikea honeycomb cardboard packing material (surprisingly useful for quick builds).

Some protoboard with headers provides mountings for the MPR121 and level-shifting modules.

An 8Ω speaker with 100Ω current-limiting resistor is also mounted on the cardboard base.

I decided not to build-in and Arduino, so just provided a row of headers for connecting an external Arduino

CapacitiveTouchOrgan_build

My sketch of pin layouts on the protoboard:

protoboard_layout

All connections on the underside of the cardboard base:

CapacitiveTouchOrgan_build_reverse

Credits and References

About LEAP#396 AudioSensorsMPR121
Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.