Touche for Arduino: Advanced Touch Sensing.

149,663

379

143

About: IMPORTANT: Please do not message me personally with technical questions. Use the comments in the respective Instructables. I really love sharing and helping people makes much more sense in a shared space whe...

Intro: Touche for Arduino: Advanced Touch Sensing.

Update: New interface - look at the last step.

Credits: Arduino sensing done by DZL, Processing sketch and Instructable done by Mads Hobye

Disney Research lab designed a novel way to detect touch. You can see a video of their demo here:


I had the honor to meet them at CHI2012 in Texas and I discussed with them whether it would be possible to convert their system into the Arduino platform. Their immediate reaction was that the Arduino would not be able to generate good enough frequencies. I asked my friend DZL if he could solve this problem and this was his solution to the problem:

The Touché hardware uses a really fancy Direct Digital Synthesizer IC from Analog Devices. It generates a really pure sine wave signal with frequencies between 1kHz and 3.5MHz with high resolution. While the Arduino is capable of generating frequencies in this range the signal is a square wave with lots of harmonic frequency components and really low frequency resolution.
Simply using this signal with the circuit described in the Touché paper result in a really messy frequency graph due to the harmonics from the square wave. The solution is to use the filtering properties of the LC circuit to our advantage. By measuring the signal after the inductor (coil) rather than before we only see a nice sine wave shaped signal free of all the unwanted frequency components. As a result we now see a peak in signal at resonance rather than a notch but the signal contains the same information.


This has resulted in the following sensing capabilities:


At the conference they told me that they used 200 steps and they were able to get up to 2000. We have 150 in the above video. 

Step 1: Components Neded

To make the shield for Arduino you will need the following components:
  • Arduino
  • Usb cable
  • Shield
  • pin headers
  • Resister: 10k, 1MOmh, 3,3k
  • Capacitor: 100pf, 10nf
  • Diode: 1N4148 diode
  • Coil / inductor: 10mH (cypax.dk  part no: 07.055.0510)
  • Water bottle as sensing object.

If you do not have the inductor, it is basically a coil. You should be able to roll your own. Grab an empty roll of toilet paper wind very thin wire around a couple of hundred times. You have to experiment until you get a peak on the graph.

Or be scientific:
http://www.pronine.ca/coilcal.htm
You want 10000µH

Step 2: Build the Hardware

The shield should be build according to the diagram included here. I have included a picture of the finished shield so you can look at the actual prototype.

Step 3: Upload Code to the Arduino Board

There are lots of tutorials who have already explained how to program an Arduino and they do a much better job than we could. So we will just give you a couple of links:
  • http://arduino.cc/en/Guide/HomePage
  • http://www.youtube.com/watch?v=4HqXAmV_Ock
  • http://www.ladyada.net/learn/arduino/lesson1.html

The 3 things that usually cause trouble:
  • On windows you have to install the proper drivers (sometimes also on mac).
  • Remember to select the right serial port in the gui.
  • Remember to select the right board in the gui.

Below are the simplified steps to uploading the code to your Arduino board:

Step 4: Run the Processing Sketch

