Lesson 5: Capacitive Touch

Table of Contents

  1. Lesson 5.1: Intro to Capacitive Touch on the CPX
    1. Lesson 5.1 Code
  2. Lesson 5.2: Capacitive Sensing with Everyday Objects
    1. Lesson 5.2 Code
  3. Lesson 5.3: Making a Capacitive Touch Keyboard
    1. Lesson 5.3 Code
  4. Lesson 5.4: Making a Lo-fi Capacitive Touch Nintendo Controller
    1. Lesson 5.4 Code
  5. References
  6. How Capacitive and Resistive Touch Work
  7. Next Lesson

In Lesson 5 in our CPX series, we will learn how to use capacitive touch sensing. This is a multi-part series starting with an introduction to capacitive sensing.

Lesson 5.1: Intro to Capacitive Touch on the CPX

In this lesson, we will first introduce the concept of capacitive sensing before building a simple capacitive touch “piano.” We will then show how to visualize the raw capacitance values and capacitance touch threshold values, which are used to trigger capacitance events. Third, we cover how to use both auto-calibration and manual calibration to change the capacitance touch threshold before building a capacitive-responsive instrument (similar to Lesson 4: Light-Responsive Instrument).

Lesson 5.1 Code

Here is a link to the programs we built in Lesson 5.1.

Lesson 5.2: Capacitive Sensing with Everyday Objects

Building on 5.1, we will prototype an interactive piano out of everyday objects like an orange, banana, and soda can with the CPX, MakeCode, and capacitive touch sensing. We’ll again show how important it is to measure the capacitance touch values of different objects and to use auto-calibration or manual calibration to configure capacitance touch thresholds.

Lesson 5.2 Code

Here is a link to the programs we built in Lesson 5.2.

Lesson 5.3: Making a Capacitive Touch Keyboard

Building on 5.2, we’ll use capacitive touch sensing to make a custom keyboard and play music and video games with fruit, a coin, and a soda can. Essentially, we’re going to make your laptop think the CPX is a keyboard and have all sorts of fun using different objects as keys!

Lesson 5.3 Code

Here is a link to the programs we built in Lesson 5.3.

Lesson 5.4: Making a Lo-fi Capacitive Touch Nintendo Controller

Building on 5.3, we’ll use capacitive touch sensing to make a custom lo-fi Nintendo NES controller out of cardboard, copper tape, and tin foil and play Super Mario Bros.

Lesson 5.4 Code

Here is a link to the programs we built in Lesson 5.4.

References

How Capacitive and Resistive Touch Work

If you want to learn more about how capacitive and resistive touchscreens work, see below:

Next Lesson

In the next lesson, we’ll revisit using the CPX as a programmable keyboard and deepen our understanding.

Previous: Light-Responsive Instrument Next: CPX as a Keyboard


This website was developed by Professor Jon E. Froehlich and the Makeability Lab using Just the Docs. If you found the website useful or use it in your teaching, we'd love to hear from you: jonf@cs.uw.edu. This website and all code is open source (website GitHub, Arduino GitHub, p5js GitHub). You can find the MakeabilityLab_Arduino_Library here. Found an error? File a GitHub Issue.