Electronic – arduino – Why relay module occasionally switches by itself ON

arduinoesp8266inductionrelay

I am using this common relay module from Ebay (image below). It works very well 99.9% of time. It's controlled by ESP8266. It's in the plastic box with some AC wires (which are obviously plugged in these relays).

What happens is, that sometimes (approximately once in a few days) it switches itself on for a very short time. I know this, because when my garage doors opened few times in night, I stopped trusting this module and I have unplugged garage doors from it. Instead, I have plugged ESP8266 +5V and input in it, so I could see if relay really switched itself and by itself. Because I have also completely commented out code, which controlled this relay in ESP8266.

So now I know for certain, that the problem is inside this relay module. Because relay module is using optocoupler which is switched by connecting data pin to GND, I think it shouldn't be electricity induction problem from AC wires around.

So the last thing which comes to my mind, is that the electricity is inducted directly in relays coil, if this is even possible ? Or I have no idea 🙂

Can someone shed some light on this and try to come up with reason why this is happening and mainly how to solve this problem ?

The only thing which I have ready to do right now is to use 2 relays in series and hope, that this "glitch" doesn't happen in both of them in the same time. It's more probable that I win lottery than this happening, however, I wouldn't feel very happy about this obscure solution.

Thanks everyone for your time reading my question.

enter image description here

Best Answer

I don't have the values but the module schematic shows transistor base left floating while inactive which makes them sensitive to EM noises. Depending on the values a resistor between base and emitter or from optocoupler emitter to ground can help alot. This is the module schematic I found