I'm using an IMU to control the direction of a robot(brush dc motors from dfrobot, so not very good). It's connected via an i2c bus. When there's no motors the reads are fine, but when the motors are running it affects the scl and sda lines and the arduino freezes.
I suppressed the radiated noise by soldering ceramic decoupling capacitors to the motors (reading the IMU with a different arduino than the one controlling the motors work), but conducted noise makes it fail with only one arduino.
I have tried:
Pulling up sda and scl lines with 2.2 and 4.7 kOhm (it lasts longer but freezes anyway)
Plug the imu directly to the board instead of having it connected with cables (same result)
I've thought of using an optoisolator but I guess in this case it will have no effect since the noise on the board will affect the cables anyway.
Any ideas?