Pages: [1]   Go Down
Author Topic: Large Steel Sheet as Capacitive Sensor  (Read 860 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I am currently working on a project that involves using a large (1m x 2m x 1mm thick) sheet of steel to sense the proximity of people via capacitive sensing. The senor data will be used to control the amplitude of an oscillator in Pure Data.

I have previously used an ultrasound sensor to control PD so the software interfacing is not a problem.

I have tried this method:
Code:
// CapSense.pde
// Paul Badger 2007

// Fun with capacitive sensing and some machine code - for the Arduino (or Wiring Boards).
// Note that the machine code is based on Arduino Board and will probably require some changes for Wiring Board
// This works with a high value (1-10M) resistor between an output pin and an input pin.
// When the output pin changes it changes the state of the input pin in a time constant determined by R * C
// where R is the resistor and C is the capacitance of the pin plus any capacitance present at the sensor.
// It is possible when using this setup to see some variation in capacitance when one's hand is 3 to 4 inches from the sensors
// Try experimenting with larger sensors. Lower values of R will probably yield higher reliability.
// Use 1 M resistor (or less maybe) for absolute touch to activate.
// With a 10 M resistor the sensor will start to respond 1-2 inches away

// Setup
// Connect a 10M resistor between pins 8 and 9 on the Arduino Board
// Connect a small piece of alluminum or copper foil to a short wire and also connect it to pin 9

// When using this in an installation or device it's going to be important to use shielded cable if the wire between the sensor is
// more than a few inches long, or it runs by anything that is not supposed to be sensed.
// Calibration is also probably going to be an issue.
// Instead of "hard wiring" threshold values - store the "non touched" values in a variable on startup - and then compare.
// If your sensed object is many feet from the Arduino Board you're probably going to be better off using the Quantum cap sensors.

// Machine code and Port stuff from a forum post by ARP  http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1169088394/0#0



int  i;
unsigned int x, y;
float accum, fout, fval = .07;    // these are variables for a simple low-pass (smoothing) filter - fval of 1 = no filter - .001 = max filter

void setup() {
Serial.begin(9600);

DDRB=B101;     // DDR is the pin direction register - governs inputs and outputs- 1's are outputs
// Arduino pin 8 output, pin 9 input, pin 10 output for "guard pin"
//  preceding line is equivalent to three lines below
//  pinMode(8, OUTPUT);     // output pin
//  pinMode(9, INPUT); // input pin
//  pinMode(10, OUTPUT);    // guard pin
digitalWrite(10, LOW);  //could also be HIGH - don't use this pin for changing output though
}

void loop() {
y = 0;   // clear out variables
x = 0;

for (i=0; i < 4 ; i++ ){ // do it four times to build up an average - not really neccessary but takes out some jitter

  // LOW-to-HIGH transition
  PORTB = PORTB | 1;   // Same as line below -  shows programmer chops but doesn't really buy any more speed
  // digitalWrite(8, HIGH);
  // output pin is PortB0 (Arduino 8), sensor pin is PortB1 (Arduinio 9)

  while ((PINB & B10) != B10 ) {   // while the sense pin is not high
    //  while (digitalRead(9) != 1)     // same as above port manipulation above - only 20 times slower!
    x++;
  }
  delay(1);

  //  HIGH-to-LOW transition
  PORTB = PORTB & 0xFE;     // Same as line below - these shows programmer chops but doesn't really buy any more speed
  //digitalWrite(8, LOW);
  while((PINB & B10) != 0 ){ // while pin is not low  -- same as below only 20 times faster
    // while(digitalRead(9) != 0 ) // same as above port manipulation - only 20 times slower!
    y++;
  }

  delay(1);
}

fout =  (fval * (float)x) + ((1-fval) * accum);  // Easy smoothing filter "fval" determines amount of new data in fout
accum = fout;

Serial.print((long)x, DEC);    // raw data - Low to High
Serial.print( "   ");
Serial.print((long)y, DEC);    // raw data - High to Low
Serial.print( "   ");
Serial.println( (long)fout, DEC); // Smoothed Low to High
}


I have had some success, however no matter how large resistor I use I am only getting usable results between 0 - 30mm from the sheet. I need to sense up to about 3m. Also I have many issues with erroneous readings.

I have seen circuits using 555 timers. I believe these function more like theremins. Would this be a more reliable method ? if so can anyone recommend a simple circuit I could use please ?

Any tips or suggestions for best way forward with this project ?

Many Thanks,

Twogan
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12631
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've always thought of capacitive sensors being contact sensors or extremely short range non-contact sensors. Is sensing at the range you're proposing actually feasible using any known capacitive sensing technology?
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 618
Posts: 33952
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You are doing well with a range of 30 mm ther is no way on earth you will get 3M from a capacitive sensor.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Grumpy Mike and PeterH,

On the old forum Mowcius mentioned using the method I described and getting 1m range, that's why I tried it. He was using a small piece of Aluminium foil though not a (relatively) massive sheet of steel. here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1171076259/30

I have read about projects with a 3m range but these indeed used 555 timers and I believe some sort of theremin type sensing, but it all gets very complicated for me when theremin circuits are mentioned,  smiley-red

I assume then that this 'theremin' type of sensing is not actually 'capacitive' sensing'? 

Perhaps someone could point me in the right direction?

Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 618
Posts: 33952
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Mowcius mentioned using the method I described and getting 1m range,
It is a long thread and I couldn't see where that claim was made.

Quote
I have read about projects with a 3m range but these indeed used 555 timers and I believe some sort of theremin type sensing,
There is nothing special about a 555 is is just a configurable oscillator, however real theremins work with a radio frequency signal, much higher than can be generated by a 555. Be careful about what is claimed on some project writeups people have a tenancy to miss read things or miss interpret and effect for a reliable system.

At this sort of range I would have thought that ultrasonic was the best bet why have you rejected it?.
Ideal would be a Kinect camera, you can get some real and accurate readings with that over the range you want.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Many Thanks Grumpy Mike for the reply,

from the old post :

Quote
I have used this circuit and because I didn't have a large enough resistor, I connected up an LDR.

I then got a smoothed value of 0 and 4 when I touched it. When I covered up the LDR, producing a massive resistance it would give me values of 100-200 when I was ~1m away and then increase to just over 1000 when I walked up to it.

I do take on board your comments regarding clarity of these sensing methods/claims.

I have rejected the ultrasonics method due to purely aesthetic reasons. This project is an artwork and I like the clean nature of using the steel sheet to pick up proximity. Ultrasonic sensors tend to look like little robot eyes smiley

I have been meaning to look in to the kinect for some time, however aesthetically it would be wrong for this piece.

Is it not possible to replace the 'aerial' in a theremin with my sheet of steel ?

Thanks
Twogan
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 618
Posts: 33952
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is it not possible to replace the 'aerial' in a theremin with my sheet of steel ?
It might be but it is no means easy, you will have to electrically tune you sheet to the frequency you are using. Unless you have at least an oscilloscope and some circuit skills you can't hope to succeed. There are lots of different circuits see this link for a start.
http://www.thereminworld.com/Schematics but it is not just a matter of soldering the components together, layout is vital as is component type selection.

Yes quotes like
Quote
When I covered up the LDR, producing a massive resistance
convince me that they don't know what they are talking about. You don't get a massive resistance from a covered up LDR. And just getting a reading is not getting a repeatable usable effect. It is likely that the effect they got was not due to capacitance at all but more due to interference pickup.

Quote
however aesthetically it would be wrong for this piece.
Yes but Physics do dot always coincide with your view of aesthetics, it has one of it's own.

 
Quote
Ultrasonic sensors tend to look like little robot eyes
But if you bounce the beam off your steel plate and keep the eyes hidden?
Logged

Pages: [1]   Go Up
Jump to: