I am trying to interface a touch module with the ESP WiFi module on GPIO0 pin. When I turn ON ESP it needs GPIO0 to be pulled up but if I directly connect the Touch module, its output is low at start up and hence ESP goes into boot mode. To circumvent this I put a simple transistor inverter in between so that I invert the touch module output. That way GPIO0 is always high during start up. Now this solution works fine except in practical place where this needs installation. When I installed it within the housing of mains switch board, the touch module gets triggered when I switch ON other switches in the same housing. The relay turning ON or OFF also triggers the touch input. I think this is because the base of the transistor is very sensitive in this configuration and hence captures any stray signal. The whole set up works fine if the circuit is away from the mains switch board. I have even removed the connection to the touch module, it still gets triggered which indicates that it is happening because of the transistor. Can somebody suggest to me how can I modify this circuit to avoid this false triggering.