Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: Capacitive sensor: sensitivity problem on: October 06, 2012, 08:53:50 am
I am developing a capacitive sensor with my Arduino UNO,
but I am having a problem with low sensitivity.
So you know that the technique you are trying to use is not reliable and repeatable and is not used in any commercial system. It is in the tutorial as a novelty, many people have made the mistake of trying to develop it but unfortunately it is not a good technique to use.
You are free to try however, but this is the sort of problem you run into.

Hi Mike,
yes, I have read multiple posts that made me question the reliability of this technique.

However, I wanted to try this one because it was more suitable for a project I am doing. I am well aware of other easier techniques (for example ir proximity sensors, especially the Sharp GP2Y0A02YK0F model), but I wanted a technique that involved the human body.

Do you have any suggestions to improve my project? What other techniques would you advise? smiley

I have stumbled upon your nickname many times during my research, so it's kind of an honour smiley-razz
2  Using Arduino / Sensors / Re: Capacitive sensor: sensitivity problem on: October 06, 2012, 07:55:40 am
did u try this: ?

could it b that u pick up a lot of 50Hz noise?

did u try to make a shielding below and around the sensor plate?
some grounded metal foil should suffice...

Hi there Riddick, thank you for your reply smiley and sorry if I write dumb stuff!
No, actually I haven't tried a capacitance multiplier, but noise is not my main problem, I think: I'm fine with the stability of my sensor, I just want to increase the sensitivity, and capacitors tend to lower it.

What do you mean by "grounded"? Do I have to connect it to the GND pin or earth it, as in the water pipe example?
Anyway I tried both: when connecting to the GND pin the tin foil underneath the sensor, the sensor reads -2 because the reading of the sensor times out when the sensor is grounded (it's in the capsense guide).

When connecting instead the foil to the water pipe, the sensor stops reacting to my hand even when touched and gives numbers ranging from 2000 to 6000.
3  Using Arduino / Sensors / Capacitive sensor: sensitivity problem on: October 06, 2012, 06:42:23 am
Hi everyone!
I am developing a capacitive sensor with my Arduino UNO,
but I am having a problem with low sensitivity.

I am already using an 80Mohm resistor (8*10Mohm resistors in series) but the sensor reacts to my hand only at 3,5 inches away, when my goal is at least 20. As far as I can read from the Capsense tutorial and the Bareconductive example stemming from it, a resistor of 40Mohm should sense my hand at least 12 inches away.

What am I doing wrong?
This is my hardware setup:
Pin 2 si connected to Pin 4: between them there is my capacitive sensor and the 80Mohm resistor.
Whenever my hand is in the sensing range, a led fades up. When my hand is away from the sensor, the led fades down and is off. (I avoided mapping the actual readings of the sensor to the led output due to slow performance).

The arduino is powered through an usb port of a laptop plugged into the wall socket (no battery). The sensor is made from an A4 sheet of paper covered with graphite paint (I tried with tin foil and the results are similar). I have tried earthing the Arduino connecting the GND pin to a non-painted water pipe as suggested in the guide, but the sensor doesn't improve its sensitivity. Doing the same to with the sensor doesn't help.

I also tried powering the Arduino with a 9volt battery: the sensor seems to lose its sensitivity, while the metallic part of the Arduino get sensitive. I tried connecting the GND pin to the negative pole of the battery, but to no results.

This is my code:
#include <CapacitiveSensor.h>

CapacitiveSensor   cs_4_2 = CapacitiveSensor(4,2);        //80M resistor between pins 4 & 2, pin 2 is sensor pin

  int outputvalue = 0; //this variable controls the power level of the led from 0 to 255

void setup()                    
   Serial.begin(9600); //starting communications

void loop()                    

  long total1 =  cs_4_2.capacitiveSensor(30); //total1 is the value of the capacitive sensor

  if (total1 > 4000){
      outputvalue +=5;

//if the sensor senses my hand, raise the power level of the led, making it fade up.
//4000 is an arbitrary value I chose it because it is indicates a value where my hand is surely there. Without, the any contact, the sensor would fluctuates from 0 to 1000

   else { //if the sensor doesn't sense my hand, lower the power level of the led, making it fade down
      outputvalue -=5;

   if (outputvalue > 255) { //max value of the output is 255
     outputvalue = 255;

   if (outputvalue < 0) {//min value of the output is 0
     outputvalue = 0;

  analogWrite (9, outputvalue); //light up the led connected to pin 9 accordingly to the previous script

Serial.print("sensor = " );   //print the values from the sensor and the output
Serial.print("\t output = ");      
Serial.print("\t output = ");  

I experimented with 100pF capacitors as suggested in the guide to stabilize my readings but they lower the sensitivity, so I abandoned them.

I appreciate every suggestion: I would really like to make this work from 20-30 inches away and make this battery powered since I would like to hang the results to a wall photo in a lightbox way:)
Pages: [1]