Это видео недоступно.
Сожалеем об этом.

How to use MPU-6050 Accelerometer and Gyroscope with Arduino code

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • In this video you will learn how to use MPU-6050 Accelerometer and Gyroscope sensor module for Arduino.
    The best thank you for me is to Subscribe 🔔 to my channel and thumb up the video. It is greatly appreciated. 🔔 😊.
    I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊
    *** Free Course ***
    Arduino Step by Step Course (over 100 lectures) Starts here • Lesson 00 What is Ardu...
    Download Code and resources for MPU-6050: robojax.com/L/?...
    ***Purchase MPU-6050***
    Amazon Canada: amzn.to/3qzV2ue
    Amazon USA: amzn.to/3vd6kYD
    Amazon Europe (all countries): amzn.to/3tbjGmH
    Banggood: www.banggood.c...
    ** Purchase Arduino Start Kit **
    Amazon USA: amzn.to/3z88F9G or just UNO board amzn.to/3aY7KOL
    Amazon Canada: amzn.to/31an88J or just UNO board amzn.to/3pYxSNN
    Amazon Europe (all Europe): amzn.to/3pMCHge or Just UNO board amzn.to/2PgGItD
    AliExpress: s.click.aliexp...
    Banggood: www.banggood.c... or UNO board www.banggood.c...
    eBay: ebay.us/B1JWLi
    ***** Purchase Authentic Arduino Uno from ***
    Amazon USA: amzn.to/2KApAwK
    Amazon Canada: amzn.to/37LZ8sW
    All Europe Amazon: amzn.to/36YDSzn
    Related videos:
    MPU-6050 with Display • Using MPU6050 with LCD...
    Chapters of this video:
    00:00 Start
    00:00 Introduction
    02:28 Hardware explained
    03:45 Datasheet viewed
    06:08 Getting library
    06:44 Wiring explained
    09:05 Code explained
    MPU-6050 Registers' map:
    www.invensense...
    How to use a breadboard (video) : robojax.com/L/?...
    Tutorial by Ahmad Shamshiri form Canada
    ****************************
    Arduino Step by Step Course (over 100 lectures) Starts here • Lesson 00 What is Ardu...
    Learn Arduino in 30 Minutes (video): robojax.com/L/?...
    ****************************
    If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robo...
    If you want to learn Arduino from proven instructor on **Udemy**: bit.ly/rj-udemy
    Follow me on Facebook robojaxTV
    Follow me on Twitter: / robojaxtv
    Follow me on Instagram: / robojax
    Tutorial by Robojax.com
    Get other projects code and learn Arduino
    robojax.com/lea...
    #robojaxAccelerometer
    #robojax #robojaxMPU6050

