-->
Page 1 of 1

Smart wall light switch woes

PostPosted: Sat Jun 04, 2016 3:08 pm
by LubosD
Hi,

I have an ongoing project where I'm gradually enhancing all light switches in the house. It works as follows:

    Lights are triggered via an output pin connected to an optotriac+triac.
    Light switches are connected to input pins (INPUT_PULLUP) + ground.
    MCU takes care of monitoring input pin state and toggling the respective light on any change.
    Changes are reported to the server over Wi-Fi. The server can also remotely trigger any light.

So far I have automated two locations like this. The first one is a combination of ESP-01 and ATTiny84. The second location uses just an ESP-12F.

It is the second location where I'm facing a strange issue. After a week, one of the switches stopped working. I found out that the respective input pin (GPIO13) is only being pulled up to 0.9V (instead of 3.3V). If I attach an external pull resistor, the pin is still pulled rather low (only to about 2.2V), so it seems that the pin got damaged and something inside ESP8266 is pulling the pin low at the same time.

How the heck does one damage a pin configured as INPUT_PULLUP?

Now writing this, I realized that there was a strange effect. The wires connected to the damaged pin are rather long (at least 5m), possibly running adjacent to wires connected to mains voltage inside the walls. Sometimes, when I would turn a light in the room next door, the light controlled by this problematic pin would be turned on shortly.

Is it possible that some inducted power damaged this input pin? How can I prevent this?