Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By rudy
#75787 I looked at the board and there wasn't enough for me to see as far as problems. I was concerned about the AC connection on one side of the board and the relays on the other. If the power for the loads is coming from the AC terminal for the board then you might be getting coupling that way.

When trying to minimise interference one thing to do is to minimise the loop path. What I mean by this is that you want to make the path to the load and returned from the load as tight as possible.

I didn't find any good images to show this so I will try and explain with the following one.

Image

The magnetic field is related to loop area. Large loop area = large magnetic fields. The circular part will generate a larger magnetic field compared to the two parallel lines before the circular loop. What you want to do is to think about your wiring, the path the current will take, from the panel, to the switch, to the load, back to the panel. What you want is the path to the load and the path back from the load, to be as close to each other as possible.

Then there is the issue of relay arcing. Switches don't open and close instantly. Electricity will bridge the gap when close, before it is closed, and more so when opening the circuit. It sometimes helps to put a small snubber across the relay contacts.

Initially look at how you have everything wired. See if you can make some improvements that way.
User avatar
By Antori91
#75800 Hello Rudy,

I forgot to mention I've set up a "test platform" with the same ESP8266 board, two switches (to simulate the two latching relays with their pushbuttons) and two incandescent lights connected to the relays. The data cables length between the switches and the GPIO is 15 cm and the "power" cables length between the relays and the two lights is 30 cm. ** Even on this test platform with very short cables, I can notice the issue ** .

It is only for now on this test platform, I've tried to add in my code the delay(2000) just after the digitalWrite() which activate the relays. Since then, I didn't observe again the issue on this test platform. But since the issue doesn't happen every time, maybe it is just good luck (or bad luck because I can start to think the problem is solved).

As you, my first idea about this issue was its root cause is about wiring, power drop, inrush current, electric noise, ...something related to the electrical environment. In your scenario (magnetic fields and/or arcing), do you have an idea why the hardware watchdog bite? What can happen regarding hardware watchdog in such situation? Why (even I 'm not so sure), the delay(2000) seems to solve/improve the issue.

Last, about my house wiring, the two lighting areas are located at two different floors with the physical pushbuttons and the lights position decided when my house was built. I can change nothing. The latching relays are at the main panel. I installed the ESP8266 board near them, so in a rather noisy environment... and the wiring length between the relays and the lights is more than 20 meters for one of the two areas. But I noticed that the nearest lighting area to the main panel is the one where the issue mainly happens. I thought that the distant one with its more lengthy wiring can limit much more the inrush current.
User avatar
By rudy
#75805
In your scenario (magnetic fields and/or arcing), do you have an idea why the hardware watchdog bite? What can happen regarding hardware watchdog in such situation? Why (even I 'm not so sure), the delay(2000) seems to solve/improve the issue.


Even though we are dealing with digital devices there really is a lot of threshold issues that are beneath the surface. Minor changes can make or break a marginal situation. With a situation like you have it is difficult to determine the exact cause. And that is worrying. Sometimes it take an incredible amount of effort to get at the root cause. If we can find a bandaid for the problem it sometimes is good enough.