Capacitive Sensor No Longer Working (only reads -2)

Hello,

I have been working with the capacitive sensor library on teensy and arduino (Mac OSX and Windows 7) for about 6 months. Everything has been fine, however, for the past week I have been unable to get the sensor to work. To try and track down the problem I have uploaded the example sketch to my teensy 3.6 and it continues to behave inappropriately - serial prints extremely slowly (about a second for each each update) and only gives the value -2. I am using the set up exactly how it it is described in the examples using a 1MOhm resistor. I have tried this on 2 teensys that work perfectly fine when the CapSensor library is not invoked. I have also tried it on multiple versions of arduino (1.6.13 and 1.8).

I've been scouring the internet for a similar issue but haven't had any luck yet. I would greatly appreciate any help that could be offered. Thanks!

If you build the sensor with only one plate, it won't work reliably. If so, add another plate and connect it to the Arduino Gnd. Then the sensitive area is restricted to the area between both plates.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Your code would be invaluable.
You have changed code and controller, have you changed the capacitance device you have the Teensie connected to?
What is your power supply?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you post a picture of your project please?

Thanks… Tom… :slight_smile:

Picture of circuit and code attached (which is basically the included example sketch). This has worked for the past 3months but all of a sudden a few days ago it just gives me the values -2 and extremely alowly. Again, I have implemeted this on multiple teensys with the same issue. Was there a recent update that I am unaware of?

Circuit explained:

The gray wire on the same line as the two resistors (both 1 Mega Ohm) is connected to teensy pin 2.

resistor 1 is connected to a piece of foil (not pictured) via the white wire. The gray wire in that same line is connected to teensy pin 29.

Resistor 2 is connected to a piece of foil via the red wire. The orange wire on that same line is connected to teensy pin 5.

Again, I have changed nothing in this set up recently. From my understanding, this should work. Any help is greatly appreciated.

CapacitiveSensorSketch2.ino (1.71 KB)

The tutorial is wrong, at least misleading. A capacitor consists of 2 plates, what's indicated only by the ground symbol below the person. A single plate is only an antenna, catching noise out of thin air.

Hi,
OPs pic
Untitled.png

resistor 1 is connected to a piece of foil (not pictured) via the white wire. The gray wire in that same line is connected to teensy pin 29.

Resistor 2 is connected to a piece of foil via the red wire. The orange wire on that same line is connected to teensy pin 5.

Both resistors in you pic show as far as I can see are open circuit one end, not connected to white or orange wire…

PLEASE can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

A link to the tutorial will help also.

Tom… :slight_smile:

Thank you so much for your help! I resolved the issue! One of the resistors was blown * face palm*

Hi,
A 1M resistor blown?

Open circuit or what?

Tom… :slight_smile: