Arduino-dht freeze, help make/select rc snuber, mov, caps to protect from 220v

After going with 5V and few test again I didn't see anything wrong, LCD, Mega works fine

And after some logical thinking about manual switch (in the post before), I'm thinking I would need one more set of MOVs connecting N and G, but I don't know if this would cause any harm or problems considering I already have one before

I think the MOVs would work better if they were connected from each relay Normally Open (NO) and Neutral. This could be across the L1 and N terminals at each load if easier. This should clamp the peak much better like this. The ferrites work best if there are 4 to 7 turns of wire through each of them. If the interference problem persists, identify which load is causing it and make sure it also has a ferrite. If the problem still persists, could try a suitable RC snubber and ferrite.

EDIT: As mentioned by TomGeorge, it would be good to get a picture of your project.

Hi,
Ops layout;

Thanks.. Tom... :slight_smile:

I'm posting pic again, I don't know if can see it or whats wrong, but here is THE LINK too

Well that was my first thought when I opened the topic(L and N), but then I followed ur instructions for instal on L only after relay. I'm going to test that too now. And I also expect a better result too. Just made me thinking what would be better if MOV is placed closer to switch or to power consumer?

There’s 6 wires coming from the relay board to the Arduino (should only be 5)
Please remove the ground wire, leaving just +5V, IN1, IN2, IN3, and IN4.
This will enable galvanic (opto) isolation.

The opto IRLED and LED circuit works like this (no ground) …

It isn't connected

PIC1 PIC2

Ah, I see ... thanks for the pics. I think you were trying to trick me on that one ... :)

Well that was my first thought when I opened the topic(L and N), but then I followed ur instructions for instal on L only after relay. I'm going to test that too now. And I also expect a better result too. Just made me thinking what would be better if MOV is placed closer to switch or to power consumer?

Normally you see them installed across the relay contacts ... but you might need to try the other possibilities and use whatever method works best.

