MPU6050 with Raspberry Pi using python in easiest way | Accelerometer | Gyroscope | Temperature

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.พ. 2020
  • In this video I will show you to access MPU6050 with Raspberry Pi using python to get temperature, accelerometer and gyroscope data in the easiest way.
    For code and commands:
    github.com/Arijit1080/mpu6050...
    For future updates follow us on facebook: / sparklers2018
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 45

  • @qiqinyu7052
    @qiqinyu7052 2 ปีที่แล้ว +4

    Hi,
    Can you change the sampling rate? what is the sampling rate in your video and can I go 100Hz?

  • @achraf1647
    @achraf1647 ปีที่แล้ว

    hey I want to ask you please what is the software or website did you use for making the picture that shows the raspberry pi connected to the IMU ?

  • @minhnguyentrancong8537
    @minhnguyentrancong8537 3 ปีที่แล้ว +1

    I want to convert acceleration series into speed series from MPU6050, what should I do? Thank you.

  • @geirha75
    @geirha75 3 ปีที่แล้ว

    does it measure negative g as well? imagine driving your car an then braking.. there should be negative g.

  • @muhammad_haruna
    @muhammad_haruna 10 หลายเดือนก่อน

    thanks a lot bro, this was really helpful.

  • @juansebastianpenamora2289
    @juansebastianpenamora2289 ปีที่แล้ว

    Excellent work 👍

  • @kwisatzhaderach1458
    @kwisatzhaderach1458 3 ปีที่แล้ว

    Helpful 👍

  • @mohammadashralph4731
    @mohammadashralph4731 2 ปีที่แล้ว +1

    What is unit of the gyroscope's output?

  • @BB-iq4su
    @BB-iq4su 2 ปีที่แล้ว

    many thanks

  • @sundarsanthanam6147
    @sundarsanthanam6147 3 ปีที่แล้ว +8

    If you add 5V the output , you get will be 5V data which will damage the GPIO pins of raspberry pi , better try using logic level shifter or 3.3V as source to the mpu6050

    • @Debraj1978
      @Debraj1978 2 ปีที่แล้ว +2

      MPU6050 also works on 3.3V. To get 3.3V, there is a linear regulator on the MPU6050 PCB.
      Overall, even if you are connecting 5V to MPU6050 board, the I2C signals are safe to be connected to Rpi.

  • @mostafaalin7494
    @mostafaalin7494 2 ปีที่แล้ว

    Good

  • @torus151
    @torus151 ปีที่แล้ว

    Thanks brother

  • @jyotiprakash3423
    @jyotiprakash3423 3 ปีที่แล้ว

    Thanks, I was getting an error because I didn't know about i2c

  • @joelhanerth6907
    @joelhanerth6907 2 หลายเดือนก่อน

    Can I get the same result using an Orange pi?

  • @KaneCIT2RP
    @KaneCIT2RP 4 ปีที่แล้ว

    Hi, the code doesn't run even tho I downloaded everything you said and ran i2c but it says ModuleNotFoundError: No module named 'mpu6050' and I don't know what to do

    • @SPARKLERSWeAreTheMakers
      @SPARKLERSWeAreTheMakers  4 ปีที่แล้ว +1

      Use i2cdetect - y 1 and before this you must enable i2c from raspi-config

    • @KaneCIT2RP
      @KaneCIT2RP 4 ปีที่แล้ว

      @@SPARKLERSWeAreTheMakers Okay I successfully added the library but the measurements are all wrong, it gives a constant value of 0.0622 in Z and 0 in X and Y so what do you think is wrong?

  • @jayantvyas5327
    @jayantvyas5327 3 ปีที่แล้ว +1

    Getting below error after following all the steps shown in video:
    Traceback (most recent call last):
    File "mpu6050.py", line 1, in
    from mpu6050 import mpu6050
    File "/home/pi/mpu6050.py", line 1, in
    from mpu6050 import mpu6050
    ImportError: cannot import name 'mpu6050' from 'mpu6050' (/home/pi/mpu6050.py)
    Can any one please help to resolve.

  • @gsvishnuvarradhan991
    @gsvishnuvarradhan991 3 ปีที่แล้ว

    i am getting an error called "os error............ No specific info on this error"................Plzzzz help me to rectify this problem ............I need this for my final year project..............so kindly help me out .

  • @isniphsi7843
    @isniphsi7843 11 หลายเดือนก่อน

    When I enter the command i2cdetect -y 1 in the terminal I get the table off but it is not empty.
    does anyone know if this is a problem ?
    When I run the script I also get no values ?
    My output looks like this.
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: 08 09 0a 0b 0c 0d 0e 0f
    10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
    20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
    30: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
    40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
    50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
    60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
    70: 70 71 72 73 74 75 76 77

  • @vihangifernando
    @vihangifernando 4 ปีที่แล้ว +3

    Traceback (most recent call last): File "mpu6050.py"line 1, in from mpu6050 import mpu6050 ModuleNotFoundError : No module named ''mpu6050' Why should I got this kind of error. I did all the steps correctly.

    • @guywolf3674
      @guywolf3674 4 ปีที่แล้ว

      I'm having the same problem, did you figure it out?

    • @petersu8254
      @petersu8254 4 ปีที่แล้ว +6

      Maybe the file you downloaded via the terminal had been installed in the python2's folder. Try python2 mpu_6050.py instead. My problem got fixed anyway.

    • @patrickaliberti8173
      @patrickaliberti8173 3 ปีที่แล้ว +3

      @@petersu8254 yay! This solved my problem, it was in python2. Thank you good sir!

    • @whitneydesignlabs8738
      @whitneydesignlabs8738 3 ปีที่แล้ว +1

      Same error for me. I had to type "pip3 install mpu6050-raspberrypi" and then it worked in my editor (Thonny). When I followed the directions exactly, it only worked in my terminal window, but not my editor. Love it though. Now, to figure out how to interpret all this movement data. :)

    • @luciajurj9810
      @luciajurj9810 2 ปีที่แล้ว

      @@whitneydesignlabs8738 Did you found how to interpret the gyroscope movements? How to classified them? Thx!

  • @Leozinyeahh
    @Leozinyeahh 2 ปีที่แล้ว +1

    where do you click to save the code?

    • @mnikpro
      @mnikpro 2 ปีที่แล้ว

      'x' and 'n'

  • @sckeshari
    @sckeshari ปีที่แล้ว

    Hi, my device unable to detect the sensor though green light is on. How to resolve this ?

    • @sckeshari
      @sckeshari ปีที่แล้ว

      This issue is solved by direct connecting wires from raspberry to the sensor pins. Using breadboard was creating problem.

  • @astridbreitbarth4937
    @astridbreitbarth4937 3 ปีที่แล้ว

    Hi i do what u show..... works great....but... why i have 44 degrees in my livingroom ??? i am sure thats around 20....

    • @astridbreitbarth4937
      @astridbreitbarth4937 3 ปีที่แล้ว

      i have pi zero w...

    • @itsmeintorrespain2714
      @itsmeintorrespain2714 3 ปีที่แล้ว

      @@astridbreitbarth4937 It's the temperature of the chip on the sensor module, not your living room.

  • @valentinlaffont2230
    @valentinlaffont2230 2 ปีที่แล้ว

    you do not explain how to calibrate the mpu, your statistical data is false which prevents its use. how to calibrate in raspberry/python config ? thanks

  • @amalzahinbinahmadfaizal7444
    @amalzahinbinahmadfaizal7444 2 ปีที่แล้ว +1

    in minute 6:53 ,the step is not clear...how to run and save the code

    • @ReflectingMe2024
      @ReflectingMe2024 2 ปีที่แล้ว

      The command broken down is: Python3 mpu_6050.py tells the terminal that it needs to run the file called mpu_6060.py using Python3. This is the same as running up your Python IDE, opening the file mpu_6060.py, then running it... but it is done here in the terminal.

    • @IrishAnonymous01
      @IrishAnonymous01 2 ปีที่แล้ว

      I was wondering the same.
      Press Ctrl+S to save, then open a new code terminal and type python3 mpu_6050.py and press the Enter key and it should execute.
      If you get a "Traceback" error, check that your wires have good connection on the sensor.
      Hope this helps someone!

  • @jjdavidian
    @jjdavidian หลายเดือนก่อน

    Response seems awfully slow to me

  • @IrishAnonymous01
    @IrishAnonymous01 2 ปีที่แล้ว

    Here's how to plot the data in real time for those interested
    stackoverflow.com/questions/64092499/python-real-time-sensor-data-graphing