Комментарии • 208

  • @mikebrown7366
    @mikebrown7366 5 лет назад +64

    Only connect SDA and SCL to retrieve gyro angle and accelerometer values.
    XCL and XDA do not need to be connected. They are for connecting an external magnetometer module so that DMU (an advanced, but seldom used, feature) can calculate yaw using the magnetometer as a slave device. You shouldn't need the interrupt pin either, unless you are using the advanced DMU feature of the MPU6050. You only need to connect Vcc, Gnd, SDA and SCL to use the device.

  • @bilal12e
    @bilal12e 4 года назад +3

    Best Explanation, I have watched 100 videos on youtube, all people are mixing gyro with acceleration, Thanks A lot

    • @robojax
      @robojax  4 года назад

      Belal you are welcome. Ahmad from Canada.

    • @ichall2363
      @ichall2363 4 года назад

      Hi, I have a problem, its just read x=-90, y=90, and z=0. You have solution for it?

  • @phuonglehuy6257
    @phuonglehuy6257 3 года назад +6

    Thank you so much, this vid help me a lot with my school project.

    • @robojax
      @robojax  3 года назад +1

      You're very welcome!

  • @timkern9563
    @timkern9563 3 года назад +2

    Thank you for the excellent explanation.
    I have two additional questions:
    1) How can I read the temperature?
    2) I understand there is a Tangent function available (in the IDE or perhaps in the Library). I need to use this in one axis. Where is it, and how can I get the tangent of the angle the MPU6050 is detecting?

  • @israellindemann7772
    @israellindemann7772 3 года назад +2

    Best video i've ever seen

  • @michaeljbeal
    @michaeljbeal 5 лет назад +6

    I am so thankful for this video! Thanks for taking your time with it!

    • @robojax
      @robojax  5 лет назад +1

      You are welcome. I am please to be helpful. That's very kind of you.

    • @rahulfromkerala
      @rahulfromkerala 5 лет назад

      @@robojax You re really awesome. Many thanks for sharing such an informative video. Many thanks.

  • @daniaazzahra1698
    @daniaazzahra1698 4 года назад

    i have a question. can we use this sensor on inclined plane to test somethings stability? if we could then where do we place it and how is it going to work, im so lost pls helpp.... thanks so much for this videoo tho soo helpful!

    • @robojax
      @robojax  4 года назад

      Perhaps from watching this video you have learned that this sets a reference coordinate in 3d plane. whatever angle you put it, it sets those as 0,0,0 in x, y and z. So if you are installing it in inclinded surface, then in the code add or subtract that angle. The location doesn't matter. as soon as the module powers up it sets them as zero but you add your inclined value to get correct angle in any of the 3d plane.

    • @daniaazzahra1698
      @daniaazzahra1698 4 года назад

      @@robojax so its okay if we dont put it on the object that we are going to test? i thought we have to put it there so we can now the angle and stuff from the object? and i still dont get how exactly the sensor work...

    • @robojax
      @robojax  4 года назад

      you should put it and it has inclination in X or Y or Z and add or subtract the value. inside the cod.e

  • @imadalnajjar8251
    @imadalnajjar8251 2 года назад

    Thank you for this informative video; I have a question; after doing the same and testing it, I noticed that the Z value is changing over time even without touching the module. Do you have any idea why?

  • @user-dw4uz9qu7g
    @user-dw4uz9qu7g 6 лет назад +1

    thank you from my heart the simplest calibration at all!

    • @robojax
      @robojax  6 лет назад

      You are welcome.

    • @user-dw4uz9qu7g
      @user-dw4uz9qu7g 6 лет назад

      well, sir, I have one question and any help will be appreciated!
      thanks again!

  • @laudaemon
    @laudaemon 3 года назад +2

    Thank you so much!
    P.S.- Love your accent

    • @robojax
      @robojax  3 года назад

      You are welcome.
      P.S. Thank you! 😊

    • @pravinchavhan8890
      @pravinchavhan8890 3 года назад

      @@robojax
      hi , i just want to know how can i calulate number of 360 degrees rotations completed by MPU6050 using arduino . it would be nice if u help me

  • @mr.anirban6631
    @mr.anirban6631 3 года назад +1

    Hey dude would you please tell me the difference between ADXL345 and MPU6050 , and which one should be preferred for esp32?🙏

    • @robojax
      @robojax  3 года назад

      The first one is just accelerometer but the 2nd one has gyro and compass. When you use I2C it works with both.

  • @juanalvares11
    @juanalvares11 5 лет назад

    i have been watching this video 2 -3 times and in the and i understood good explanation

  • @333donutboy
    @333donutboy 4 года назад

    Great info. Thanks for sharing. You got yourself another subscriber!

    • @robojax
      @robojax  4 года назад

      You are welcome. Thank you for not skipping the ads and keep watching it. This will help me a lot.

  • @AdityaSingh-hx1tv
    @AdityaSingh-hx1tv 4 года назад

    thanks a lot sir for the explaination and the code ur video helped alot

    • @robojax
      @robojax  4 года назад

      You are most welcome

  • @TheRESMAT
    @TheRESMAT 6 лет назад +1

    Hello what is sample rate in your code ? Thanks

  • @izumisama_
    @izumisama_ 3 года назад

    Thank you so much, Now I can use this for my rocket project.

    • @robojax
      @robojax  3 года назад +1

      Glad I could help!

    • @manishpingale6558
      @manishpingale6558 3 года назад

      hey
      did you do it?
      I am also making flight computer

  • @armbar6761
    @armbar6761 5 лет назад

    I like this instruction,but do we really need interrupt pin to be connected?,because i couldn't see it in the library,thanks.

  • @GUSTAVO-gj8zh
    @GUSTAVO-gj8zh 4 года назад

    does anyone know how to simulate the output signal of the mpu6050 with arduino ? i have an electric unicycle and its circuit board works with an accelerometer and i want to use it with a potentiometer. is there any code ?

    • @robojax
      @robojax  4 года назад

      Arduino is reading digital data from this board. Poetentiometer (variable resistor) is analog. You will need some extra work to convert analog to digital, (in arduino which is easy) then the value to convert it in a format similar to MPU-6050 so Arduino library understands it.

  • @dudeuw1604
    @dudeuw1604 4 года назад

    Very clear. Wish i found this video sooner 😟

    • @robojax
      @robojax  4 года назад

      I am glad you did not. Please share so other know about it. Thanks.

  • @DwayneGabrielLRuado
    @DwayneGabrielLRuado Год назад

    Hi sir,I tried to follow your tutoriali did everything the same. but the value stays on 127 to all variables x y z, i thought my mpu is not working then i tried another MPU Chip and the results are the same, any tips? :)

    • @robojax
      @robojax  Год назад

      hi, use I2C scanner to check if device is connected or check wiring. on robojax.com search for I2C scanner code, run it to see if it prints the I2C address then check the wiring.

  • @Rexicup
    @Rexicup 5 лет назад +1

    Hello kind sir, would you please make a video about displaying the data of the sensor on an I2C 0.96" OLED display?

    • @robojax
      @robojax  5 лет назад +1

      Here is the video on OLED ruclips.net/video/UmYiHTOz-5k/видео.html very easy to use and here is example of a sensor value to be displayed ruclips.net/video/Pgx5fNF4Q6M/видео.html

  • @shtrv4969
    @shtrv4969 5 лет назад

    Thank you, bro. Amazing video. You just solve my problem with this stuff

    • @robojax
      @robojax  5 лет назад

      You are welcome. Pleased to hear that.

  • @PinheiroEngenharia
    @PinheiroEngenharia 5 лет назад

    Thank you a lot. your video was the best that I found and only your code works for my project. Question: Whats happen If I dont conect INT pin? Sometime the angle Z is decreasing alone, this is my questions. Thanks you man. Congrats, you are a genius

    • @robojax
      @robojax  5 лет назад +1

      You are welcome. INT pin can be left open. see it in datasheet on page 21 www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf

    • @PinheiroEngenharia
      @PinheiroEngenharia 5 лет назад

      @Robojax TKS. I'm going to take off INT. And about angle Z, do You Know why the numer is decreasing?

  • @jameselliott9397
    @jameselliott9397 6 лет назад

    Thanks for you time making this video. What camera are you using for such great closeups? You audio is very low on this video. I rewound a few times to figure out what you said... Maybe you can edit and increase gain.

    • @robojax
      @robojax  6 лет назад

      You are welcome. When I test the video, I have headphone and it sounds good. The problem is once video is uploaded, it is done. can't change it. I will try in future videos. Can you please check my latest video and see if is loud enough?

  • @Muerte_S
    @Muerte_S 5 лет назад

    hello and thanks a lot for your sketch! it works like a charm, but i have a question. How to deal with 180+ problem. For instance i would like to continue storing the angle after i do a 180 degree up to 359. It is possible? I dont know how but in my android phone i tried a gyro sensor test demo and it is possible to continue the rotation up to 360. maybe it should be based on a script like if the prev angle was 179 then continue to add angles bla bla bla? Thanks a lot!

  • @josselindavy4429
    @josselindavy4429 5 лет назад

    Hello, is it possible to connect 2 different gyroscopes with your code ? If yes, should they be connected in parallel or each one on a different input ?

    • @robojax
      @robojax  5 лет назад

      Hi, I haven't tried it but you can get the idea from this video of mine ruclips.net/video/WQ3oFyF5qeY/видео.html

    • @josselindavy4429
      @josselindavy4429 5 лет назад

      thx !

    • @robojax
      @robojax  5 лет назад

      You are welcome.

  • @mr3748
    @mr3748 3 года назад +1

    Good day Robojax... Thanks for your videos, you've help me with a lot projects...Thats also why Ive posted this comment...
    So I have a mpu6050 and I have build a self balancing RC motorcycle, the project is 99% complete, however, the code on the arduino that reads the data form the mpu would freeze the arduino or cause the some weird shit...I am not sure anymore if it is due to interference or even something dodge in the mpu6050 library which I am currently using
    The mpu6050 library I've used is from a guy named Jeff something, he's mpu 6050 code is quite popular...Ill have to search his full name and surname if you want. His code is quite sensitive, if I use a delay() somewhere in my loop() then it bugs out...
    Problem is, his source code to read measurements from the mpu6050 is miles long, confuses me and I had to change stuff in his header files to make it work longer on my Nano (In the beginning I often received a Fifo overflow error). I also have two 3.3k pull up resistors on the SCL and SDA pins
    I am planning to switch out tomorrow his code and library for yours as yours is much shorter...
    MY QUESTION: Have you build something like a self balancing robot with the mpu6050? How sensitive is it to noice and interference from the motors?
    Sometimes after I turn on my motor, the mpu will send random angles to the steering servo. The mpu is not that close to the drive motor of the motorcycle (its about 15cm away)
    Any idees or comments?
    Thanks
    Manie
    Edit: Jeff Rowberg is the name of the guy that created the mpu6050, on the Arduino forum a lot of people mentioned that they've used his library...

    • @robojax
      @robojax  3 года назад

      Hi Manie, You are welcome and thank yo for sharing your thoughts. I have not made any self-balancing robot. I love the idea and it is very interesting project to use control system. But I have full time job and family. Very busy trying to make a living.
      good luck with your projects.

    • @mr3748
      @mr3748 3 года назад

      @@robojax that's cool, I understand👌👌 Thanks anyway and stay safe man👍

  • @thissohil1166
    @thissohil1166 5 лет назад

    What is the price of this sensor in INDIA ? Plz plz help me..

    • @robojax
      @robojax  5 лет назад

      do search on your country's Amazon store. In Canada it is about $14.

  • @nettyvoyager6336
    @nettyvoyager6336 5 лет назад

    so how do you make it balance something like a robot what code would i need for that

    • @robojax
      @robojax  5 лет назад

      that is a big project. search for "balancing robot with mpu-6050"

  • @mr.destructive8554
    @mr.destructive8554 5 лет назад

    Thank you so much. This video was beyond helpful.

    • @robojax
      @robojax  5 лет назад

      you are welcome.

  • @Ben55j
    @Ben55j 4 года назад

    Hello, Thank you for the tuto. I do not succeed to get the acceleration (or speed) along one axe. It seems that we can only get angle values for each axes but not the translations. Can you explain ?

    • @robojax
      @robojax  4 года назад

      Hi, I am not sure what you do different. If you uploaded the code and do not change it, you should get exact result.

  • @pawanyadav2630
    @pawanyadav2630 5 лет назад

    Hello!! This is great help for an MPU 5060. Everything working fine but the angles reads as for X:-90, Y:90, Z:0.
    What could be the possible errors this may be having??
    ThankYou.

    • @robojax
      @robojax  5 лет назад +1

      please check wiring. or disconnect and see what is the reading.

    • @pawanyadav2630
      @pawanyadav2630 5 лет назад

      @@robojaxThnak you for response!! After I replied to the video and before your response to the problem I tried the same setup but found the readings fluctuating and for z: it is going around 1500 or so... same for y and x but below 1000.... even when the MPU was still. In another case I tried I2C scanner for the MPU at a loop of 1sec. It showed 0x68 address and mpu found in first 2 to 3 scans then it said of not founding the same. I think the gyro may be faulty(still have to buy a new one). Or may be there some other technical problem??
      ""Thanks again for your response.

  • @yifengsun4061
    @yifengsun4061 4 года назад

    Really helpful. Thank you. 奥力给

    • @robojax
      @robojax  4 года назад

      You are welcom. 来自加拿大的艾哈迈德

  • @anwarus2659
    @anwarus2659 5 лет назад

    Hello sir! This is great help for an MPU 5060. Everything working fine but the angles reads as for X:0, Y:0, Z:0.
    if i move MPU 5060 it's dosn't change angle.
    What could be the possiblity ?

  • @justeinalagenio8494
    @justeinalagenio8494 3 года назад

    what are the units of the values, is it on degrees, deg/s, and m?

  • @irakliplayz122
    @irakliplayz122 4 года назад +1

    thaaanks for this vid!

    • @robojax
      @robojax  4 года назад

      you are welcome.

  • @monjirulkabir689
    @monjirulkabir689 5 лет назад

    Will it work for NODEMCU too?

  • @Scruffyx56
    @Scruffyx56 Год назад

    can you do a video on how to control a motor with the gyro?

    • @robojax
      @robojax  Год назад

      It needs lots of work and if I don’t get 100k views in a month else it would be huge waste of my time. I know for sure your request is very specific and may be 500 to 700 people watch it. Won’t work and I have already gave up on RUclips. I get Paid $100hour if I work in my own and working on RUclips is $0.20/hour income. Of course this is for robotics. For junk, pranks, smashing iPhone or musics it is totally different. So RUclips is not working as source of income for educators like me.

    • @Scruffyx56
      @Scruffyx56 Год назад

      @@robojax was just a simple request, i seen other youtuber do it already. I just wanted to see it on your channel. since you have given up on youtube, i guess there is no reason on me being a subscriber. thanks for the respons though.

  • @caner8688
    @caner8688 5 лет назад

    thanks for the video but how can i get to know how to use this sensor with IF CODE and servo motor?

    • @robojax
      @robojax  5 лет назад +1

      That you have to do yourself or pay someone. I am very busy to make video on this.

  • @robinwood5833
    @robinwood5833 3 года назад

    A great video, I am wondering if you could help me on my project using this module , I am trying to write code to put in an "if" statement to light up a led when the "X = 45 " on the serial monitor. I have tried all I know but have no success it would be greatly appreciated
    Thank you
    Robin From Australia

    • @robojax
      @robojax  3 года назад +1

      Hi Robin, even is you keep it stationary, the value will fluctuate. 45 " very large value. and your value will not match. so you have to allow tolerance in your reading. On the page where the code is robojax.com/learn/arduino/?vid=robojax-mpu6050-basic if you look at datasheet on page 12 it show the tolerance is 3% . here is my resent video where I was comparing a value and allowed with certain tolerance like 1% or 10% ruclips.net/video/AI-zzmSZVfw/видео.html you have to watch the video in two section. in the introduction I've explained tolerance and how it works and in the code I've explained how it is accomplished. So experiment with % value to find out which value works for you. if you don't' watch it, you wont' understand. so good luck. Greetings from Ahmad from Canada

  • @DynoRC
    @DynoRC 2 года назад

    So helpful

  • @yeonggwangson4996
    @yeonggwangson4996 5 лет назад

    thank you for making this helpful video!!

    • @robojax
      @robojax  5 лет назад

      You are welcome. snag.gy/AHhRpV.jpg

  • @tanmaykaran130
    @tanmaykaran130 2 года назад

    I am trying with the same process and still, my serial monitor is not showing any readings. Can someone please guide me?

    • @robojax
      @robojax  2 года назад

      Please watch this video which is part of the course on serial monitor ruclips.net/video/WyWRGoACWFs/видео.html

  • @maniteja332
    @maniteja332 4 года назад

    Thanks a lot for sharing.Nice Video.

    • @robojax
      @robojax  4 года назад

      Thank you too

  • @yohannesandegergsh8620
    @yohannesandegergsh8620 5 лет назад

    You are awesome! :)

    • @robojax
      @robojax  5 лет назад

      Thank you . So are you.

  • @pratikgauns5091
    @pratikgauns5091 4 года назад

    My code gets stuck when it reaches wire.endtransmission(). what is the solution for that?

    • @robojax
      @robojax  4 года назад

      Please start with new code and use it without modifying it. Once it worked, then modify it.

  • @noeltell932
    @noeltell932 5 лет назад

    Thanks so much! is really useful

    • @robojax
      @robojax  5 лет назад

      You are welcome.

  • @muhammadmahsheedali7911
    @muhammadmahsheedali7911 5 лет назад

    Hi, the module is giving accurate results of gyro angles and gyro accelerations, but I could not get acceleration values in X, Y and Z direction. Can you please help me find the possible errors?

    • @robojax
      @robojax  5 лет назад

      Assalamu alaikum Muhammad, I am not sure what could be the issue. You would have to move it to see acceleration. If you haven't modified the code, you should see it. Very rarely possible that the module be bad.

    • @muhammadmahsheedali7911
      @muhammadmahsheedali7911 5 лет назад

      @@robojax Wasalam. Thank you for your reply. I have changed the module as well, but unfortunately I didn't provide me linear acceleration. It only shows angular acceleration. Also I have not changed the code. Also I am expecting linear acceleration from the variables accX, accY, accZ.

    • @muhammadmahsheedali7911
      @muhammadmahsheedali7911 5 лет назад

      Are you available?

  • @chrisleech1565
    @chrisleech1565 5 лет назад +1

    Wonderful. I have a great application for this. But it would be nice to graph in the dynamic sense. Or do a sample of say a given time period ( a sew seconds only) and be able to zoom in on the time line.
    The tiny brushless motors used in mini quads can be out of balance. Spinning at ~ 25,000 RPM any problems with balance can just obliterate the onboard Gyro/ Accel with many multiples of the 1st Harmonic(often a 6050, but also the ICM 20602 is used)
    The size of the GY521 breakout makes sense for these tight places Maybe even with the I will be able to get a handle on where to place my tape on the bell of the motor with out losing my patience and just buying more expensive.
    I can't thank you enough for publishing this and the Github link and I can't wait to fool around with the code! Happy New Year. Regards, CGL

    • @robojax
      @robojax  5 лет назад

      You are welcome Chris, I am glad you found this useful. Thank you for your kind and nice comment. Ahmad

  • @yogeshitaliya473
    @yogeshitaliya473 6 лет назад

    Nice one again sir

  • @treverbelmont8393
    @treverbelmont8393 Год назад

    I have a question .
    how exactly can the aceleromiter have a different angle than the gyroscope shouldnt they be the same angle

    • @robojax
      @robojax  Год назад

      gyroscope is use to get orientation in X, Y, Z coordinate (up, down, left right and around axis). but accelerometer. is for motion (speed) in specific direction. so angle and acceleration are two different thing.

    • @treverbelmont8393
      @treverbelmont8393 Год назад

      @@robojax I am talking about how you have 2 angles one for acceleration and another for the gyro because if the gyroscope measures acceleration wouldn't that be the angle that it is at not some gyroAngle

    • @robojax
      @robojax  Год назад

      you gotta hold an object like pen in 3d space and try to understand. each has has its own reference and angle.

    • @treverbelmont8393
      @treverbelmont8393 Год назад

      @@robojax ok. Thank you

  • @user-fi9rh1eq7v
    @user-fi9rh1eq7v 4 года назад

    Hi, i'm dont know much about Arduino, neither speak english, but you video help me a lot.
    But i still don't understand about, on the serial monitor, minute 12:29 for example, you have accX, accY, accZ and their respectives values. Same for Gyro. i would like to know what are these values about since the angles of both gyroscope e accelerometer are given in accAngleX... and accGyroX.
    And Angle X, Angle y, Angle z, on the last part, those referenced at the angles of what ?.
    If you answer i would be grateful.

    • @robojax
      @robojax  4 года назад +1

      Hello, I have spent a lot of time typing the subtitle. Watch it with subtitle . I believe we have over 50 languages.

    • @user-fi9rh1eq7v
      @user-fi9rh1eq7v 4 года назад

      @@robojax Thank You !

  • @almirbajsini
    @almirbajsini 4 года назад +1

    how long do i let the code run for it to be calebrated

    • @nettyvoyager6336
      @nettyvoyager6336 4 года назад

      forever lol

    • @almirbajsini
      @almirbajsini 4 года назад

      @@nettyvoyager6336 is it like instant or something?

    • @robojax
      @robojax  4 года назад

      I have not tested it and don't know.

  • @yashwadaskar7595
    @yashwadaskar7595 5 лет назад

    Really informative

    • @robojax
      @robojax  5 лет назад

      I am glad you liked it. Thanks.

  • @muhammadshifa4886
    @muhammadshifa4886 4 года назад

    Thanks Sir! That's very informative tut.. Please sir guide me how can we set the code for Two MPU6050 Sensor, means how can we set the address for another MPU6050. Thanks Sir

    • @robojax
      @robojax  4 года назад +1

      So you want to use, two of the same module? if so I have no answer for that.

    • @muhammadshifa4886
      @muhammadshifa4886 4 года назад

      @@robojax A lot thanks sir... I have done it..

    • @ovonjohn
      @ovonjohn 4 года назад

      How? I am having the same problem. I will be happy if u could help please

  • @andrewhazelbaker4142
    @andrewhazelbaker4142 5 лет назад

    Thank you very much

  • @djmarck22
    @djmarck22 5 лет назад

    The function GETACCX, GETACCY, GETACCZ returns you the value of aceleration in m/s2?

    • @neds95
      @neds95 5 лет назад

      No, it is in G
      1 g is about 9.81 m/s^2

    • @djmarck22
      @djmarck22 5 лет назад

      Can you help with the MPU library? I can not start the calibration mode in my mpu..... By the way my email is marcoaurelio_19@hotmail.com. I will appreciate so much if you can help me.

  • @manishpingale6558
    @manishpingale6558 3 года назад

    Hello sir!
    How can I get the value in m/s*s instead of 'g'

    • @robojax
      @robojax  3 года назад

      Convert it , get the formula and convert it using simple math.

  • @7ihatemath7
    @7ihatemath7 5 лет назад

    How can connect two mpu6050s together with this library? For some reason i cant get my code to work..what do i need to modify in the library to get two imus to work together?

    • @robojax
      @robojax  5 лет назад

      I spent 2 or 3 days and it did not work. It seems we need different library so it can work with multiple modules. If I get a chance, I will write library but not in the near future.

    • @7ihatemath7
      @7ihatemath7 5 лет назад

      @@robojaxohh i see. Im probably going to have to use more than one arduino uno then. Thanks anyways...your help was appreciated!!

    • @robojax
      @robojax  5 лет назад

      You are welcome.

  • @NIK7A
    @NIK7A 5 лет назад

    Hi sir,
    Can I use this sensor to engage a servo if an angle detected on x or y axis (e.g over 60 degrees)
    Could you help me please?
    Thank you in advance!

    • @robojax
      @robojax  5 лет назад

      yes you can. Try this to print value on serial monitor with if condition. Once it worked, then use servo.

    • @mr.destructive8554
      @mr.destructive8554 5 лет назад

      you can do it with a 180 degree servo

  • @1294ast
    @1294ast 5 лет назад

    If you use a second accelerometer, How is going to be the wire connection for the second accelerometer?

    • @robojax
      @robojax  5 лет назад

      You can use the exact principle in this video that uses two LED display. Apply it to the MPU-6050 ruclips.net/video/27KjMfPH1dk/видео.html

    • @dimpalpatil365
      @dimpalpatil365 5 лет назад

      @@robojax can you please specify how to use SDA & ADo pin for both the accelerometer

  • @jamescullins2709
    @jamescullins2709 Год назад

    Can you get the speed of motion with this device?

    • @robojax
      @robojax  Год назад +1

      Yes this is exactly it is made for.

    • @jamescullins2709
      @jamescullins2709 Год назад

      @@robojax Of course...daaa! Thanks

  • @fahadraza7152
    @fahadraza7152 3 года назад

    what we get when connect XDA and XCL?

    • @robojax
      @robojax  3 года назад +1

      It is just to connect two of this module. Auxiliary pins.

    • @fahadraza7152
      @fahadraza7152 3 года назад

      @@robojax ok....sir one more thing can I calculate still position of a human through this sensor and how I can do this...any idea

  • @x.ali.wq0
    @x.ali.wq0 4 года назад

    Thank you...

    • @robojax
      @robojax  4 года назад

      You are welcome.

  • @au313
    @au313 Год назад

    So, it can't start at any angle and read that angle.

    • @robojax
      @robojax  Год назад

      When it starts from any position that is your reference and it would be zero. You then calculate from that point. Of course you can write your own code with some action or push buttons so it can initialized from new reference point.

  • @hvincent1106
    @hvincent1106 4 года назад

    Hmmm the wiring is a bit unclear. Could you help explain more on it?

    • @robojax
      @robojax  4 года назад

      I just watched the video and I have not left out anything in wiring. You need to listen carefully. You can't jump or skip to watch it quickly. to understand the wiring, you should have watched the beginning of the video where I explained the hardware and all pins.

    • @hvincent1106
      @hvincent1106 4 года назад +1

      @@robojax Hey! Thank you very much for replying and making such a good video! Sorry i think you misunderstood me, what i meant was that the wiring was well explained, however I was confused with some of the connections that you explained. And also, I actually watched the whole video 5 times just to make sure i understand the whole process.
      I hope you could help confirm if im doing the connection right. My connection is as follows :
      (Arduino Uno)->MPU6050
      5V->Vcc
      Gnd->Gnd
      SCL->SCL
      SDA->SDA
      Now this is where I get a bit confused,
      For default settings i connected the following:
      A4->XDA
      A5->XCL
      (No Connection)->ADO
      Digital Pin 2>Int
      IS that correct?

    • @hvincent1106
      @hvincent1106 4 года назад

      @@robojax hi jax, I redid the wiring and i found that the problem was a faulty wire and not the connection! It seems a loose or bad connection will cause the program to stop immediately.
      I have a problem though that i hope you could help with. its mainly due to the IMU drift. I see the value slowly drift upwards when idle at times and sometimes it hovers up and down at a a set value.
      Is there any way to help improve this?

  • @abdelkarimharabi3164
    @abdelkarimharabi3164 5 лет назад +1

    i can do that by esp32 ??

  • @sylsgn2966
    @sylsgn2966 5 лет назад +1

    great video but the code is not working !
    Am I the only one ?

    • @robojax
      @robojax  5 лет назад

      It should work. You must download the provided library and code.

  • @anirudhmk1798
    @anirudhmk1798 5 лет назад

    How can I connect this to Arduino Uno........plz provide pin connection with a diagram

    • @robojax
      @robojax  5 лет назад

      I have explained it. Watch the video.

    • @narcisoneto2203
      @narcisoneto2203 5 лет назад

      analogic 4 = sda
      analogic 5 = scl

  • @zacharyrgarlett9636
    @zacharyrgarlett9636 5 лет назад

    I cannot understand where you plug it into the arduino board

    • @robojax
      @robojax  5 лет назад

      I am sorry i misread you comments. I have explained the wiring at 06:44 (click on 06:44 to see it)

  • @muhammadaqib0336
    @muhammadaqib0336 4 года назад

    Led of the mpu6050 is not getting on

    • @robojax
      @robojax  4 года назад

      is this a question or statement?

    • @muhammadaqib0336
      @muhammadaqib0336 4 года назад

      Question because led of my module not getting on

  • @DrLuc-lq8ls
    @DrLuc-lq8ls 5 лет назад

    How can I change from 2g to 8g or 16g?

    • @robojax
      @robojax  5 лет назад

      Hi,
      In MPU6050_tockn.cpp line 12 shown here github.com/tockn/MPU6050_tockn/blob/master/src/MPU6050_tockn.cpp
      writeMPU6050(MPU6050_ACCEL_CONFIG, 0x00); selected 2g now. Change it as you desire.
      0x00 ±2g (this is set now.)
      0x01 ±4g
      0x02 ±8g
      0x03 ±16g
      Here is how I found them
      In page 15 www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Register-Map1.pdf
      ACCEL_CONFIG Bit 3 and 4 in Register 0x1c or 28 (decimal)
      In line 11 in header file shows the address 0x1c:
      github.com/tockn/MPU6050_tockn/blob/master/src/MPU6050_tockn.h

    • @robojax
      @robojax  5 лет назад

      ? never heard from you

    • @DrLuc-lq8ls
      @DrLuc-lq8ls 5 лет назад

      @@robojax Oh sry RUclips did not notificate me that you answered me. Sadly this doesnt help ... Still only 2g.

  • @ichall2363
    @ichall2363 4 года назад

    why my MPU 6050 just read 90 degree angle?

    • @robojax
      @robojax  4 года назад

      move it or rotate it. Perhaps you are keeping in the same axis. This is strange.

    • @ichall2363
      @ichall2363 4 года назад

      @@robojax oh no, it just read x -90 , y 90, and z 0. I have rotate it, but the result is same. How? You have a solution?

  • @mr.destructive8554
    @mr.destructive8554 5 лет назад

    Is that Java? Is there any way I can use Python?

    • @robojax
      @robojax  5 лет назад

      the code is written for Arduino and it is in C, yes you can write it for Python, but you have to convert everything including the classes in the library.

    • @mr.destructive8554
      @mr.destructive8554 5 лет назад

      Robojax thanks

  • @netbroadnb6896
    @netbroadnb6896 5 лет назад

    how to download library linlk plz?

    • @robojax
      @robojax  5 лет назад

      Under the video there is description box. I have links for the code and library.

  • @dhavalghaghada4490
    @dhavalghaghada4490 5 лет назад

    i gets only 0's in output of all data

    • @robojax
      @robojax  5 лет назад

      Either the code has changed when you copied or wiring is incorrect. Try to copy and paste the code

    • @mikebrown7366
      @mikebrown7366 5 лет назад

      Some modules pull AD0 high, some pull it low. It sets the slave address to 67 or 68. Try using the other address in the code.

  • @nettyvoyager6336
    @nettyvoyager6336 5 лет назад

    i have two of these devices

    • @SH-vv7zq
      @SH-vv7zq 4 года назад

      I have three and a half devices.

    • @nettyvoyager6336
      @nettyvoyager6336 4 года назад

      @@SH-vv7zq half lol what happened ?

    • @SH-vv7zq
      @SH-vv7zq 4 года назад +1

      @@nettyvoyager6336 Well, they only supplied the x-axis and half the y-axis this shipping - the other half of the y-axis and the z-axis are being shipped when the store receives them. I'm just gonna have to make do for now.

    • @nettyvoyager6336
      @nettyvoyager6336 4 года назад

      @@SH-vv7zq bloody china again it takes a good month from them even though they are efficient but yeah i just ran out of can for my project its a robot

    • @robojax
      @robojax  4 года назад

      I should have a box to test then.

  • @rohanbapna3084
    @rohanbapna3084 5 лет назад +1

    7:35 xDD

  • @vishaltirkey8788
    @vishaltirkey8788 5 лет назад

    One dislike for xcl and xda

    • @robojax
      @robojax  5 лет назад

      Thank you very much.

  • @luiscremonini3635
    @luiscremonini3635 5 лет назад

    It is useless. too many commercial advertisement and too few details

    • @robojax
      @robojax  5 лет назад

      If you don't like the commercial, you can purchase RUclips premium and watch it commercial free. For the details please see the video rating. Thank you.

  • @distortedfocus7698
    @distortedfocus7698 6 лет назад +1

    This video is why I struggle s much. You just totally skipped over the ADO pin and you weren't very clear at all with the the XDA AND XCL mess either...

    • @robojax
      @robojax  6 лет назад

      those were not of our concern. I have provided the link to datasheet in the same page where Arduino code is. See the description.

    • @AydinGokce9000
      @AydinGokce9000 5 лет назад

      They're not really necessary for his purpose

    • @mr.destructive8554
      @mr.destructive8554 5 лет назад +1

      He isn't really unclear-- it takes some common sense of yourself to figure out.

  • @UBayy
    @UBayy 4 года назад

    ABIS MAKE YA LO. NGOMONG LEMES AMAT AJG

    • @robojax
      @robojax  4 года назад

      maaf saya tidak mengerti apa yang kamu katakan

  • @nikiamz6501
    @nikiamz6501 6 лет назад

    Why you speak so quiet

    • @robojax
      @robojax  6 лет назад

      It might have been recorded low. I am using headphone to listen and it sounds fine. You could just turn the volume up. I will try to boost the volume in my upcoming videos.

    • @nikiamz6501
      @nikiamz6501 6 лет назад

      @@robojax ok thanks:)