Enginursday: Prototype Capacitive Touch Dance Floor with a Teensy and XBees

Prototype interactive dance floor using the Teensy's built-in capacitive touch pins and XBee Series 1s configured for I/O line passing.

Favorited Favorite 2

I’ve always wanted to build an interactive dance floor. After hearing about the capacitive touch pins available on the Teensy from Joel, I decided to try it out on a prototype made out of cardboard. While it is not the most durable floor, it was sufficient enough. I also added a pair of XBee Serial 1's configured for I/O line passing to make it simple for controlling something at a distance.

Prototype Capacitive Touch Dance Floor with Teensy and Wireless XBees Set for Line Passing

To test, I had my crewmate Julio come in from Block 1750. Every summer, we go out and fundraise by dancing in Boulder for a few events such as Block 1750’s Block Party. It takes a lot of work to fundraise and every dollar counts so for the finale, we usually have Julio hand hop for every dollar donated. I set up a counter with a 7-segment display to keep track of the number of hand hops and to see if the capacitive touch tile was reacting as expected. To verify that it is working, I had some people counting the hops at the same time. Check out the project demo below.

Results from stress testing the Teensy's capacitive touch sensing pins

While it seemed like a straightforward build, I had some interesting results from stress testing the Teensy's built-in capacitive touch pins. The sensitivity varied depending on the setup or environment. This required a few adjustments to get it working but it was not the most reliable. I would have to constantly tweak the sensitivity or set-up to get it working.

Power supply

 
The Teensy's capacitive touch pins read differently depending on the power supply. Switching from a wall adapter to a LiPo battery for remote power was enough to cause the Teensy to not react as expected. The Teensy was able to detect a touch by touching the LiPo battery and copper electrode. Adding a piece of copper under the cardboard floor with a wire leading to the battery for reference seemed to help.

Copper Tape and Wire Underneath the Tile for Reference

Differences in material and location

 
After testing the tile on different floors, I noticed that the tile would not react the same on each. The sensitivity with the tile and battery on carpet was not the same when testing it on concrete. With the wire touching the battery for reference, the Teensy had a false trigger when no one was directly touching the electrode. By keeping the same sensitivity, I had to add a piece of carpet under the tile and disconnect the wire from the battery. The sensitivity changed once again when placing it over a wooden floor. The tile also had false triggers when testing it out on the same type of floor around the building (i.e. first floor to second floor and different rooms).

Tile on Carpet Tile On Concrete Tile on Wood
Carpet Concrete Wood

Direct contact vs. proximity

 
Another characteristic of capacitive touch sensing is the ability to detect something even when the object is not directly touching the electrode. The sensitivity of the Teensy's capacitive touch pin was set just enough to detect a hand even though it was not touching. This was not ideal when my friend was hopping on his hand. The Teensy would still detect my friend even if he was above the electrode.

Teensy Detecting an Object when Not Directly Touching The Electrode

Making it better

If I were to continue using the Teensy's built-in capacitive touch pins for the interactive dance floor, I would try to:

  • Utilize more of the capacitive touch pins that are available instead of just one small tile for a wider area.
  • Add the TeensyView OLED or use the serial pass-through with the XBee’s UART pins to help adjust the sensitivity.
  • Use a more durable floor material instead of a flimsy piece of cardboard.
  • Seal the capacitive touch material to prevent the electrodes from damage.
  • Make the copper electrode bigger.
  • Add rubber pads below the tile to prevent sliding when a person is moving over the floor.
  • Place the electronics in an enclosure for protection.

Resources and going further

If you are interested in the circuit and example code used for the prototype, check out the GitHub repository.

Capacitive Touch Dance Floor with Teensy

That’s all for now. Until next time!


Comments 4 comments

  • I did the same thing with the QTouch library and capacitive proximity detection to create a dance floor with 64+ squares. Here’s more info, if you’re interested: https://hackaday.io/project/4209-interactive-disco-dance-floor

    I’m currently working on a rebuild with smaller squares and integrating the LEDs on the circuit board.

    QTouch is good at adapting to changing conditions and sensor areas, to provide more consistent results. When you’re running off a battery, having a ground plane around the sensor might help with sensitivity. If you’re looking to stay with teensy, there’s likely a similar library.

  • Recently did something along these lines with the Teensy. I found that instead of using the capacitive sensing directly, you can charge a pin in output mode, switch to input mode with internal pulldown, and then time the discharge.
    Works, and then gives you an analog output for your capacitive sensing! Only works on the 12 or so pins which support both modes and pulldown/pullup though of course. For automatic calibration, you just run through a number of loops on startup, record the baseline, and set that as an offset.
    It does require a larger signal to work than stock, so be prepared for that.

    Project home: https://hackaday.io/project/25561

    I’ve stepped away from that project for the time being, but the source on Github is linked from that page if you wanted to give it a shot.

Related Posts

Recent Posts

Hackbot in the Morning

Tags


All Tags