0
\$\begingroup\$

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

\$\endgroup\$
  • 2
    \$\begingroup\$ Measure. Voltages. Waveforms. See what is going on. Yes, this or that could be the reason, but what does it help to know if it could, you need to know what it really is. Measure. \$\endgroup\$ – PlasmaHH Nov 4 '17 at 18:13
  • \$\begingroup\$ Is a standard voltage/current measurement tool enough for me? Or will I need something else too? \$\endgroup\$ – artus90 Nov 4 '17 at 18:17
  • 2
    \$\begingroup\$ @artus90 you'll want to have an oscilloscope \$\endgroup\$ – Kyle Hunter Nov 4 '17 at 19:16
0
\$\begingroup\$

Finally got it working - the raspi was overloaded, so I plugged all the devices except LCD and mpu to 3v from external converter and the mpu and LCD to 5v from pdb.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.