Hello guys and girls,
So I have this major issue I try to solve the last month…
I have a master arduinoUNO that communicates with a slave arduinoUNO(MotorControl) and another arduinoUNO(DataSaver). The master arduino has a compass connected on it via I2C as it should be with 4k7 pull up resistors. It reads the compass data and sends to the MotorControl instructions to run the motors via I2C and sends the same data to the DataSaver arduino(that has a shield on it) in order to write those data in a file in an SD card. I initialize correctly all my slave arduinos and I have the compass initialized on my program. The thing is that sometimes (NOT ALWAYS) the I2C freezes and NO DATA will be sent to the MotorControl, NEITHER the DataSaver.
The power is distributed to every arduino separetly. All grounds of arduino are connected with each other. The output 5V from the master goes to a small board where i have installed 2 4k7 pull up resistors. from there, the I2C from A5 and A4 travels to the other 2 boards and the compass. 5V output from master gows to compass VIN and the ground of the compass is connected to the common arduino grounds. The motor control slave has 2 ESCs connected on it to control 2 motors. The DataSaver slave has an ethernet shield with an SD card on it in order to save data.
Do i have to give an address to the compass just like i do with the arduinos in my program?
Why some times it works and some times it doesn’t?
How can i make it 100% stable?