So far from tests, where I had most of the crashes with timers, now in 70 events, I had none :) (doesn't matter how MOV is placed) I need to revert MOV on the fan, across the relay, instead of L and N. If I switch it OFF with or without dimmer it corrupts arduino, not LCD ! Then it can be switched manually if I use it trough my dimmer, where I have pf capacitor and resistor in it. If I switch it off or on with dimmer I can get just LCD error sometimes. Which leads me to the point that RC snubber is needed for fan.

Everything else seems ok with just MOV and ferrite.

PICTURE of LCD while corrupted, arduino still working

EDITED and will do more tests later

Hi,
Can I suggest that using protoboard and jumpers (length of conductors, and connection method) may also be contributing to the resets?

Have you got bypass capacitors on the protoboard where 5V and gnd run?

Tom… :slight_smile:

Umm ... this might relate back to that same wire:

I need to revert MOV on the fan, across the relay, instead of L and N. If I switch it OFF with or without dimmer it corrupts arduino, not LCD ! Then it can be switched manually if I use it trough my dimmer, where I have pf capacitor and resistor in it. If I switch it off or on with dimmer I can get just LCD error sometimes. Which leads me to the point that RC snubber is needed for fan.

If the fan is "vent" (ventilation relay pin) in your code, then ...

It looks like the blue wire (ventilation relay pin) is connected to Mega pin 12, which is IN1 at the relay board. If the grey wire in parallel with it is connected to GND at the relay board, then this wire can cause interference issues through capacitive coupling and inductive coupling. If connected to GND at the relay board (can't tell from the picture), then try a test with it disconnected from GND at the relay board.

TomGeorge: Hi, Can I suggest that using protoboard and jumpers (length of conductors, and connection method) may also be contributing to the resets?

Have you got bypass capacitors on the protoboard where 5V and gnd run?

Tom..... :)

I have one ceramic 471 on there, if I go larger like 473 I get more LCD problems.

dlloyd: Umm ... this might relate back to that same wire: If the fan is "vent" (ventilation relay pin) in your code, then ...

It looks like the blue wire (ventilation relay pin) is connected to Mega pin 12, which is IN1 at the relay board. If the grey wire in parallel with it is connected to GND at the relay board, then this wire can cause interference issues through capacitive coupling and inductive coupling. If connected to GND at the relay board (can't tell from the picture), then try a test with it disconnected from GND at the relay board.

You are referring to white(grey) wire you marked in your post #24, which you can see in post #25, in the first pic on the relay, it is hanging in the air, not connected to anything, next pic column on the protoboard is empty and also not connected.

Thanks for pointing interference. I have removed and placed further away LCDs positive wire from the negative ones. It was short test, but I didn't saw any corruption so far.

It made me thinking that it may be something with my PSU, as it is an old one and it maybe doesn't have good protection or it is just low quality. Since it is in the same plug as the fan, for example, switching fan ON/OFF may interfere with PSU and its constant and power delivery? This leads me to open it again and check if there is a MOV or capacitor in it, as I can't remember if I saw one.

What would you recommend to use/build for common positives and grounds instead of protoboard? Simple empty board, that I should just solder pins with one ground line and one positive?

UPDATE: I tried different plug for PSU from a different line and its all the same. . .

You are referring to white(grey) wire you marked in your post #24, which you can see in post #25, in the first pic on the relay, it is hanging in the air, not connected to anything, next pic column on the protoboard is empty and also not connected.

Yes, not connected to anything at both ends is OK.

It made me thinking that it may be something with my PSU, as it is an old one and it maybe doesn't have good protection or it is just low quality. Since it is in the same plug as the fan, for example, switching fan ON/OFF may interfere with PSU and its constant and power delivery?

Yes, good quality power supplies and using decoupling/filtering capacitors (see reply #28) are excellent suggestions. Note that its really important that the relay board have its own, completely independent power supply.

What would you recommend to use/build for common positives and grounds instead of protoboard? Simple empty board, that I should just solder pins with one ground line and one positive?

My only recommendation would be to use a PCB that has solder mask (green coating) over everything except the copper hole pads. There are PCBs available that mimic a bread board layout.

It seems like you may have everything working. If not, my only other suggestion would be to try moving the relay board and AC wiring at least 1 meter (3ft) away from the Arduino.

Yes, everything works, I'm just a bit insecure about stability. Thank you for your help and time, I owe you a beer or a coffee at least :)

One more thing, why does a higher rated capacitor disturbs my LCD more (471 vs 473)?

Can you show me an example of how would you setup decoupling for my situation? And/or what ratings should I go for. I just have my 471 in between "+" and "-". Do I need a resistor?

Now I just need to find small PSU rated 5V 1A. . . or power adapter could work as well, something from 7V to 9V? (again I'm thinking of the quality of those...) Also, separate power for relays adds more complication which I'm not so much happy about as I need two sources to actually power one working thing. . . which wasn't my plan at the start of this project...

This made me thinking I shouldn't have gone at all with arduino and I should just have bought a finished product, as it seems in the end this will cost me more than something plug and play. . . And I lost about a month just to make it work. I say this because it doesn't give me confidence with stability and reliability, I'm afraid one day I might come to find my garden is flooded and some device is fried. . . but we'll see.

I'll keep this updated as I upgrade/downgrade :D down the path and let you know what I came up with. ;)

At least I learned something new from this experience, which isn't that bad at all :) every school has its price ;) is what we say over here :)

sone0121: I have one ceramic 471 on there, if I go larger like 473 I get more LCD problems.

Across the 5V to gnd, the LCD has problems? It sounds like you have some power supply wiring and connection issues, have you checked ALL your jumper connections to and from the protoboard? Tom.... :)

It actually runs better without one at all lol

Maybe I'm doing something wrong, I'm supplying arduino with 5V, then from arduino to protoboard. Or it should be the other way around?

Hi, To what pins are you supplying 5V? What is the supply? Do you have a DMM to monitor the 5V supply when the fault occurs?

Thanks.. Tom.... :)

I was supplying to power pins, two that are next to each other, 5V and gnd. I changed now supply to the protoboard and this is how I'm powering arduino now |375x500

It is a PC power supply, I think it's switching one, it says on the sticker it has 30A @5V and 20A @12V, but I doubt it

Yes, I monitor it, it shows 5.25V with 471 and it varies from 5.24V to 5.26V, low % of faults If I go larger like 473 I get jumps from 5.25V to 5.28V, I get high % of faults.

I think I solved it, I removed MOV from humidifier terminal and replaced fans MOV from L&N to after switch L&L :) I didn't see single LCD error in a couple of hours, at least for now :D

Also added one more ground wire from PSUs molex connector and all I see now is stable 5.26V (it may drop to 5.25V if two or more relays are open at the same time)

Just to report back, everything works fine with switching circuits, except I found a new problem.

If I plug a new device, for example, a simple table fan, again I get a voltage spike that backfires at relays. I noticed when switching added device, relays LEDs would slightly blink, barely noticeable in dark, but still noticeable. This would cause Mega to crash once in like 10 on/off switches.

Is it safe to add on more MOV, to protect relay circuit, in a red circle where power comes from the wall in my circuit which looks like this now?


Or I need to change rest of MOVs to L&L after switch, and connect just that one to L&N ?

Also, I’m still thinking to add RC to aid MOVs, like 1k ohm Resistor(or 10k) and 275VAC 220nF Capacitor, would this be sufficient or I need higher values?

Is it safe to add on more MOV, to protect relay circuit, in a red circle where power comes from the wall in my circuit which looks like this now?

Yes (they do this in surge protection devices)

Also, I'm still thinking to add RC to aid MOVs, like 1k ohm Resistor(or 10k) and 275VAC 220nF Capacitor, would this be sufficient or I need higher values?

For these RC snubber modules rated for 220VAC, they use a 0.1uF/630V capacitor and a 220 ohm 3 or 5W high voltage resistor. They also include an MOV.