New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sonoff basic with external switch, randomly switching on/off #850
Comments
Some (like me) might think..... floating pin? what the heck... But here comes my real point..... why can't we overwrite per software a floating pin? We just learned that the LOW state is stable, when grounded, but the HIGH state is fluctuating. Could someone kindly point me to the place in the code, where it reads out HIGH/LOW, so that I can do a hack? |
Tasmota ignores pins unless you tell it that you want it to respond to the
signal on the pin.
Once you do that, if the pin just floats you may have trouble. Tasmota sets the
internal pullup resistor, but in many cases we find that there is a need to put
in an external pullup resistor and frequently a bypass capacitor as well to make
things stable, expecially when there is a bit of distance to the switch.
|
Hi, just wanted to confirm that adding an external pullup resistor and a bypass capacitor fixed the problem. It is now switching perfectly and only by my command ;) Thanks again for the help and keep up the good work! |
Where do you put the bypass capacitor and which size? |
it's a pull up resistor, not capacitor.
the resistor goes from GPIO to 3.3v
the capacitor goes from GPIO to ground
if you reverse these, they won't do what you want.
|
Hi everyone, |
Hi again, |
sometimes you need the capacitor, sometimes you don't.
The pull-up resister is there so that when the wire is disconnected, the voltage
doesn't randomly float, instead it's pulled to 3.3v (the smaller the resistor,
the harder it's pulled, and the more power is consumed, 4.7k and 10 resistors
are common)
The capacitor to ground allows interference spikes a path to go to ground so
that they don't look like a signal. The longer the wires are to your swtich, the
more likely it is that you will need a capacitor.
a capacitor in the low pF range is usually good enough. the value really doesn't
matter much, just about any small capacitor will work.
|
Thank you very much for the response. I will play with it after the xmass and hopefully will work at last :) |
davidelang's tip helped me to get the sonoff stable again. I used a 10K Ohm resistor and a 33pF capacitor. |
@davidelang: I had 4.7 KOhm pull up resistor and 10 pF capacitor on a Sonoff Basic that was used to control ceiling light. GPIO14 and GND were connected to 3-gang wall switch circuit. Everything worked fine untill I replaced 60W indescent light with 40W LED light (220V AC to 130V DC) when Sonoff relay started toggling. I have even fried ESP module when I took Sonoff out of wall box! Don't really understand why it died as I haven't created any short? Looks like I have created some additional noise in the ciruit when I replaced ceiling light. Should I try to use bigger capacitor in the mentioned circuit? |
@wisebear21 the 3 gang switch isnt connected to a 2 way light is it as i have blown a sonoff that way, i wired the sonoff to the hallway light switch which was a 2 gang with the other switch for the landing. when flicking the landing switch it blew the sonoff. |
Specification on ESP 8266 says, that all GPIOs has pullup resistor. May be some whay to activate it in firmwary when GPIO used in switch/button mode? |
I'm sure if there was it would work as default without having to do anything or it isn't strong enough. |
@nereidum |
Hi everyone! I have recently flashed a sonoff to add a external switch and added a 10k resistor from GPIO14 to +3.3v, and a 100pF capacitor between GPIO14 and GND. the length of the wires to the switch is about 1,5 meters, and from time to time i still get the light turning on and of by itself. Can anyone help me out on what should i do more? I have read everything i could regarding this issue but haven't found a solution yet. |
you can increase ButtonDebounce from default 50ms to a higher value, but you'll have to keep pressing more the wall button |
Hi,
First of all let me say that I am a great fan of tasmota!
I connected a light and an external switch (push button) to a sonoff basic using the gpio14.
However the light randomly goes on and off when I use the 9. switch option under module.
Without the option set, there is no problem.
I already checked the troubleshooting page, mosquitto logs but cannot seem to find the issue. I am using 5 other sonoffs but the client ids are all unique: sonoff1 sonoff2 sonoffs3 sonoff4 and sonoff10. Sonoff10 is the one causing trouble. I already upgraded to version 5.7.0 firmware version.
I use switchtopic 0 and switchmode 4.
Also the console mentions these lines when it is switching on/off:
19:29:23 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
19:29:23 MQT: stat/sonoff/POWER = ON
19:30:01 MQT: stat/sonoff/RESULT = {"POWER":"OFF"}
19:30:01 MQT: stat/sonoff/POWER = OFF
Any help or pointers in a direction would be greatly appreciated!
The text was updated successfully, but these errors were encountered: