Hot answers tagged

8 votes
Accepted

Change I2C Pins on Raspberry Pi

You can implement a software I2C bus on any pair of spare GPIO. You will need to add resistor pull-ups to 3V3 on any spare GPIO you use. For reference pins 3 and 5 have 1k8 pull-ups to 3V3. You ...
  • 68.3k
3 votes

Self-balancing robot using Raspberry 3b+

Brick's answer is already very comprehensive, but I would like to add a couple of things: time.sleep is a blocking function, which implies that, at each loop, before you perform a new calculation in ...
  • 683
3 votes

Self-balancing robot using Raspberry 3b+

We don't know anything about your robot's size or shape, and that could matter. Some shapes are easier to balance, for example, and therefore probably less sensitive to control timing delays. ...
  • 1,367
3 votes

Self-balancing robot using Raspberry 3b+

The code is written in Python which is an interpreted language. It will be somewhat slower than a compiled language such as C. You have many print statements in the code. That will slow the main ...
  • 68.3k
2 votes

Raspberry Pi Detects I2C Device Sometimes

The only reason for an intermittent connection is a loose connection. I suggest you check that each wire is securely soldered in place. It is safer to power from 3V3 rather than 5V if the module ...
  • 68.3k
2 votes

Raspberry Pi not detecting MPU6050 with i2cdetect

You should not need to use sudo with i2cdetect. The most likely problem is not connecting ADO to either ground or 3V3.
  • 68.3k
1 vote

Raspberry Pi Detects I2C Device Sometimes

A lot of stuff about MPU 9250 in https://learn.sparkfun.com/tutorials/mpu-9250-hookup-guide (i2c, pull up, datasheet, ...). For the power and the address selection : VDD Power supply +...
  • 31
1 vote

I2C OS error when activating motors

Do you power the raspberry pi and the motors from the same source? The motors will draw quite some current. So, when they get activated, there will by some spikes on the power source which might ...
  • 257
1 vote

Handling computer mouse pointer with MPU6050 sensor

I think the easiest practical way to achieve this is to get an Arduino based on a 32u4 chip (Leonardo / Esplora / Zero), attach the MPU to it and implement a mouse using the Mouse functions. You can ...
1 vote

Seperate GPIO pin outputs influencing sensor readings

Try disconnecting the motor driver from the Pi and repeating the measurements. If they become unstable the moment you start controlling the motor, there is likely a software bug in your code. ...
1 vote

MPU6050 data logging start and stop on button press

Question The OP already has a working python program which logs the readings of an accelerometer MPU6050 and write to a CSV file. Now he wishes to have advice and direction on how to write another ...
  • 4,434
1 vote

MPU6050 data logging start and stop on button press

You may need a few changes first. Run a groups command on the Pi and make sure your current user (most likely: pi) is a part of gpio group. If you're not, run the following: usermod -a -G gpio pi (...
  • 131
1 vote
Accepted

Rasberry with MPU6050 detects strange peaks in acceleration and gyroscope measurements

I had a very similar-looking problem a few years ago, and posted a question in Electronics SE. @BrianDrummond figured it out and posted this answer: Errors look like +/-256 +/- expected drift. This ...
  • 538
1 vote

OSError: [Errno 121] Remote I/O error or pigpio.error: 'I2C read failed' on MPU6050

I don't have a MPU6050 so I can't really test this. However I suggest you look at this ADXL345 example and try similar code to read registers X, Y, Z as a block. import sys if sys.version > '...
  • 68.3k
1 vote

How many i2c buses?

What do you mean by at once? You can buy two TCA9548A I2C multiplexors which will allow you to connect 16 MPU6050 on the same bus (at the same bus address). However only one MPU6050 may be addressed ...
  • 68.3k
1 vote

MPU6050 Python Library

This snippet will provide angle after manipulating the values from MPU-6050 MPU-6050-kalman-filter-python . Reading gyroscope and accelerometer values from MPU-6050 is just reading the data from an ...
1 vote

Not all devices that are connection via I2C are showing

I had the same problem. The board is not faulty, the problem is caused by the MPU6050. Add these lines to the MPU6050 initialization process: self.bus.write_byte_data(self.address, 0x37, 0x02) self....
  • 95
1 vote
Accepted

How to set up MPU6050's registers properly?

I ran in to the same problem during a project week at Uni, so have started developing a library to allow easy interfacing with a MPU6050 via the I2C Bus. The library is written in C++ and assumes some ...
1 vote
Accepted

MPU6050 gyroscope not responding

The MPU may be voltage sensitive, but most break out boards I have seen are ok at 5V. I2C itself is a current sync protocol, meaning it will generally work at any voltage, having a signal pulled to ...
  • 128
1 vote

MPU6050 gyroscope not responding

According to the MPU-6050 datasheet it accepts voltages in the range 2.375V-3.46V. Supplying one of the pins with 5V could indeed have damaged the sensor.
  • 68.3k

Only top scored, non community-wiki answers of a minimum length are eligible