Using multiple capacitive touch sensors to control stepper motor

Hi all!

So I'm embarking on a new and (for me) rather ambitious project. The basic idea is that I am building a round table composed of multiple concentric circles, which will spin independently when triggered by capacitive touch sensors being activated.

Here is a vimeo video of the idea to help visualize it - Video of concept

The basic concept is that the table is a historical timeline that can only be aligned and 'viewed' when multiple people are seated at the table and have their hands on it.

The engineering and design side I have sorted, basically there will just be single stepper motor that drives the inner circle and forces the other circles to move with it.

My questions are really about how to combine multiple capacitive touch sensors in order to trigger the stepper motors movement, and whether anyone knew of any helpful projects that may assist me? I currently plan to either have the sensors (just foil or copper) hidden under a thing veneer with hand shaped decals, or have copper plates built into the table that you place your hands on.

The ones I have currently been looking at to try and piece together are

https://www.arduino.cc/en/Tutorial/StepperUnipolar (for controlling the stepper motor in two directions)

and then the capacitive sensing portion of this e-book that talks about controlling a servo with a capacitive touch sensor

Arduino Electronics Blueprints (go to page 173)

I figure I can couple these two pieces of code together to form the basic trigger, but I still don't understand how to combine the multiple sensor inputs so that the table only moves if all 6 capacative sensors are receiving readings.

Any hints? Much appreciated!!!!

Jack

I recommend use of the MPR121 integrated circuit on a breakout board from Hobbytronics, Adafruit, SparkFun and elsewhere. It can detect 12 electrodes and will autocalibrate each electrode or you can specify touch and release thresholds.

I expect it will work satisfactorily if you cover each electrode with veneer, especially if you are looking for hands, not just finger tips, over each electrode.. I cover electrodes with printed paper and book-covering adhesive transparent film. If a real wood veneer is too thick for reliable operation, consider using Fablon (available in wood and other effects). If you need more than 12 electrodes you could use a second breakout board and change its I²C address.

You may find the available code for the MPR121 rather challenging.

Once you have the touch sensors working, the code to check that all sensors are being touched could be a straightforward series of "if" statements within your Arduino sketch loop. Presumably you want the table to stop rotating as soon as any hand is lifted from the table.

Thanks so much for the reply Archibald. I actually purchased one of those boards just before I saw your reply, so glad I'm going in the right direction :slight_smile:

When electrodes are mentioned, are these electrodes in the standard sense of the word? Or just any capacitive material, i.e. foil, copper, etc.

You're mostly correct about the rotation, I was thinking more that as soon as it was 'triggered' it would just automatically spin enough steps to align the timeline, then stay there for a minute or so and then turn back to scramble it. This should make it more simple, I assume I can achieve this just using some delays that effectively make the sensors 'blind' until the full cycle (spin, spin back) is completed?

'if' statements is what I assumed would be the case, I guess I've just been having trouble finding any code that uses them to check if multiple sensors are active and then triggers a secondary loop if they are.

In my head the logic makes sense, it's like there are two loops - one that is checking for all sensors to be active, and a second which controls the stepper functions. If the first happens, it sends a trigger to the second, and then starts again. Just trying to figure out how to actually write the thing!!

I used the word "Electrodes" because that is what the MPR121 datasheet uses. They can be any conductive material and don't need to be good conductors. There does not need to be conductive contact between an electrode and finger or hand but I think any insulating layer needs to be well under 1mm thick if detecting a finger. I used paper and transparent film because I think people may be apprehensive about touching bare metal.

Looking at the code for my touch switches, I see that the first register byte in the MPR121 contains the status of the first 8 electrodes. So if all 8 electrodes are being touched the register will be binary 11111111 which is 255.

I am using the Wire Library and have the interrupt (IRQ) from the MPR121 connected to Arduino digital pin 4.

After the code to set up the MPR121 and the Wire Library, your code within your loop function could look roughly like this:

if( !digitalRead(4) )    // check if MPR121 interrupt IRQ signal is low
{
   Wire.requestFrom(0x5A,1);     //request one byte only
   if( Wire.read()==255)             // check if all 8 electrodes are touched
   {
      motor.step(1000);
      delay(2000);
      motor.step(-1000);
   }
}

I am assuming you will be using the Stepper Library.

You may find these links useful

Stepper Motor Basics

Simple Stepper Code

...R

This is so helpful guys, thank you so much. I will put a prototype together when the chip arrives and see how I go!

As far as conductive materials go, I am aiming to install some metal plates into the outer rim of the table which will connected underneath to the controller. As far as materials go, copper/aluminium/etc… any things to consider or watch out for?

I am leaning towards copper, as recessed copper plates into a black table would just look really beautiful. But it could be anything really

Thanks!!!

Jackambrose:
I am leaning towards copper, as recessed copper plates into a black table would just look really beautiful. But it could be anything really

Copper or brass will tarnish unless coated with lacquer. I've read that you can use the type of lacquer that is available from car accessory shops for coating metallic paint on vehicles. However, you may find it difficult to achieve a smooth finish of the lacquer even if you spray it.

I suggest using either anodised aluminium or stainless steel (but some stainless steels can be difficult to cut).

Alternatively cover any metal with self-adhesive vinyl, available in plain colour, silver, gold or even something like this.