Hello. I'm using ESP8266 (nodemcu V1.0) and I made relay circuit as below picture. I connected 220V AC powered devices for test, and It works fine at first but then it doesn't work properly.
First, I think relay was broken (I'm using TIANBO TRA2 5V) but It works again next day. And it didn't work as time goes by.
I tried to change diode from 1n4001 to 1n4007 but it works same. I think electromagnetic compatibility problem might be happened (because it woks fine without any load but only happened with load and took a time)
and but I don't know what should I do.
Could you help me ?