Electronic – Nodemcu responds badly to power swing

#nodemcusolid-state-relay

wifi switch schematic
I'm using NODEMCU and SSR modules to turn on / off the lamps with WiFi. Nodemcu uses I = 80mA and V = 5v as its input current and voltage (Vin pin). It worked without any problems with a single lamp on my desk. When I implemented the whole device behind a light switch and connected the ac wires to the SSR module, there were some problems. The WiFi switch works fine alone and also, I can control it via WiFi. But when I hit another switch next to it which is not WiFi enabled, it affects the WiFi switch.

For example, when I want to turn on a lamp and hit its switch (which is not WiFi enabled), the lamp turns on and subsequently, the lamp which has a WiFi enabled switch turns off and on randomly. I think because nodemcu needs 80mA current, it's sensitive to power swing. and I can't use sleep mode because if I use it, WiFi will be disabled and as I want my device to be in station mode, it would cause problems.

I tried different capacitors for Vin pin from 0.1 uF to 470 uF !! but none of them helped and still, when I turn on some other lamp, it has a bad effect on my device.

What is the problem and how can I solve it?

Best Answer

Put a 100 ohm resistor across the SSR input (3/4). They are quite sensitive and can trigger from even a small amount of coupled energy. The 100 ohms will shunt that away.