I have this circuit which must signal +3.3V or 0V depending on the switch status. The the switch is about 20 meters away and is getting EMI from mains.
I realized that it only takes -0.7V of interference on Vb to make the transistor saturate causing a false switch pressing event on my ESP.
How can I increase this gap in say 2 or 3 volts so it becomes less sensitive to EMI?
I thought of series diodes on base like this (which is cheaper than shielding the cables) but is it correct?