# No-Solder Visualizer Capacitive Touch Controller

## Overview

https://youtu.be/pd7OYrRKL6g

![](https://cdn-learn.adafruit.com/assets/assets/000/098/992/medium800/circuitpython_vtc_-5747.jpg?1611784264)

Use the power of touch to control the show!

[**Animus**](https://animusvisualizer.webflow.io/) is a beautiful music visualizer for mac os made with **Processing**. There are a number of keyboard shortcuts to adjust the visualizations, but instead of a computer keyboard, you can use a custom touch controller you design and build yourself. Coded with CircuitPython.

This project uses the MPR121 12-key cap touch sensor STEMMA QT breakout as input for a QT Py, which will act as a USB keyboard device for your computer.

**The great thing about this project is there's NO soldering required - you can plug-and-play the capacitive touch board into the QT Py using a simple cable connection - and then use copper tape to make the pads!**

&nbsp;

Info: 

## Parts
### Adafruit MPR121 12-Key Capacitive Touch Sensor Gator Breakout

[Adafruit MPR121 12-Key Capacitive Touch Sensor Gator Breakout](https://www.adafruit.com/product/4830)
Add lots of touch sensors to your next microcontroller project with this easy-to-use 12-channel capacitive touch sensor breakout board, starring the MPR121. This chip can handle up to 12 individual touchpads with plug-and-play STEMMA QT connector and large alligator/croc-clip friendly pads,...

In Stock
[Buy Now](https://www.adafruit.com/product/4830)
[Related Guides to the Product](https://learn.adafruit.com/products/4830/guides)
![Adafruit MPR121 12-Key Capacitive Touch Sensor Gator Breakout connected to a Feather. A finger presses alligator pads on breakout and OLED displays which pads are touched.](https://cdn-shop.adafruit.com/product-videos/640x480/4830-04.jpg)

### Adafruit QT Py - SAMD21 Dev Board with STEMMA QT

[Adafruit QT Py - SAMD21 Dev Board with STEMMA QT](https://www.adafruit.com/product/4600)
What a cutie pie! Or is it... a QT Py? This diminutive dev board comes with our favorite lil chip, the SAMD21 (as made famous in our GEMMA M0 and Trinket M0 boards).

This time it comes with [our favorite connector - the STEMMA QT](http://adafruit.com/stemma), a chainable I2C...

In Stock
[Buy Now](https://www.adafruit.com/product/4600)
[Related Guides to the Product](https://learn.adafruit.com/products/4600/guides)
![Animation of Adafruit QT Py with onboard NeoPixel in a rainbow swirl.](https://cdn-shop.adafruit.com/product-videos/640x480/4600-07.jpg)

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

### Short Wire Alligator Clip Test Lead (set of 12)

[Short Wire Alligator Clip Test Lead (set of 12)](https://www.adafruit.com/product/1592)
Connect this to that without soldering using these handy mini alligator clip test leads. Approximately 4.5" overall cables with alligator clip on each end, color coded. You get 12 pieces in 6 colors. Strong and grippy, these always come in handy! We often use these in conjunction with a...

In Stock
[Buy Now](https://www.adafruit.com/product/1592)
[Related Guides to the Product](https://learn.adafruit.com/products/1592/guides)
![Top-down view of 6 pairs of short wire alligator clips.](https://cdn-shop.adafruit.com/640x480/1592-00.jpg)

### Copper Foil Tape with Conductive Adhesive - 6mm x 5 meters long

[Copper Foil Tape with Conductive Adhesive - 6mm x 5 meters long](https://www.adafruit.com/product/3483)
Copper tape can be an interesting addition to your toolbox. The tape itself is made of thin pure copper so it's extremely flexible and can take on nearly any shape. You can solder to it, and the tape itself can carry current just like a wire. On the back is an electrically conductive...

In Stock
[Buy Now](https://www.adafruit.com/product/3483)
[Related Guides to the Product](https://learn.adafruit.com/products/3483/guides)
![Roll of Copper Foil Tape with Conductive Adhesive - 6mm wide](https://cdn-shop.adafruit.com/640x480/3483-00.jpg)

## Other Parts

You'll also need some cardboard or other surface to affix the controller. I used a 18cm wooden disc from a craft store (shown here with copper tape applied).

Glu Dots or double stick adhesive tape works well to secure the QT Py to the board.

If you want to print a graphic overlay, you can use some spray mount adhesive to secure it.

![circuitpython_vtc_-5737.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/980/medium640/circuitpython_vtc_-5737.jpg?1611783654)

# No-Solder Visualizer Capacitive Touch Controller

## Build the Touch Controller

![](https://cdn-learn.adafruit.com/assets/assets/000/098/960/medium800/circuitpython_vtc_-5725.jpg?1611727491)

You can get creative with the form factor of your touch control. Any non-conductive material will work as a base -- here I chose a wooden disc that I had from a craft store -- just make sure it's something to which the copper tape will stick well.

With the alligator clips and copper tape you can form the capacitive touch pads in any layout or pattern you like. Plus, since you don't need direct finger-to-copper contact for the touch to register, you can cover the copper pads with something more attractive, such as fabric, paper with a printed UI design, even a canvas with painted artwork.

## QT Py Mount

To begin, mount the QT Py near an edge of the board so that you'll be able to plug in a USB cable for power and HID data.

I used a Glu Dot to affix it.

Plug in the STEMMA QT wire to the QT Py and the MPR121 breakout.

![circuitpython_vtc_-5726.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/961/medium640/circuitpython_vtc_-5726.jpg?1611727834)

![circuitpython_vtc_-5728.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/962/medium640/circuitpython_vtc_-5728.jpg?1611727914)

## Alligator Wires

Clip the alligator wires to the breakout board's twelve connectors.

![circuitpython_vtc_-5730.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/966/medium640/circuitpython_vtc_-5730.jpg?1611728107)

![circuitpython_vtc_-5731.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/967/medium640/circuitpython_vtc_-5731.jpg?1611728114)

## Copper Tape

Cut a 2" segment of copper tape and remove the protective paper.

Fold over one end a small amount to give the clip something to bite into a little, then stick the strip to the base, folding a bit of excess around to the other side.

Continue doing this for each connector. Then, you can add some additional tape to help things stay put.

The larger surface area of each pad will give you a larger target for your touch interactions as well.

![circuitpython_vtc_-5732.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/968/medium640/circuitpython_vtc_-5732.jpg?1611728269)

![circuitpython_vtc_-5733.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/969/medium640/circuitpython_vtc_-5733.jpg?1611728276)

![circuitpython_vtc_-5734.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/971/medium640/circuitpython_vtc_-5734.jpg?1611728400)

![circuitpython_vtc_-5735.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/972/medium640/circuitpython_vtc_-5735.jpg?1611728476)

## Overlay

You can use the controller as is, or add a graphic overlay on top of the copper touch pads. You don't need to touch them directly for them to work!

Here's a sample graphic I made if you'd like to use it as a launching off point.

![](https://cdn-learn.adafruit.com/assets/assets/000/098/988/medium800/circuitpython_visualizercontrolsheet.png?1611783984)

## Graphic Overlay

Print your graphic and cut it out.

Use spray mount adhesive, or a glue stick, to affix the overlay to the board.

![circuitpython_vtc_-5739.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/984/medium640/circuitpython_vtc_-5739.jpg?1611783881)

![circuitpython_vtc_-5740.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/985/medium640/circuitpython_vtc_-5740.jpg?1611783889)

![](https://cdn-learn.adafruit.com/assets/assets/000/098/991/medium800/circuitpython_vtc_-5741.jpg?1611784066)

# No-Solder Visualizer Capacitive Touch Controller

## CircuitPython

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

## Set up CircuitPython Quick Start!

Follow this quick step-by-step for super-fast Python power :)

If you want to get started with your QT Py, and you have NOT soldered a chip to the back of it, download CircuitPython from the following link:

[Download the latest version of CircuitPython for your QT Py from CircuitPython.org](https://circuitpython.org/board/qtpy_m0/)
Warning: 

[Download the latest version of CircuitPython for your QT Py Haxpress from CircuitPython.org](https://circuitpython.org/board/qtpy_m0_haxpress/)
 **Click the link above and download the latest UF2 file.**

Download and save it to your desktop (or wherever is handy).

![adafruit_products_QT_Py_CP_download.png](https://cdn-learn.adafruit.com/assets/assets/000/095/209/medium640/adafruit_products_QT_Py_CP_download.png?1601397466)

Plug your QT Py into your computer using a known-good USB cable.

**A lot of people end up using charge-only USB cables and it is very frustrating! So make sure you have a USB cable you know is good for data sync.**

Double-click the small **RST (reset)** button, and you will see the NeoPixel RGB LED turn green. If it turns red, check the USB cable, try another USB port, etc.

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

![adafruit_products_QT_Py_neopixel_green.png](https://cdn-learn.adafruit.com/assets/assets/000/095/210/medium640/adafruit_products_QT_Py_neopixel_green.png?1601397596)

You will see a new disk drive appear called **QTPY\_BOOT**.

&nbsp;

&nbsp;

&nbsp;

Drag the **adafruit\_circuitpython\_etc.uf2** file to&nbsp; **QTPY\_BOOT**

![adafruit_products_QT_Py_BOOT_drive.png](https://cdn-learn.adafruit.com/assets/assets/000/095/211/medium640/adafruit_products_QT_Py_BOOT_drive.png?1601400747)

![adafruit_products_QT_Py_drag_UF2.png](https://cdn-learn.adafruit.com/assets/assets/000/095/212/medium640/adafruit_products_QT_Py_drag_UF2.png?1601400759)

The red LED will flash. Then, the **QTPY\_BOOT** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

That's it, you're done! :)

![adafruit_products_QT_Py_CIRCUITPY.png](https://cdn-learn.adafruit.com/assets/assets/000/095/213/medium640/adafruit_products_QT_Py_CIRCUITPY.png?1601400772)

# No-Solder Visualizer Capacitive Touch Controller

## CircuitPython Libraries

The touch controller code requires some CircuitPython libraries to work. Complete the following steps to get your board ready.

## CircuitPython Library Bundle

You'll need to install some libraries on your QT Py.

Carefully follow the steps to find and install these libraries from [Adafruit's CircuitPython Library Bundle](https://circuitpython.org/libraries).&nbsp; Our CircuitPython starter guide has [a great page on how to install libraries from the bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

You'll need to manually install the following libraries by copying the files to the **lib** folder on your **CIRCUITPY** drive:

- **adafruit\_bus\_device**
- **adafruit\_mpr121.mpy**
- **adafruit\_hid**

## Library Install Troubleshooting

If you get an error indicating you have run out of space while copying files over, please refer to the [Prevent & Remove MacOS Hidden Files section of the Troubleshooting page](https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#prevent-and-remove-macos-hidden-files-2978468-47) for information on resolving the issue.

# No-Solder Visualizer Capacitive Touch Controller

## Code the Touch Controller

## Text Editor

Adafruit recommends using the Mu editor for editing your CircuitPython code. You can get more info in [this guide](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Alternatively, you can use any text editor that saves simple text files.

## Code

Copy the code shown below and paste it into Mu, then save it to your **CIRCUITPY** drive with the name **code.py**

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Visualizer_Touch_Control/code.py

## How It Works

### Libraries

First, the libraries are imported, including the USB HID keyboard and adafruit\_mpr121 library for the cap touch breakout.

```python
import time
import board
import busio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import usb_hid
import adafruit_mpr121
```

### Setup

The i2c bus and sensor objects are created next:

```python
i2c = busio.I2C(board.SCL, board.SDA)
mpr121 = adafruit_mpr121.MPR121(i2c)
```

### Keyboard

The keyboard object is created and a list of keycodes that will be sent. You can adjust these to suit other uses if you like.

```python
kbd = Keyboard(usb_hid.devices)
keylist = [
    Keycode.RIGHT_ARROW,
    Keycode.ONE,
    Keycode.TWO,
    Keycode.THREE,
    Keycode.FOUR,
    Keycode.W,
    Keycode.A,
    Keycode.S,
    Keycode.D,
    Keycode.B,
    Keycode.I,
    Keycode.H,
]
```

### Main Loop

The main loop is super simple! It loops through twelve times, checking each cap touch pad to see if it's being touched.

If a pad is being touched, the corresponding key from the list is sent.

Then, a short pause for debouncing and it's done! This cycle repeats forever and ever.

```python
while True:
    # Loop through all 12 inputs (0-11).
    for i in range(12):
        if mpr121[i].value:
            kbd.send(keylist[i])
    time.sleep(0.15)  # Small delay to keep from spamming output messages.
```

## Use the Touch Control

First, download [Animus from this link](https://animusvisualizer.webflow.io/) and then install it. For non mac os operating systems, you will need to grab your code from the [GitHub page](https://github.com/codygibb/animus-visualizer).

With the QT Py plugged into your computer over USB, launch Animus and start some music playing for it to react to.

Notice the UI on the side of the screen? You don't need to mouse and click on those any longer! Try touching your touch controller pads instead!

Now, you can mix the visuals in style!

https://youtu.be/pd7OYrRKL6g


## Featured Products

### Adafruit MPR121 12-Key Capacitive Touch Sensor Gator Breakout

[Adafruit MPR121 12-Key Capacitive Touch Sensor Gator Breakout](https://www.adafruit.com/product/4830)
Add lots of touch sensors to your next microcontroller project with this easy-to-use 12-channel capacitive touch sensor breakout board, starring the MPR121. This chip can handle up to 12 individual touchpads with plug-and-play STEMMA QT connector and large alligator/croc-clip friendly pads,...

In Stock
[Buy Now](https://www.adafruit.com/product/4830)
[Related Guides to the Product](https://learn.adafruit.com/products/4830/guides)
### Adafruit QT Py - SAMD21 Dev Board with STEMMA QT

[Adafruit QT Py - SAMD21 Dev Board with STEMMA QT](https://www.adafruit.com/product/4600)
What a cutie pie! Or is it... a QT Py? This diminutive dev board comes with our favorite lil chip, the SAMD21 (as made famous in our GEMMA M0 and Trinket M0 boards).

This time it comes with [our favorite connector - the STEMMA QT](http://adafruit.com/stemma), a chainable I2C...

In Stock
[Buy Now](https://www.adafruit.com/product/4600)
[Related Guides to the Product](https://learn.adafruit.com/products/4600/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### Short Wire Alligator Clip Test Lead (set of 12)

[Short Wire Alligator Clip Test Lead (set of 12)](https://www.adafruit.com/product/1592)
Connect this to that without soldering using these handy mini alligator clip test leads. Approximately 4.5" overall cables with alligator clip on each end, color coded. You get 12 pieces in 6 colors. Strong and grippy, these always come in handy! We often use these in conjunction with a...

In Stock
[Buy Now](https://www.adafruit.com/product/1592)
[Related Guides to the Product](https://learn.adafruit.com/products/1592/guides)
### Copper Foil Sheet with Conductive Adhesive - 12" x12" Sheet

[Copper Foil Sheet with Conductive Adhesive - 12" x12" Sheet](https://www.adafruit.com/product/4607)
Copper sheet can be an interesting addition to your toolbox. The sheet itself is made of thin pure copper so its extremely flexible and can take on nearly any shape. You can easily solder to it, and the material itself can carry current just like a wire. On the back is an electrically...

In Stock
[Buy Now](https://www.adafruit.com/product/4607)
[Related Guides to the Product](https://learn.adafruit.com/products/4607/guides)
### Copper Foil Tape with Conductive Adhesive - 6mm x 5 meters long

[Copper Foil Tape with Conductive Adhesive - 6mm x 5 meters long](https://www.adafruit.com/product/3483)
Copper tape can be an interesting addition to your toolbox. The tape itself is made of thin pure copper so it's extremely flexible and can take on nearly any shape. You can solder to it, and the tape itself can carry current just like a wire. On the back is an electrically conductive...

In Stock
[Buy Now](https://www.adafruit.com/product/3483)
[Related Guides to the Product](https://learn.adafruit.com/products/3483/guides)
### Copper Foil Tape with Conductive Adhesive - 6mm x 15 meter roll

[Copper Foil Tape with Conductive Adhesive - 6mm x 15 meter roll](https://www.adafruit.com/product/1128)
Copper tape can be an interesting addition to your toolbox. The tape itself is made of thin pure copper so its extremely flexible and can take on nearly any shape. You can easily solder to it, and the tape itself can carry current just like a wire. On the back is an electrically conductive...

In Stock
[Buy Now](https://www.adafruit.com/product/1128)
[Related Guides to the Product](https://learn.adafruit.com/products/1128/guides)
### Copper Foil Tape with Conductive Adhesive - 25mm x 15 meter roll

[Copper Foil Tape with Conductive Adhesive - 25mm x 15 meter roll](https://www.adafruit.com/product/1127)
Copper tape can be an interesting addition to your toolbox. The tape itself is made of thin pure copper so its extremely flexible and can take on nearly any shape. You can easily solder to it, and the tape itself can carry current just like a wire. On the back is an electrically conductive...

In Stock
[Buy Now](https://www.adafruit.com/product/1127)
[Related Guides to the Product](https://learn.adafruit.com/products/1127/guides)

## Related Guides

- [Adafruit QT Py SAMD21](https://learn.adafruit.com/adafruit-qt-py.md)
- [Adafruit MPR121 12-Key Capacitive Touch Sensor Gator Breakout](https://learn.adafruit.com/adafruit-mpr121-gator.md)
- [A Logger for CircuitPython](https://learn.adafruit.com/a-logger-for-circuitpython.md)
- [PyPortal Titano Weather Station](https://learn.adafruit.com/pyportal-titano-weather-station.md)
- [Adafruit ADS7830 8-Channel 8-Bit ADC](https://learn.adafruit.com/adafruit-ads7830-8-channel-8-bit-adc.md)
- [NeXT Computer Keyboard to USB HID with CircuitPython](https://learn.adafruit.com/next-computer-keyboard-to-usb-hid-with-circuitpython.md)
- [Adafruit QMC5883P - Triple Axis Magnetometer](https://learn.adafruit.com/adafruit-qmc5883p-triple-axis-magnetometer.md)
- [Adafruit CAN Pal](https://learn.adafruit.com/adafruit-can-pal.md)
- [Adafruit STEMMA Piezo Driver Amp](https://learn.adafruit.com/adafruit-stemma-piezo-driver-amp.md)
- [Motion Sensor Bat](https://learn.adafruit.com/motion-sensor-bat.md)
- [Adafruit MCP3421 18-Bit ADC](https://learn.adafruit.com/adafruit-mcp3421-18-bit-adc.md)
- [Adafruit AHT20 Temperature & Humidity Sensor](https://learn.adafruit.com/adafruit-aht20.md)
- [May Pad Macropad with the KB2040, KMK, and CircuitPython](https://learn.adafruit.com/maypad-macropad-with-the-kb2040-kmk-and-circuitpython.md)
- [USB HID Crank Controller](https://learn.adafruit.com/usb-hid-crank-controller.md)
- [Introducing ItsyBitsy M0 Express](https://learn.adafruit.com/introducing-itsy-bitsy-m0.md)
- [LED Noodle Lantern](https://learn.adafruit.com/led-noodle-lantern.md)