You will need processing to visualize the graph. Here are the general steps to get it up and running:
  • Download and install Processing (http://www.processing.org)
  • Get the sketch from github (https://github.com/Illutron/AdvancedTouchSensing - same link as the Arduino sketch)
  • Open the sketch in processing and run it. You will need to choose the right serial port in setup method. It is usually the lowest number.
  • At pointed out in the comments. Arduino uno has problems with high speed serial and you need to reset the board (or unplug) it every time you run the processing sketch. If you get an error please unplug and plug it in again for it to work. 

The graphing sketch is a modified version of Bool Scotts graphing example:

http://boolscott.wordpress.com/2010/10/23/sneak-preview-of-my-open-source-project/

Congratulations - you are ready to go!

Step 5: Update: Alternative Visualizer

Some of you have problem with the processing sketch. This is due to a crappy graphing interface written in processing. I have made an alternative version. It is based on my new Guino interface - which has much faster graphing. You have to do the following steps:

Download the arduino code here:
https://www.dropbox.com/sh/jxkno1vgka7yisf/MZe8m3G4br

Follow the instructions here to upload it and run the guino interface:
https://www.instructables.com/id/Guino-Dashboard-for-your-Arduino/

Hope it helps.

4 People Made This Project!

Recommendations

  • Electronics Tips & Tricks Challenge

    Electronics Tips & Tricks Challenge
  • Audio Contest 2018

    Audio Contest 2018
  • Plastics Contest

    Plastics Contest

143 Discussions

0
None
KelleyS14

6 months ago

Does this still work in 2018 or has it gone out of date?

1 reply
0
None
fvon oertzen

4 years ago on Introduction

Thanks a lot for this instruction Mads!

Somehow I can't see any graph in processing. The original sketch just opens a blank window. Also tried your GUINO approach. The application only shows the setup bar on the left side nothing else.
I tried older versions of Processing still it didn't work.

I'm using an Arduino Duemilanove (ATmega128). Might that be the cause?

Any help would be highly appreciated. I really wanna get this running!

5 replies
0
None
madshobyefvon oertzen

Reply 4 years ago on Introduction

It should work. Sound like something is wrong with the serial communication. Wrong port comes to mind. I am not sure.

0
None
HendryH3madshobye

Reply 8 months ago

well this graph only show flat and nothing change when i touch the glass of water

0
None
SergioR31HendryH3

Reply 7 months ago

1.hello friend I had the same problem and it turned out to be the coil check it, or it happened to me that the diode was in reverse, look very well in the order of the components

0
None
MaisaM1

9 months ago

Going to take this as my project. Hope so i get success.

0
None
bombam9988

1 year ago

Hi

Can I use another inductor value than 10mH because I can't find it locally. I learn that wiring is series resonance circuit but how I would change other component's value to match with new inductor value?

Thanks

0
None
honsey

1 year ago

This is so cool — Thanks for sharing this!

Stumbled upon this because I right now fail in a – what seems to be – simple task: Battery powered electronics; mounted within a metal knob; want to find out if that metal knob is touched and light up an LED.

Tried dedicated AT42QT1010 touch IC. Tried CapSense library (using a ATSAMD21) but with no success. It works when connected to my computer, stops working when running of battery.

Guess the "amount" of ground is just to little, compared to that large metal electrode :(

Did someone try to run this project of batteries?

Thanks in advance,

Hans

0
None
chris134

1 year ago

Could someone please try to troubleshoot with me? I'm somewhat of a beginner.

I'm trying to take the barebones of this code and strip away all UI and graph elements. I am attempting to implement just the actual touchsensing into an already existing sketch where I have Firmata uploaded to the Arduino and am interpreting Knock data in Processing. Any help would be very much appreciated!

0
None
Wendy KatherineG

1 year ago

Hi, I tried to do the same project but, I do not know why at the time of complicating, in the graph does not show any signal, I do not know if you can help me with this problem, thank you very much.

0
None
hygy

1 year ago

Anybody tried to use it as a notebook touch screen device? (With absolute positioning?)

1 reply
0
None
prabu_venkathygy

Reply 1 year ago

I am interested in this too.. any suggestions/pointers ?

0
None
dSteinel

3 years ago

Thanks a lot for this very nice instructable!

The sensor works quite well. But there is an issue which I can't solve so far. I connected the outcomming values to an led so that it goes on when I touch the sensor. It works really good when the arduino is connected via USB. But with an external power supply the led flickers (although the values should be exaclty the same). Can anybody help me so that I dont have to stay connected with the usb port?

3 replies
0
None
RicardoB108dSteinel

Reply 1 year ago

Hello, I was wondering how you managed to make this LED be controlled by the Touché sensor. I can't seem to get it right. I hope you see this message! Any response would be highly appreciated. Thanks in advance!

0
None
dSteinelRicardoB108

Reply 1 year ago

Hello,
I connected the LED to the arduino. So it was not physically attached to the same circuit. In the arduino code, I switched the LED on when the sensor reading was higher than a specific value.

I can look if I am able to find the code on my computer and send it to you if you are interested (I didn't use the processing part / no graph)

0
None
araiza444dSteinel

Reply 3 years ago on Introduction

Hi, I am not an expert with Arduino Micro Controllers, but to me is sounds like your power supply is either underpowered or failing. Check your input voltage and current with a meter or scope and if they are correct, then I would try adding an electrolytic capacitor (about 470uf) between your power supply and micro controller to condition your incoming power.

0
None
WillP22

2 years ago

Brilliant tutorial! Managed to setup a liquid musical interface over summer that turned out really well. I'm now wondering how I'd go about sensing multiple object on one Arduino board? Is it possible to chain the circuit to take many inputs. Thanks