How the touch sensors work

A project log for Interactive Disco Dance Floor

A large interactive disco dance floor with hidden capacitive sensors

JeremyJeremy 07/01/2016 at 01:090 Comments

The main thing that makes the dance floor interactive is the touch sensors under the surface. This post is going to dive into how this works.

What are my options?

While working on this project I had a variety of suggestions from friends for what kind of sensors to use. Here are a few of them.

Pressure Sensors

By far the most common suggestion. I spent a considerable amount of time building homemade foam and velostat sensors and testing their effectiveness. The plastic doesn't have tons of flex, so pressure from one little square will be transferred to neighboring squares. It would be possible to filter this out, but in small tests, it was proving difficult when you have many people on the floor at once.

IR Sensors

Similar to some touch surfaces, you can send IR light through the surface plastic and detect how much gets scattered when the surface is touched (i.e. frustrated total internal reflection). For a continuous piece of plastic, it become challenging to detect for just one square, especially when we're pumping colored light out of it. Not impossible, just outside of my range of experience.

Tap/Accelerometer Sensors

This is a common technique made popular by SparkFun. The idea is that each square has an accellerometer and can detect taps (or stomps).

Off the bat, accellerometers are not cheap and I need 80+ sensors. Also, people would have to actively stomp on the floor to be detected. Light steps or foot sweeping motions would not be registered. Lastly, it can detect the step, but not the continued presence of the person.

Capacitive Sensors

Capacitive sensors can be tuned to pick up people in proximity to the sensor without actually touching it. This lets the dance floor accurately detect when people are lightly whisking across the floor. It's also cheap. Just put metal chicken wire against the plastic and attach a wire from that to the MCU.

Writing a Capacitance Library (or not)

If you've been following along with past logs, you'll know about the struggles I've had getting the capacitor sensors working.

Last year, I was taking the Arduino approach. I had never programmed pure gcc AVR C/C+, and was trying to build my own library based on existing work. Boy was this year a BIG learning experience.

The original library was a basic charge/discharge circuit. The problem was that, at the sensitivity I was going for, there was way too much noise to filter out. Every time I thought I had it working, it would break at full-scale. This included was many sleepless nights trying different things and not getting much closer. And into the wee hours of the morning I went.

Then my friend suggested I try the QTouch library, by Atmel. This wont work in a stock Arduino environment, so went back to square one to teach myself straight AVR GCC programming. Surprisingly, when I got everything compiled (which took some trial, error, and a lot of learning) the sensor right out of the box! Over the last several months I've seen very few false positives, even at full-scale. If only I had started with this: *facepalm* (I'm reasonably sure my friend suggested QTouch early on in the project, but going from Arduino to gcc AVR libc was too much to take on at the moment)

If you want to try a simplified QTouch example, I've uploaded a basic demo to github:

The Anatomy of a Dance Floor Touch Sensor

It all starts with the sensor plate. In this case it's just a square cut from of a roll wire mesh.

The mesh was cut into a square, just bit enough to fit in the square box. Then a wire is soldered to the center.

1/2" corner plastic

Then it's secured in the box and up against the bottom of the acrylic floor surface with a couple lengths of 1/2" corner plastic. This is the stuff that usually protects wall corners from impact.

Now we screw the circuit board to the side of the box and plug the sensor wire into it.

Power it up and it just works!

It might be hard to tell, but I'm wearing thick motorcycle boots and sliding my feet between squares to test it's sensitivity.