Sensor & Servo interfering [PROBLEM]

Hello peeps,

Maybe I should start by telling you what I am doing so you can get a perspective of my problem and maybe give me a helping hand.

I have a sensor called Triple Axis Accelerometer & Gyro Breakout - MPU-6050 , and Ive managed to get it working. I can get the information I want from it. And to get the information I want from it Im using the interrupt function. So the interrupt part is a big factor of the problem I will tell you about.

So Ive tried to expand the code further, by adding servos. What Im trying to do is to control the servos depending on the values the sensor is generating. It works out, for a couple of seconds.

The problem is now that, after these couple of seconds the values from the sensor gets screwd up. Getting values that I shouldnt get.

Conclusions: The servo and the sensor are overflowing the fifobuffer.

Help appreciated, cheers!

Edit: Link for the code im using


How are you powering the servos ?

Check the two links in my signature for why this maters

Duane B

I followed your advice but I still have the same issue as before. But I will continue with using external battery to supply the servo, so thanks!

This is an answer I had from an other site but I dont know how to go any further.

Well, yeah, if you are getting FIFO overflow, you are not emptying it out in time so something must be using too much time. If you are generating PWM signals for the servo with the same processor that reads the MPU then you could easily overflow the FIFO. I mean if THAT’S your configuration. It also means your sensor is set for free running reads.

Please help me go further!

PS. DuaneB, nice projects uve done!


Hi, Quick suggestion - most of us will not click on links in posts, try adding your code to the post and dont forget to use the # button to include it inside code tags

Duane B

freak174: The servo and the sensor are overflowing the fifobuffer.

I have exactly the same problem! Did you figure out ? Also Im using same piece of code.