I have three TTP223 touch sensors connected to a power source (only VCC and GND are connected).
I intentionally didn't connect I/O pin to Arduino because I suspected that it could cause the problem (trigger the sensor by accidentally sending current to the I/O pin). One of the sensors gets triggered and starts blinking, please see the video:
I fail to reproduce this bug consistently and don't know what causes it. I've noticed the following:
It happens only on the 1st and/or the 2nd sensor only if they are both connected (but after switching sensors and then assembling this same setup - sometimes this bug disappeared).
Thought they were too close together and were triggering each other but I tried putting other sensors even closer and it didn't happen.
I would be very grateful for any ideas on why this is happening, thanks in advance!
I think OP means that the sensor itself triggers without touching it (it has an indicator LED).
I would start with soldering the pinheaders to the board.
How are you supplying these sensors.
Maybe the supply wires are picking up hash (touch sersors are very sensitive).
Add an electrolytic decoupling cap across the supply, close to the sensor.
Leo..
These sensors can be jumpered to be active HIGH or active LOW, also either momentary or toggle.
They come in all configurations ready to buy, pre-jumpered, so it's up to the owner to rub a few brain cells together to know which they have.
Make sure the code matches what the modules are set to.
Wawa:
Yes, I know. But random firing indicates supply problems (or strong interference nearby).
Leo..
Thank you for your suggestion! My issue is also the fact that I cannot reproduce the bug consistently. Even by simply switching sensors the bug may disappear. Even though the distance between them is the same and the wires are the same. If I find a capacitor and add it to the circuit - I can't be sure if it helps, because the bug disappears randomly.
I'm supplying them from a 3.3V Arduino power supply (In datasheet it says 2-5.5 are ok). Is it possible to test if the power supply is stable using a multimeter?
Thanks!
Capacitive buttons on the Arduino are sensitive to grounding setup. Values will vary whether you're running on batteries, laptop plugged into the wall, laptop not plugged into the wall, phone charger, whatever.
But fluctuating source voltage is not your culprit.
How do the buttons behave when they are working properly? Do you need absolute touch or do they activate from some distance?
INTP:
Capacitive buttons on the Arduino are sensitive to grounding setup. Values will vary whether you're running on batteries, laptop plugged into the wall, laptop not plugged into the wall, phone charger, whatever.
But fluctuating source voltage is not your culprit.
How do the buttons behave when they are working properly? Do you need absolute touch or do they activate from some distance?
They activate from a distance (around 1 cm above the sensor I think). But I don't think any obvious nearby objects could trigger them (like the wires for example).
I think the proximity of the sensors may be the issue here. Been testing this a little bit more and if I put the sensor about 1-2 cm farther the triggering doesn't start.
However if I put them close to each other (about 2 mm) it MAY start triggering itself. And if it happens - always on the same sensors. Could this be the problem?
How is it possible to fix it without changing the distance? Maybe I can isolate the sensors from each other somehow?
(I tried sending logic LOW to the sensor's output pin and this made it unresponsive, meaning real touch wouldn't trigger it, but the sensor nearby was still getting triggered. It would stop if I completely turn off the first sensor)
Some capacitive sensors "learn" when power is connected, so they are most sensitive without false triggering.
Don't know if these sensors do that.
Capacitive sensors have a constant signal on them. Touching them changes that signal, and that is detected.
So yes, the signals from neighbouring sensors could interfear with each other.
These sensors have pads to add an smd cap (0-50pF) to make them less sensitive (useless information if you can't work with smd).
Leo..
Wawa:
Some capacitive sensors "learn" when power is connected, so they are most sensitive without false triggering.
Don't know if these sensors do that.
Capacitive sensors have a constant signal on them. Touching them changes that signal, and that is detected.
So yes, the signals from neighbouring sensors could interfear with each other.
These sensors have pads to add an smd cap (0-50pF) to make them less sensitive (useless information if you can't work with smd).
Leo..
Thank you, I guess it's worth trying some smd capacitors. I will try testing it.
I suppose it should be soldered to those empty pads in the bottom right corner?
Don't know which pad, or if there is already a cap on there, but the cap that decreases sensitivity goes from touch field to ground (C1 in this diagram).