I'm after a Capacitive touch circuit to make a piece of metal into a touch sensor.
I've found the following... http://playground.arduino.cc/Main/CapacitiveSensor
Which is fine but I need a circuit that doesn't require grounding as its going to be on a portable battery powered torch.
Is there a Capacitive touch circuit out there that doesn't need a connection to ground?
Hi,
There has to be a difference of capacitance between two conductors. If the torch is held in one hand, the other hand should be able to activate the capacitance sensor. Easier if the torch is metal but probably workable if there is metal inside a plastic torch.. like the batteries..
Oddwired:
Is there a Capacitive touch circuit out there that doesn't need a connection to ground?
That one does not need grounding as far as my implementation can tell. I've got it on a box which is powered by a wall wart but there's no connection between that and ground anyway. See my YouTube video #46 for more details!
I've tried it using the standard resistor circuit from the capacitive sensor page and it definitely requires the either the use of a grounded connection via usb or I have to be touching the ground with my other hand.
include "Arduino.h"
#include <CapacitiveSensor.h>
unsigned long millisCount = millis();
int led = 13;
CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2);
void setup()
{
pinMode(led, OUTPUT);
cs_4_2.set_CS_AutocaL_Millis(10000);
}
void loop()
{
long signals = cs_4_2.capacitiveSensor(70);
if(signals >= 5){ digitalWrite(led, HIGH); } else{ digitalWrite(led, LOW); }
}
Regarding the touch lamps aren't they normally powered by the mains and therefore usually grounded as well?
I've ordered an mpr121 breakout board to try but that will take a few days to arrive so hopefully that will help.
There has to be a difference of capacitance between two conductors. If the torch is held in one hand, the other hand should be able to activate the capacitance sensor. Easier if the torch is metal but probably workable if there is metal inside a plastic torch.. like the batteries..
The torch is going to be a hanging one so I want it to be operable with just one hand, i noticed ralphs setup seems to have an extra capacitor between one of the pins and ground, would this be providing the difference of capacitance required in a battery powered version?
AFAIK there are at least three types of touch sensor.
Resistive: Two electrodes very close to each other, so a finger can "short" them.
Many TVs in the seventies had them.
Mains hum: Mains hum from e.g a finger is amplified and detected.
An example is a touch lamp.
A 1Meg resistor from an analogue pin to ground, and a 1-10Meg resistor to a piece of touch metal is all you need. Code can detect mains hum and act upon it.
Capacitive: finger/body changes the frequency of an oscillator or the decay of a pulse.
These sensors can work through an isolator. 5mm thick glass is not a problem.
A large piece of grounded (to the circuit) metal around/close to the sensor could be needed.
Leo..