0

I am trying to do rotational vector calculation using a MPU6050 chip which actually work really well with not too much drift when I rotate the MPU slowly. However, when I accelerate too much, e.g. change direction in my slow rotations or just slightly tap the breadboard with my finger, the values completely go nuts.

I am using an ESP8266 chip to control the chip and I have tried multiple libraries for reading the Gyro/Accelerometer values which all have more or less the same behaviour.

My accelerometer readings from the Serial plotter, before and after the light tap to the breadboard:

enter image description here

Gyroscope does the same thing. The MPU is new (just arrived in the mail few hours ago), I power it using 3.3V and use 3.3V GPIO logic from the ESP chip.

Does anyone know what could be causing this?

  • 1
    I think the key word here is "breadboard". Hardly a stable environment for signals... – Majenko Apr 8 at 15:59
  • @Majenko should I try it on a PCB? I thought so too but why does the problem always occur when the acceleration changes, and immediately goes away after I restart everything? – Twometer Apr 8 at 16:01
  • Probably the sudden change in acceleration makes one of the connections move and communication gets out of sync in some way, or makes the chip get a bad instruction that changes some random setting. – Majenko Apr 8 at 16:03
  • @Majenko Okay, I am going to try to put the circuit on a PCB and see if that helps. Thank you for the suggestion. – Twometer Apr 8 at 16:05
  • @Majenko I have soldered everything now and everything is working perfectly now, thank you so much I have been at this for hours! Thank you very much! It only starts doing this again when I pull so hard on it that the power cable disconnects :D – Twometer Apr 8 at 17:08
1

Your problems are (most likely) related to loose connections in the breadboard. Sudden movements can cause power to be interrupted briefly, or data signals to become corrupted.

Breadboards aren't great for prototyping anything that moves, even slightly.

| improve this answer | |

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.