Page 1 of 1

Sonoff GPIO 14 keeps on switching, longer cable in wall to switch

Posted: 03 Nov 2017, 15:23
by Nephylim
Hi there, I have a small Problem with the Control of my Sonoff. There are two external pushbutton switches connected to GPIO14.
The one closer to the sonoff is working without a problem. The Second one is about 4m away and uses existing wires through the wall. As sonn as I connect this switch the sonoff keeps switching on and off.
I guess this is due to some interference from power cables running in the same wall. Is there an easy way to fix this?

Re: Sonoff GPIO 14 keeps on switching, longer cable in wall to switch

Posted: 03 Nov 2017, 17:08
by Shardan
Hello,

did you use a separate pull-up or pull-down resistor?
If not i'd try a resistor of 1 ... 2.2 KOhm.

If your button is connecting GPIO --> Gnd, place the resistor from 3.3V to GPIO.
If your button is connection GPIO --> 3.3V, place the resistor from GPIO to GND.

If that does not help, add a small capacitor of 100 ... 220 nF from GPIO to GND.

Anyways, 3.3V is very low compared to the voltage of the other wires so influences are likely.

Regards
Shardan

Re: Sonoff GPIO 14 keeps on switching, longer cable in wall to switch

Posted: 04 Nov 2017, 11:14
by TD-er
First try the suggestions already mentioned by Shardan.
And then try to twist the wires to the sensor.
Just like the cables in an UTP network cable.
The twists prevent the cable from acting like an antenna and picking up all kinds of interference.

Re: Sonoff GPIO 14 keeps on switching, longer cable in wall to switch

Posted: 09 Nov 2017, 22:03
by Nephylim
Thanks for the Help Mates,
the capacitor solved the problem instantly.