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.
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.
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
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?
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.
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