I am using dual channel Optoisolator relay with my ESP8266 12-E module programmed through Arduino IDE to control 25watt AC 240 energy saver bulb. Relay is isolated according to following;
Every thing is working very smooth since months. But I want to add a push button and interrupt in my setup. But it is facing Electromagentic interference problem, especially when turning off Higher AC load such as pump which are not connected to my system. I think EMI is coming through power line, I am using 2 ampere 5v Power supply and 100 uf 16v electrolyte capacitor after power supply and couple of two parallel 100nf capacitor before and after 3.3 v regulator (AMS1117 3v). I have also tried 470uF capacitor after power supply in place of 100uF, Also tried with out capacitor. All have the same results.
i.e. If bulb is turned ON or OFF, I switch on motor pump (2hp), nothing happens, but when I switch off motor pump, light turns OFF if ON or turns ON if OFF.
Circuit picture is attached.
I also tried reed switch in place of push button and found that, if both component of reed switch are close, there is no false interrupt due to motor pump, but if i put the reed component apart (in open position), same problem arises as in case of push button. I have attached pull up resistor of 10k ohm in both situation (for reed and push button).
May someone please help me to cope with EMI?