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 ...
joan's user avatar
  • 70.9k
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 ...
David's user avatar
  • 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. ...
Brick's user avatar
  • 1,377
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 ...
joan's user avatar
  • 70.9k
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 ...
joan's user avatar
  • 70.9k
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.
joan's user avatar
  • 70.9k
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 +...
lue's user avatar
  • 31
1 vote
Accepted

Using MPU9250 / 6500 with Raspberry Pi 4

Here is link for Sensor MPU9250 With Raspberry Pi
toyota Supra's user avatar
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 ...
rdmueller's user avatar
  • 277
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 ...
Dmitry Grigoryev's user avatar
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. ...
Dmitry Grigoryev's user avatar
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 ...
tlfong01's user avatar
  • 4,665
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 (...
nurchi's user avatar
  • 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 ...
uhoh's user avatar
  • 562
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 > '...
joan's user avatar
  • 70.9k
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 ...
joan's user avatar
  • 70.9k
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 ...
daedalus_hamlet's user avatar
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 ...
NathanielJS's user avatar

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