Arduino hangs due to EMI

I made a project which sounds a 220v bell 4 times a day (5 seconds each time). It uses an Arduino nano, RTC, OLED display and a relay module. Sometimes the relay connection ends with the system hanged. Brainstorming it a little bit I’m mostly sure it’s EMI disturbing the i2c communication or something like that. What protection or which solution do you recommend. I guess putting a capacitor in the output of the relay won’t be the solution.

Thanks

Please post a complete wiring diagram.

Please post an image of your project.

I’m sorry I don’t know how to do it. Anyway it’s very simple I connected DC in to Vin and ground, also DC in jack supplies the relay module. Vout 5V and ground from Arduino to the RTC and the display. A04 and A05 supply clock and data to both modules. Pin 7 as an output controls the relay operation.

What is the volts for VIN? Might use pullup resistors for I2C, What volts does the relay coil use?

I see that the power is daisy chained from unit to unit. I am guessing that ground is also daisy chained. Daisy chaining ground and power is a BBBBB AAAAA DDDD idea.

As far as I can zoom in those solder joints do not look good. but if its "working", shrug.

1 Like

Here's an MOV that should help considerably. Here's how to connect it:

image

1 Like

To start, I would put 0.1µF capacitors on every power line +v to Ground at each board. And at the input to the relay board.

1 Like

What's the mystery power source that goes into the 'DC in jack'?

Hi, thanks for your opinion! Vin is 5v. All modules are powered with 5v. The RTC module has the connections mirrored so I used them to my advantage for ease of connection. About the pull-up resistors I thought that the modules had them already, I should check that

Thanks I’ll try that

It’s an LG 5V 2A switching power supply

Thanks, I’ll do that

Ok, you'd expect that to be sufficiently solid for this box. I'd start by placing a buffer capacitor at the DC input jack; something like 470uF or 1000uF. The 100nF decoupling caps @JohnRob mentions won't hurt either, but I'm afraid they're redundant as all modules (the Nano, the RTC) usually have them on there already.
What does your relay switch, exactly?

You know this is a problem?

30 VIN Power 6 – 20 V input to the board

If you want to input 5V to the Nano put the 5V into the 5V pin.

Hi Koraks, thanks for the information. The relay turns on an AC bell ringer a big one. I tested it 48hs turning on a 5V buzzer without any problems. That’s why I suspect interference on the data cables.

Ouch, I’ll correct that right away!

Well, thank you all guys!
Moving the DC +5V input to 5V instead of Vin, adding the 0,1uf capacitors to each module, adding a filter 1000uf cap to the dc in jack and the varistor to the relay made the system work flawlessly. I don’t know if everything is really necessary but as it is very cheap I just added all. Thanks again for your advices

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.