I have this relay circuit that can be turned ON/OFF by NodeMCU ESP32 GPIO18.
This circuit allows current to pass through the RL2 even when NodeMCU is turned off. When GPIO18 is HIGH, it will switch RL2 so that current won't pass.
I'm having problem with my relay because after I set it to LOW and set it to HIGH again, after a few seconds, the relay switches ON/OFF randomly and rapidly.
Question is, how can I stop relay from switching ON/OFF randomly and rapidly?
Additional Information
*I'm using 5V SPDT relay. (SRD-05VDC-SL-C)
*It's drawing out 60mA.
*I created a 5V voltage regulator circuit from my 12V 2A DC Adaptor
*D2(LED) is connected to relay's normally close pin. Also, the goal of my circuit is to automatically allow current to pass through even if NodeMCU is turned off.
Lastly, the relay acts weird when GPIO pin is set to LOW.
Thank you everyone for your help!