I2C noise filter

I have an arduino mega2560 connected to 11 I2C devices, 4 pcf8574's, 3 pcf8591's an RTC module with EEPROM and 2 16x4 LCD screens. On the I2C bus SDA and SCL pull-ups are reporting 3.5k ohm.

EDIT:i said 6 pcf8574's. Its 6 total if you include the lcd screens. but i use 4 of them for gpio..

Until i introduce a really noisy light ballast that seems to emit A LOT of EMI. As soon as you turn the ballast on the arduino will reset, Then as the light is warming up and outputting more and more power the readings from my PCF8591's become invalid and this causes problems. I disconnected everything except the I2C devices ,relays,pumps,etc. and the noise does not change. While trying to find the source i used a different power supply and the noise seems to not effect the system as much. When the light is off or fully warmed up there are no problems..

It appears most of the noise is being picked up on the 12v power wire that feeds the system. I feed the 12v into a 1000uf cap and then into a adjustable switching regulator. I have 0.1uf decoupling caps on all of the I2C devices.

i have a 6 inches of stranded 22awg 4 conductor wire connecting 2 i2c devices at a time.
I google looking for noise filtering techniques for I2C devices and i found this,

https://www.latticesemi.com/-/media/LatticeSemi/Documents/WhitePapers/HM/ImprovingNoiseImmunityforSerialInterface.ashx?document_id=50728

But im not sure what to do in my situation. Can anyone give me any recommendations how to keep high freq noise from cause so many problems? I thought about maybe using an ac transformer between the arduino and the mains power to provide some galvanic isolation??

I have an oscilloscope but i dont know how to use it to see how the noise is effecting things..

1 Like

Experience tells us that noise often comes in on the common (aka ground). This is a little of a simplification.

And you have to treat the whole system as an EMI receiver. So post a photo(s) of you physical layout. Define what each output is going to and input coming from.

2 Likes

I have some pictures that kinda show how its hooked up. I have 2 modules "blue,black" that handle 16 GPIO each using 1 pcf8574. the white box has 3 pcf8591's


I do not have decoupling caps in the photos but they are there now.
I kept all the 12v on the outer left and right of the module. so only 5v,I2C,GPIO in the center of the module. i was hoping it would help. the arduino is the the box with the lcd screen. Even if i unplug all 20+ connectors from the modules and leave only the I2C between arduino i get the same amount of noise the behavior dont change at all. However if i use a power supply further away from the ballast the noise almost stops affecting things

1 Like

To make the system immune to local EMC will require a lot of changes in you wiring. And a lot of "fiddling".

Honestly I think your first step should be getting rid of the ballast device.

1 Like

This is what my scope shows me.

Here is a i2c scl signal without a ballast.


Here is a photo of scl with the ballast on.


What can you tell from these pictures? How can I help my wiring. With the ballast on. The arduino just reset over and over until the ballast is warmed up

So think of all those wires as receiving antenna's. Then think of the ballast as an RF transmitter.

The goal would be to stop the RF from being received by the antenna(s).

I feel kinda limited on options though because it's not like I can print a pcb. Let alone design one properly. Though thats on the table I just don't know anyone to do it but me.

I can tell you it seems like the power wire is picking it all up. Unplugging everything from those modules didn't change anything. Changing to a different psu made a huge impact.

Here is a look at scl with a different psu. Not much visually I can tell but it sure seems to help but not stop ot.

Would a grounded metal plate behind the whole system help you think?

Here is the scl line with the ballast warmed up.

would be help if you showed the clock signal along with the data signal. The data is only checked at the point when the clock signal rises. The error is likely to be in your clock signal line rather than the data. Or they could both have noise at the identical time in your trace.

the mosfet boards are isolated from the arduino power supply. With a long power drop near that ballast things go bad fast. The analog value return from the pcf8591 should be 0 instead with the ballast on it maybe stayed around 20 but sometimes jumped up to 255. if i use a power source further away from the ballast instead of 0 the analog value is between 0 and 7.

In a couple hours i can check the SCL and SDA together on the same screen. They did seem to have the same noise but i dont know if it was at the same time.. How would i build a RC filter for the SDA and SCL lines? is this possible. that link in the first post mentioned that as an option. I just feel better asking here first.

I'm sorry just to be clear here im talking about a 1000w digital HID ballast. I'm not sure how to deal with the EMI i think is RF really effects the AM band. U can hear the noise sweeping through the am bad starting low then, higher,higher

Is this true that I2C has a limit of 1uS rise time? will it work at all outside this range? Im concerned because that scope was set to 5.0uS and the rise time is getting close to the max 1 uS. Is this right?

To add to all of these questions.. Would it be wise to use some optical isolation for the i2c lines?

IF that is what you are hearing, it is NOT a ballast like the old fluorescent lamps had. You are hearing the switching power supply for the lamps. I have several 12 volt DC PSU units and they do that drifting frequency noise up through some of the lower short wave frequencies. There is NOT a lot you can do because the noise is radiated from the AC power wires.
Taking care of the noise when it gets into your Arduino project is about the only solution. Shielding, distance from the source and AC power wires and filtering.

Back in the day only magnetic ballasts existed for HID lamps. Now days everything is digital. I can confirm there is a LOT of noise generated from that ballast when it turns on. If u use an am radio u can hear it the moment it starts. U can follow it by go up in freq on the radio.

I just put ferrite chokes on every wire going in and out of the arduino system. It seems to help. Would you expect it to? I sort of blindly put the chokes on there. But it does seem to help a little bit. The chokes I used are tight around the wires

If you think they help, then they probably do. Be sure to consider any ground wires between modules. They ALSO act as antennas! Best to twist each signal wire and it's corresponding ground wire. That means more ground wires than just one.

This is what the i2c clock looks like sometimes when I turn off /on a mostfet output. The output turns on a 12v relay that turns on a 100w 120vac pump

How can I fix this?

I found this info from TI

image

I would also put a common mode choke on the HID ballast input. Maybe you have an old USB cable with a filter. Else you may have to purchase one if the wires to the filter are too large for the USB device.

Isolation will likely not help very much. ESD and RF go right through opto isolators.

I don't know if a full AC EMC filter is worth the effort. Something like this:

image

You can find them really cheap on some electronic surplus sites, maybe ebay.

1 Like

The "new" noise is coming from the back emi from the 120v pump. I tried every combination of resistor capictors I can think of but none of it stops the noise at all really and its causing my lcd to stop responding and cpu to crash.

BTW this is a whole other issue of noise I'm having besides the ballast noise