I'm building a project based on the raspberry pi 3 (written in NodeJS & python) which uses the following modules: a bmp180 barometer, an mpu6050 imu, a hc-12 radio, a ublox-neo7m GPS, an LCD with an i2c converter & a qmc5883l magnetometer.
I supply the rpi and LCD with 5v from a power distribution board powered from a 3-cell 12V LiPo. The LCD's i2c lines are connected to the rpi's via a dual-channel bidirectional logic level shifter. The GPS, barometer, magnetometer & mpu6050 modules are powered from the rpi's 3V and the HC-12 radio is powered from a separate power converter, which takes 5V from the power distribution board and outputs 3V (max 800mA), because the radio takes about 300mA while transmitting.
Everything works perfectly as long as the radio is not transmitting. When I start the transmission (and my project transmits continuously after first data is sent, so it sends data and in about 350ms there is an answer, which triggers next data to be sent, etc.), mpu data start to go crazy, e.g. a stable (I mean the mpu6050 imu is in the same position all the time) roll of 30 can start going to -30 or to any other values after the radio starts transmitting. Also, after I start transmitting data, I get a message "Failed to write data register: I/O error" once per a few i2c data polls to the mpu, though the data is read anyway, but, as I already said, the values are unreliable. If I stop the transmission and restart the program (which reinitializes all the modules), everything works fine until I transmit data with the radio again.
What can be the solution to this problem? And is it possible that just the i2c communication draws too much current from the rpi, so the values go crazy, because the rpi is overloaded?
Thanks in advance