Skip to content

Latest commit

 

History

History
151 lines (102 loc) · 8.56 KB

File metadata and controls

151 lines (102 loc) · 8.56 KB
layout default
title L5: Capacitive Touch
description Explore capacitive touch sensing on the CPX with MakeCode. Build a proximity sensor and a fruit piano from bananas and soda cans, then turn everyday objects into keyboard keys.
image https://img.youtube.com/vi/HKwtXrTdocE/hqdefault.jpg
parent Circuit Playground Express
has_toc true
comments true
nav_exclude false
usetocbot true

{{ page.title | replace_first:'L','Lesson '}}

{: .no_toc }

Table of Contents

{: .no_toc .text-delta }

  1. TOC {:toc}

<iframe width="100%" src="https://www.youtube.com/embed/HKwtXrTdocE" title="Introduction to capacitive touch sensing on the Circuit Playground Express" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
**Video.** In this lesson, we'll explore capacitive touch sensing on the CPX—building a touch "piano," visualizing raw capacitance and touch-threshold values, and calibrating touch sensitivity. {: .fs-1 }

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.

<iframe width="100%" src="https://www.youtube.com/embed/_eMAbP7ATOU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

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!

<iframe width="100%" src="https://www.youtube.com/embed/DrqrGA9OtvE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

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.

<iframe width="100%" src="https://www.youtube.com/embed/2HasGGKsyI0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

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](sensor-instrument.md){: .btn .btn-outline } [Next: CPX as a Keyboard](cpx-keyboard.md){: .btn .btn-outline }