Це відео не доступне.
Перепрошуємо.

How to use MPU-9250 Gyroscope, Accelerometer, Magnetometer for Arduino

Поділитися
Вставка
  • Опубліковано 18 сер 2024

КОМЕНТАРІ • 296

  • @cdiddy536
    @cdiddy536 5 років тому +9

    Great video!! You've saved me so much time in ten minutes! I'm just a hobbiest but I appreciate your effort to explain this wonderful chip. You clearly know it very well, so thanks for taking the time to learn it, and post a really high quality video..

    • @robojax
      @robojax  5 років тому +4

      You are welcome and thank you for your kind comment. I am glad you found it useful.

  • @ThornStarR98x_blackheart
    @ThornStarR98x_blackheart 3 роки тому +1

    Once again thank you for the tutorial..
    Previously the AOD4184 tutorial was a boost to my project and now this one...
    Hope that you'll update something on 3axis PID and calibration too...
    Edit 2: Finally I could buy the item after 2yrs..
    Also I'm very glad I joined your channel, very informative and educational.

  • @physicsguy9774
    @physicsguy9774 2 роки тому +1

    Great job mate! Very good demonastration , you explained everything perfect.

    • @robojax
      @robojax  2 роки тому +1

      Pleased to know. Cheers

  • @james-m-8285
    @james-m-8285 Рік тому

    You're incredible dude, you saved me sooooo much datasheet scouring

  • @GuitarLucius
    @GuitarLucius Рік тому

    Wow, thanks for everything. This is a very useful video! well done sir. Cheers, Lucius

  • @1oveToLose
    @1oveToLose 3 роки тому +1

    best IMU video thanks, sooo basic

    • @robojax
      @robojax  3 роки тому

      You are welcome. Please subscribe. I appreciate it and helps my channel grow. Thank you

  • @lehemsgrnd6867
    @lehemsgrnd6867 5 місяців тому

    Beklager så mye her ble det mye overvåkning😮

    • @robojax
      @robojax  5 місяців тому

      Videoene mine er for læring.

  • @ronnelcacho3336
    @ronnelcacho3336 4 роки тому +2

    thank you sir you explained well.

    • @robojax
      @robojax  4 роки тому

      You are welcome.

  • @walterblanc9708
    @walterblanc9708 Рік тому

    Excellent Video.

  • @arezoomotlagh
    @arezoomotlagh 5 років тому

    Amazing! Amazing! ... You saved my life...thank you so much

    • @robojax
      @robojax  5 років тому

      You are welcome. Khoshhalam ke moshkile tan hal shod. Ahmad from Canada. موفق باشید

    • @arezoomotlagh
      @arezoomotlagh 5 років тому

      @@robojax wow!!!!!! you're Irainian متشکرم وهمچنین شما هم موفق باشید:))

  • @progresstechindustries1262
    @progresstechindustries1262 3 роки тому +2

    Thanks for the video. I got the following error message:
    IMU initialization unsuccessful
    Check IMU wiring or try cycling power
    Status: -5
    What do I have to do?

    • @robojax
      @robojax  3 роки тому

      it clearly says "check wiring"

    • @ocsner5687
      @ocsner5687 3 роки тому

      I have the same issue, did you solve it? my wires are perfectly connected to the Arduino and the i2c_scanner says "I2C device found ... 0x68" so I think that my imu is working, please I need help :/

    • @ocsner5687
      @ocsner5687 3 роки тому

      you have to ground AD0 !

    • @rahmatr8324
      @rahmatr8324 2 роки тому

      @@ocsner5687 have you solved it?

    • @rahmatr8324
      @rahmatr8324 2 роки тому +1

      @@ocsner5687 i've connected ADO to GND, but get the same message

  • @shamssalehin2376
    @shamssalehin2376 Місяць тому

    9250 device id at who i am register is 0x71, for 6500 it is 0x68 also can be 0x69 upon pulling up AD0 pin

  • @robertfisher8964
    @robertfisher8964 Рік тому +1

    I have a project that needs an accelerometer/gyro to be implemented. I am not an engineer. Can I offer to hire you to work on my project with me ?

  • @shivpat6522
    @shivpat6522 5 місяців тому

    Hi. Thank you making this very descriptive Tutorial! I have a question regarding this sensor. I want to make a PID algorithm for my robot using this sensor in order to prevent the robot from drifting away and letting it maintain a straight angle while moving forward. Do you mind teaching me about PID for this?

  • @Lunatyczka12345
    @Lunatyczka12345 4 роки тому +3

    You are a great teacher. Thank you for this video. However, I have a question, should the magnetometer be in one position or rotate it during calibrating. I've already written the code but I can't calibrate correctly. Best wishes Ania

    • @robojax
      @robojax  4 роки тому

      You are welcome. that is very kind of you. During the calibration you should not move it at all.

  • @usrrsr
    @usrrsr 11 місяців тому

    Gr8 but use serial plotter instead of text output

  • @denisgolobokov3041
    @denisgolobokov3041 4 роки тому +1

    Thanks so mush!

    • @robojax
      @robojax  4 роки тому

      You are welcome.

  • @rikibo1677
    @rikibo1677 3 роки тому

    Thank you very much

    • @robojax
      @robojax  3 роки тому

      You are welcome. Please subscribe. I appreciate it and helps my channel grow. Thank you

  • @tranhoang3444
    @tranhoang3444 4 роки тому +1

    Can you help me / I have a problem:
    IMU unsuccessful initialization
    Check IMU wiring or try cycling power
    Status: -5
    I looked at the code in the library, it seems that Check WHO_I_AM has an error.

    • @robojax
      @robojax  4 роки тому

      Hi, Search for "-5" in the library here github.com/bolderflight/MPU9250/blob/master/src/MPU9250.cpp and you will find multiple reasons.

  • @thunderbonqueqe2730
    @thunderbonqueqe2730 5 років тому

    Great Video!

  • @daviesheerin6736
    @daviesheerin6736 5 років тому

    Awesome, thanks.

    • @robojax
      @robojax  5 років тому

      You are welcome.

  • @MrRasmushanghoj
    @MrRasmushanghoj 5 років тому

    Really love this mate, very good explanation. Can you maybe tell me how you access and write to the different registers, to select modes for the different sensors in the chips?
    Thanks anyways for the video, and you're good at explaining yourself in english, probs for that!

    • @robojax
      @robojax  5 років тому +1

      Thank you very much. I love you too. For the register reading, the library is facilitating it. The file MPU9250.h and MPU9250.cpp located github.com/bolderflight/MPU9250/blob/master/src/MPU9250.h uses registers List of registers www.invensense.com/wp-content/uploads/2017/11/RM-MPU-9250A-00-v1.6.pdf .
      the main function(method) that makes the reading is in line 1004 in here github.com/bolderflight/MPU9250/blob/master/src/MPU9250.cpp

  • @stlo0309
    @stlo0309 3 роки тому +1

    my accelerometer & gyroscope are working fine, but magnetometer output is just 0.0000 for all three axes. It isn't changing whether I tilt it/bring a magnet near it or whatever. Do you have any idea what could be the problem? Only the Magnetic readings are 0.00 like this, the accelerometer & gyro readings are fine tho

  • @alisan8979
    @alisan8979 6 років тому

    thank you bro you are awesome

    • @robojax
      @robojax  6 років тому

      You are welcome. so do you.

  • @thiagosantiago6552
    @thiagosantiago6552 4 роки тому

    Beautifully explained! Congrats, pal! Could you please put some light on the usage of the FSYNC pin? I need to place 4 modules on different parts of a human body in order to measure the relative accelerations between them (e.g. arm vs forearm, forearm vs hand and arm vs hand). So, I would like to know if the FSYNC pin can be used in order to put the 4 modules to yield synchronized measurements.

    • @robojax
      @robojax  4 роки тому

      Thank you. The FSYNC is : Frame synchronization digital input. Connect to GND if unused. Please see datasheet www.invensense.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf

  • @taif7072
    @taif7072 Рік тому

    Thank you for this video .
    Can you tell me how I can calculate the range of motion by using the results of MPU9250 ?
    I am working in my project but I have a problem to calculate the range of motion …
    My project is Design and implementation of sensor based system for hand function assessment and analysis..
    Please help me 😊

  • @francoisguyot789
    @francoisguyot789 5 років тому +1

    Can I use the MPU9250 compass to place a setpoint and make the board showing this point ?

    • @robojax
      @robojax  5 років тому

      I am not sure sorry.

  • @ImSyed109
    @ImSyed109 3 роки тому

    please make a video on how to calibrate the accelerometers, gyroscopes and magnetometers

    • @robojax
      @robojax  3 роки тому

      Thanks for the suggestion. I will see if time permit, I will do it.

  • @DuncIsAwesome
    @DuncIsAwesome 3 роки тому +1

    Hey, I need help, I am getting the status of -5, and it's not working. I have very little knowledge of how this works and can not seem to figure out how to fix this

    • @robojax
      @robojax  3 роки тому

      Check wiring. It does not find the module , either bad wiring or dead module

    • @DuncIsAwesome
      @DuncIsAwesome 3 роки тому +1

      @@robojax I have checked the wiring and have tried 2 different boards and still get -5

    • @danieldelrey8391
      @danieldelrey8391 2 роки тому

      @@DuncIsAwesome I also have the same issue, i already ground the AD0, also FSYNC but nothing. I will check if I soldered the sensor properly. I also bought a new one.

  • @andrewlazar9245
    @andrewlazar9245 5 років тому

    This was a fantastic demo. I want to use a magnetometer for the measurement of a delta in any direction to essentially detect movement of x mm. Is the 9250 more than I need ? Is there a magnetometer on a board or shield for the Uno that would be enough ? or even a Hall effect sensor with the ability to quantify distance ?

  • @francoisguyot789
    @francoisguyot789 5 років тому

    Ok, now it's working. I bought a more expensive module. I get all the data, but the gyro and magnetometer don't seems to give me the right values... Excepted for the accelerometer and the thermometer
    Can I get these values in degrees ?

    • @robojax
      @robojax  4 роки тому

      I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊
      The gyroscope values are in degrees.

  • @omarvelasco2329
    @omarvelasco2329 4 роки тому

    Very well explained, however I have a question, how to convert the angle into degrees? I need to know the position of the steering wheel of a car

    • @robojax
      @robojax  4 роки тому

      1Rad × 180/π = 57.296Deg so whatever value you have multiply it by 57.296 to get degree.

  • @Ashley-mn2fz
    @Ashley-mn2fz 4 роки тому

    good job bro

    • @robojax
      @robojax  4 роки тому

      Thanks for the visit

  • @daniyalrazakazmi7249
    @daniyalrazakazmi7249 Рік тому

    Great Video!
    I have a question: I have BMP280 and MPU9250 Sensors. I need them to connect to Arduino UNO. Both the sensors use SDA/SCL pins. How can I integrate both the sensors with Arduino?

    • @robojax
      @robojax  Рік тому

      Just connect them together. You can connect 128 devices in parallel to I2C

  • @tejasmarkande8342
    @tejasmarkande8342 5 років тому

    Nicely explained !!! Could you please tell me how to calculate tilt angle from the mG values that you are calculating?

    • @robojax
      @robojax  5 років тому +1

      it is in 3D space. All X, Y and Z are involved in tile. Pick a point of reference and then calculate. This hard to explain with text. You can use Sketchup to imagine and work on it.

  • @sameqy
    @sameqy 5 років тому +1

    Hi, thank you very much. I much appreciate the demo.
    My question is when the data is being outputted from the MPU-9250 and the data being sent in bits. Where does it say in the data sheet which bit is which so for example is the first 3 bit in the 10-bit data the accelerometer data?

    • @robojax
      @robojax  5 років тому +2

      your question needs another video, but in this file github.com/bolderflight/MPU9250/blob/master/src/MPU9250.h from line 196 to 223 you will see constants taken from Register map. You will see the register's name. Here is register map www.invensense.com/wp-content/uploads/2015/02/RM-MPU-9250A-00-v1.6.pdf I have just included this link to the page where you would find the code.

    • @sameqy
      @sameqy 5 років тому

      @@robojax Amazing! Thanks for the help!

  • @yindigo7826
    @yindigo7826 4 роки тому

    Thank u for the great explaination. I hav hard time understanding the sensor. Just a question, the gyroscope value shown fluctuate a lot, is there anyway to stabilize the value?

    • @robojax
      @robojax  4 роки тому +1

      you are welcome. its very accurate and it is normal to fluctuate. you should get the average of 300 or 1000 measurement. Also you might need angle in degree but it shows 0.001° so round it or divide it to so you get 0.1°

  • @nazmussakibakash4110
    @nazmussakibakash4110 4 роки тому

    A very useful tutorial. one question how do I calibrate the sensor?

    • @robojax
      @robojax  4 роки тому

      please check the library. there is a function for that.

    • @Yonggie97
      @Yonggie97 3 роки тому

      @@robojax are you referring to int calibrateGyro()? if so, how do i use it? Do I just call it once in void setup or void loop?

  • @FPChris
    @FPChris 4 роки тому

    I was hoping to see yaw pitch roll examples. Especially z drift correct with the magnetometer. :(

    • @robojax
      @robojax  4 роки тому

      this is general explanation. if you want to use it for airplane or drone, then you need to spend some times to make it work.

  • @aaronhale4444
    @aaronhale4444 6 років тому +2

    This is awesome, thanks for sharing. I am able to get the output as instructed.
    Have you tried putting the magnetometer values into degrees? I actually want to get the direction 0-360 that my MPU-9250 is pointed towards.
    I tried looking it up myself and found to use:
    float Pi = 3.14159;
    float heading = (atan2(IMU.getMagY_uT(),IMU.getMagX_uT()) * (180/Pi));
    if (heading == 0){
    return;
    }
    if (heading < 0){
    heading = heading + 360;
    }
    But.. this is not working for me.. as I move my MPU around it only gives values between 30-80..
    If you haven't done this that is fine. I've just been struggling with this for a while now and thought you might have done this.
    Thanks

  • @domenikamedina2225
    @domenikamedina2225 3 роки тому +1

    Hi! great video!! But I have a problem with the compilation of the code, the program does not throw any error but when compiling it, it gives me something like an encrypted text, could you help me?

    • @robojax
      @robojax  3 роки тому

      when it comes to error, please provide the error so other read and help you.

  • @radiog7413
    @radiog7413 5 років тому

    Beautiful tutorial, clear and operational. Do you have the project to add the display of a tilt-compensated compass? I need to link two Gps waypoints on my Gps / Compass autopilot raft project.

    • @robojax
      @robojax  5 років тому

      Thank you. I just put on my "to do" list. But I have another video similar to what you are looking for ua-cam.com/video/uIz6WIis4dc/v-deo.html

    • @radiog7413
      @radiog7413 5 років тому

      Ok, I previously tested the 6050, but it is less reliable, I would prefer to use the 9250.

  • @jackhaehl2033
    @jackhaehl2033 4 роки тому

    Thank you for this! You're a lifesaver, but i was wondering. I need to use four of these at once for a school project, but this cannot be done with i2C. I have read that I should use SPI for this purpose, but how do you wire this sensor for SPI use?

    • @robojax
      @robojax  4 роки тому

      You are welcome. I have not tested with SPI but if you search for SPI version of library you might find it. Thank you for not skipping the ads and keep watching them. This will help me a lot.

    • @jackhaehl2033
      @jackhaehl2033 4 роки тому

      @@robojax Hello! I found the SPI instructions on the library, but thanks for the response!

  • @LuisGonzalez-hh1zq
    @LuisGonzalez-hh1zq Рік тому

    Great video man but why I have this error: IMU initialization unsuccessful I mean I don´t know what it is, I don´t know if I warmed it too much when I soldered the pins ;(

    • @robojax
      @robojax  Рік тому

      it could be the wiring. check them again and again.

  • @lluvianaomycarmonaavendano9327
    @lluvianaomycarmonaavendano9327 2 роки тому

    My serial monitor only says this:
    IMU initialization unsuccessful
    Check IMU wiring or try cycling power
    Status: -5
    Any ideas? ):

    • @robojax
      @robojax  2 роки тому

      have you run the I2C scanner? it you run it successfully and all wiring is good, the scanner should print the I2C address on the serial monitor. The I2C scanner is located here robojax.com/learn/arduino/?vid=robojax-I2C-scanner

  • @t.n.1056
    @t.n.1056 4 роки тому

    Hello, I've a question: is the value of the compass accurate ? Do the values changes from time to time, or are these stady and stable ?

    • @robojax
      @robojax  4 роки тому

      hello, I have provided the datasheet. Your question is very tricky. it is called divation over time. So it should be on datasheet.

  • @ashishjain5524
    @ashishjain5524 2 роки тому

    great video ... i m getting acceleration and gyrometer value but my magnetometer value is always zero so please help me in this regards.

  • @prathameshkhandekar5553
    @prathameshkhandekar5553 4 роки тому

    Really helpful demo!! I do have one question, can I get distance measurements using MPU9250?? One of my projects involve calculating the distance travelled (in x and y direction) with reference to a fixed value.

    • @robojax
      @robojax  4 роки тому +1

      Thank you. You may use it with other means to get accurate measurement. See this page: www.researchgate.net/post/Calculating_Speed_and_Distance_from_a_3-axis_accelerometer

  • @iliqnew
    @iliqnew 5 років тому +3

    hi there! i get this H⸮⸮⸮Z6⸮ kind of symbols when iconnect everything. Please help!

    • @robojax
      @robojax  5 років тому +9

      set the serial monitor baud rate. in Serial.begin(9600), 9600 is the baud rate, make sure your serial monitor is set to same value. (it is in the lower right corner of serial monitor).

  • @The3bad3
    @The3bad3 3 роки тому

    This may be an incredibly silly question but do you absolutely need to solder the pinhead to the chip ? I tried putting the pinhead thorugh the chip and through a breadboard to make it fixed in place and I couldn't get the chip to work no matter what I tried.

    • @robojax
      @robojax  3 роки тому +1

      No question is silly. No you don’t. Just solder the wires directly on the board.

  • @ezealegre5060
    @ezealegre5060 6 років тому

    THANKS MAN. YOU HAVE A NEW SUBSCRIBER
    I hope you can help me. I am doing a project with this accelerometer and I would like to know:
    1- the ADO pin is input, output or bidiraccional? I saw that you connect it to 5V.
    2- FSYNC how does it work? To use it as in your example, should I connect it to GND?

    • @robojax
      @robojax  6 років тому +1

      You are welcome.
      1-On the datasheet (in the same page as other resources) page 12 shows ADO is just address selector.
      2-FSYNC is Frame synchronization digital input which can be used to synchronise with other data or system. page 18. I have not used it with other data or system so I don't know about it.

  • @alexandrugroza839
    @alexandrugroza839 3 роки тому

    hello, i have the same module as this one and i tried different codes for it but i don't get any output change on the magnetotmeter, when i rotate it around the x,y,z axis a get and an output change on the accelerometer but i only have to shake the module along those axis to get an output bigger than 1 / -1 on the magnetometer in rest it is under -0.00 always
    Acceleration -1.300 2.095 -8.634
    Gyrosvope -0.042 -0.042 -0.042
    Magnetometer 44.918 29.959 5.411
    and if it is possible i would like to use it to determine the rotation angle in degrees not the number from 0 to 8

  • @Marchel0522
    @Marchel0522 4 роки тому

    Hello, thank you for the video, it's amazingly clear and useful.
    I just have one problem. When I run the I2C scanner code with both my arduino UNO and the MPU-9250 properly connected and then open Tools > serie monitor, I can only see this:
    "I2C Scanner
    Scanning..."
    And no matter how long I wait, it doesn't say anything more... it doesn't say "no I2C device found" nor those lines that appear on the video.
    If you can help me to find out what's the problem, I would be immensely thankful.

    • @robojax
      @robojax  4 роки тому +1

      Hello and you are welcome. I am not sure why it does that. if you are trying A4 and A5, try the pins on the other side close to pin 13. You should have SDA and SCL pins. Also check the wiring again.

    • @Marchel0522
      @Marchel0522 4 роки тому

      @@robojax I already located the problem, the MPU-9250 male-male coupler was making false contact. Soldering the part fixed it. Thank you very much anyway!

  • @MegaBombLetsplay
    @MegaBombLetsplay 2 роки тому

    Hi, i have trouble with SPI connection this module to board Arduino mega 2560 becouse of small sample rate. I do lot of search on the internet, but all codes and libraries are not working for me. Do you have any idea what can i do? Dont you have any tutorial? Its for my Bachelor thesis where i need messure acceleration and gyro only with the sample rate about 1-2ksps. Thank for any help and apologise for my bad english :)

  • @physicsguy9774
    @physicsguy9774 2 роки тому

    I tried to use the code but it gives me the error : No matching function for call to 'MPU9250_::MPU9250_(TwoWire&,int)' , do you have any ideas?

  • @gautiervasse2859
    @gautiervasse2859 4 роки тому

    How can I make a compass, and the serial monitor print degrees ? Please help me, that for a project...
    (sorry for the spelling, I'm french : )

    • @robojax
      @robojax  4 роки тому

      making compass is a complete project and I have to make a video if time permit.

  • @hariprasath4883
    @hariprasath4883 4 роки тому

    Thanks for the video. I have a question? what i should change to get the gyro data in degrees? and also i need the value to be maintained in its new position.
    Pls help!!!

    • @robojax
      @robojax  4 роки тому +1

      get the value and use Radian to degree formula 1° = π/180° = 0.005555556π so multiply the value you are getting in radian by 0.0174533 and this is not exact.

    • @hariprasath4883
      @hariprasath4883 4 роки тому

      @@robojax thanks for your reply. After rotation about the z axis(gyroZ) there is a reflection in the value but soon it becomes 0 (it attains the new place as the basic position). How to make the reflective value to be fixed in the new position???

  • @khanswat6745
    @khanswat6745 Рік тому

    Hi thank you so much really appreciated.
    My question ia that once i compile the code of i2c_scanner so after compilation it gives me error that '#include no such file or directory ' .
    Please tell me how can i fix this error .
    I updated my arduino IDE to latest version but did'nt work .
    I also reinstall the library but all in vain .

    • @robojax
      @robojax  Рік тому

      Try the blink program from file, examples, basic, blink
      The error you are getting is very primitive and it should not happen. Reinstall arduino IDE ( the program itself)

  • @mauguzz
    @mauguzz 4 роки тому

    I have a question. Why, for get results in different axis and sensors, only is necessary to get information from Reg. 0x3B (.59) (acelerometer high X results), and what is the utility of the bit-to-bit operators like displacement

    • @mauguzz
      @mauguzz 4 роки тому

      I saw other programs that do not use this library that also do the same. You do not need to read the ACCEL_XOUT_L, ACCEL_YOUT_H, ACCEL_YOUT_L, ACCEL_ZOUT_H, ACCEL_ZOUT_H, ACCEL_ZOUT_H, etc. registers (registers from 0x3C to 0x48, that is, 60 to 72 decimals) just read the ACCEL_XOUT_H and do bitwise operations.
      This is the registers map of the MPU9250: cdn.sparkfun.com/assets/learn_tutorials/5/5/0/MPU-9250-Register-Map.pdf

    • @robojax
      @robojax  4 роки тому

      I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊

  • @FoxD13
    @FoxD13 4 роки тому

    You connected SDA and SCL on the uno to a device that is not 5v tolerant. OFC there is the stepdown converter for supply, but what about logic level? My Uno outputs 5v amplitude on sda and scl and im afraid I roasted my MPU. So basically HW setup on my side should be same as yours, but my mpu just doesnt connect as shown in the serial monitor which therefore only outputs 0s for each value of the 9 axes. Help would be appreciated... At least those things are cheap, so I can just buy a second one and see if I really roasted the first one and use a logic level conv. this time.

    • @robojax
      @robojax  4 роки тому

      you are right. But maximum tolerance of 9250 is 4V while Arduino UNO wiht 5V VCC, outputs os 60% of supply or approxmately 3.5V at sDA and SCL.

  • @LUQMANRAHMANHAKIM
    @LUQMANRAHMANHAKIM Рік тому

    I have a question, I have followed every step of the experiment on your video. However, currently the value of the magnetometer does not appear, what about the solution?
    thank's sir

    • @robojax
      @robojax  Рік тому

      not should you face such issue. may be you have deleted the lines for magnetometer. start with fresh code without any changes.

  • @humbertosalazar7435
    @humbertosalazar7435 4 роки тому

    thanks for the video sr but how to calibrate the mpu 9250 accelerometer ? do you have a sample code?

    • @robojax
      @robojax  4 роки тому

      no I don't. Sorry. Perhaps others will reply if they can help.

  • @sameqy
    @sameqy 5 років тому

    Hi, I am just wondering whether you have any information regarding DMP digital motion processor. Whether it is stored internally into the chip. Could you also explain how you managed to accessed the magnetometer data?
    thank you for your reply.

    • @robojax
      @robojax  5 років тому

      Hi, No i have no information about DMP as of this moments.

    • @josemanuelromoperedo5080
      @josemanuelromoperedo5080 5 років тому

      There are three documents that describe the inner workings of this unit.
      The first is the Product Specification: (The document below if for MPU6500, search the one for MPU9250 if you need it)
      invensense.com/wp-content/uploads/2015/02/MPU-6500-Datasheet2.pdf
      This document has the electrical characteristics of the device, also it has some info on data protocols used, and some block diagrams.
      The Second is the Register Map and Descriptions: (The document below if for MPU6500, search the one for MPU9250 if you need it)
      invensense.com/wp-content/uploads/2015/02/MPU-6500-Register-Map2.pdf
      This document contains the information on the registers. This are the data bytes that you can request from the device and also the data bytes you can send to configure your device operation.
      There is a third document that is called MPU-9250 Accelerometer, Gyroscope and Compass Self-Test Implementation:
      github.com/kriswiner/MPU9250/blob/master/Documents/AN-MPU-9250A-03%20MPU-9250%20Accel%20Gyro%20and%20Compass%20Self-Test%20Implementation%20v1%200_062813.pdf
      This document is only on the implementation of a self test, and contains the math involved, and pseudocode to follow along.
      There are many registers on this devices, i suggest you to take a read on the three documents to understand how this device works.

  • @narekpoghosyan3712
    @narekpoghosyan3712 Рік тому

    Hi, I'm getting an error where status = -5. Any idea what would cause this?

    • @robojax
      @robojax  Рік тому

      Hi, I checked the full library here github.com/bolderflight/invensense-imu/tree/main and did not find any text related to status =-5. Please see the examples folder and let me know which code you used to get the "-5" status.

  • @marcg.272
    @marcg.272 3 роки тому

    Hey Robojax, great video, this really helped.
    I just have one problem with the library... I am using ESP32 for MPU-9250 and want to use different Pins for SDA and SCL.
    Normally i would just set them with the function wire.begin(I2C_SDA, I2C_SCL, 9600). But I can't find any information on how to set pins in the .h/.cpp documents, can you tell me how to change these Pins with the library?

    • @robojax
      @robojax  3 роки тому

      Hello, here is introduction to ESP32 video ua-cam.com/video/--Fj8QDlGuQ/v-deo.html and in this video I've used I2C pins for LCD ua-cam.com/video/COssWn4Pcm4/v-deo.html good luck

  • @antoniogruzdiew7059
    @antoniogruzdiew7059 2 місяці тому

    Have you managed to collect data from all 3 sensors with the same data rate?

    • @robojax
      @robojax  2 місяці тому

      Create object with different name like sensor1, sensor2 and sensor3. and use them. You learn the use of object from this example ua-cam.com/video/L6ekl2ABcuY/v-deo.html

    • @antoniogruzdiew7059
      @antoniogruzdiew7059 2 місяці тому

      @@robojax I wanted to ask how you have configured I2C master so you can read data from all 3 sensors by single reading. When I try so, ST2 reg doesn't get read therefore
      MAG doesn't update it's values.

  • @revpamoffice5810
    @revpamoffice5810 3 місяці тому

    9:23 Wiring

    • @robojax
      @robojax  3 місяці тому

      I have explined it two or three times. this video is for learning. Pay attention. I mentioned which pin goes where and then showed you. if you have a project to print it,t hen use fritzing from fritzin.org free softwared.

  • @Mashilal
    @Mashilal 2 роки тому

    hello sir, i have a question
    why on i2c scanner you've got only 1 address (0x68) ? meanwhile on thats mpu-9250 has 9 DOF, which mean it should has 2 address : 1 address for accel & gyro (0x68), and 1 address for magnetometer (?)

    • @robojax
      @robojax  2 роки тому

      Hello, everything on the module has one address .

    • @Mashilal
      @Mashilal 2 роки тому

      @@robojax really? but i have gy 91 which is 10 dof (3 accel, 3 gyro, 3 magnitude, 1 compass) has 2 address, 1 address for 0x68 and 0x76

  • @donatoliotino1872
    @donatoliotino1872 5 років тому

    what range of numbers should we be getting?

    • @robojax
      @robojax  5 років тому

      for x, y and z you will get either positive or negative angle. it never stops at 360. I have provided the datasheet as well.

  • @pablogarciacalderon39
    @pablogarciacalderon39 5 років тому

    How to calibrate the accel, gyro and compass?? Thank you

    • @robojax
      @robojax  5 років тому

      Here is the library file and it shows it has calibration function (method). Just search "calibrate" I believe every time you boot, it does it with reference to the current position github.com/bolderflight/MPU9250/blob/master/src/MPU9250.cpp

  • @ruveydakayr1497
    @ruveydakayr1497 4 роки тому

    how can I get yaw pitch roll data from the sensor?

    • @robojax
      @robojax  4 роки тому

      you can get them when you implement PID controller so the drone or airplane is stabilized.

  • @vojtakliner7605
    @vojtakliner7605 6 років тому

    Amazing video, thanks. Can I have one question? If I turn the sensor 65 degrees, will it still show the 65 degrees (to X), or does it reset in a while (and that 65 rotated position to X will be new basic position= it will show 0)? Of course after recalculation Rad/Degrees. I need to use it for a point where the angle is rotated only once for a long time and I want it to keep showing me that angle measured from that horizontal (basic) position will it work?
    I had this problem with MPU6050 (it kept changing his basic position), I don´t know if it´s normal, or if I had bad program...
    Thanks a lot.
    If you told it in the video, I´m sorry my English is still bad.

    • @robojax
      @robojax  6 років тому

      You posted comment about MPU6050 but this video is about MPU9250. please post it here ua-cam.com/video/uhh7ik02aDc/v-deo.html

  • @richardbranch5239
    @richardbranch5239 2 роки тому

    Fatal error:cstddef: no such file or directory.
    I am getting that error. When I delete the c includes. I get a cmath error in the eigen file. What causes this? I am trying to verify/compile the code.

    • @robojax
      @robojax  2 роки тому

      I just checked the code I've shown in video, it should not have that. try using the library from robojax.com. on the same page there is link for it.

  • @rahulchugh5362
    @rahulchugh5362 4 роки тому

    mpu9250 IO voltage is equal to VDD which would be 3.3 as shown in the video. Is it safe to use with arduino uno which works with 5v IO voltage

    • @robojax
      @robojax  4 роки тому

      I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊

    • @rahulchugh5362
      @rahulchugh5362 4 роки тому

      @@robojax I figured it out myself, I2c interface pins are open-drain type and sensor board has 3.3v pull-ups. 3.3 v high is enough for arduino input.

    • @rahulchugh5362
      @rahulchugh5362 4 роки тому

      ​@@robojax can you tell the purpose of fsync pin?

    • @robojax
      @robojax  4 роки тому

      Here it shows in page 27 www.invensense.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf it is the Frame Syncronization with external sensor if you use. Connect to GND if not used.

  • @suryamadhav5208
    @suryamadhav5208 4 роки тому

    @Robojax ,when i run the i2c scanner ,no address is being detected. plz help.
    dont u have to connect pull up resistors?

    • @robojax
      @robojax  4 роки тому

      I am sorry for late reply. I was on vacation. Your wiring must be incorrect or you pins are not bad.

  • @develhoper
    @develhoper 4 роки тому

    Hi how can I get to calibration of MPU9250? we use on the model satellite can you please help us about this? we have some problem

    • @robojax
      @robojax  4 роки тому

      Hi, Calibration is included with the library. See is on this page github.com/bolderflight/MPU9250

  • @TheVideoVolcano
    @TheVideoVolcano 4 роки тому

    Doesn't this need a level shifter since the MPU9250 operates on 3V3 logic?

    • @robojax
      @robojax  4 роки тому

      very interesting point. But the logic level is not necessary 3.3V as shown here invensense.tdk.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf

    • @TheVideoVolcano
      @TheVideoVolcano 4 роки тому

      @@robojax Which part exactly? I'm building a flight tracker for my undergraduate thesis and all of my other boards require level shifters.

  • @quoccuongphan5247
    @quoccuongphan5247 5 років тому

    hi, Can you tell me MPU9250 using external interrupt : Raising or failing?
    Thank you!!

    • @robojax
      @robojax  5 років тому

      I have not looked into it. I have provided the data sheet and you can see it.

    • @quoccuongphan5247
      @quoccuongphan5247 5 років тому

      ​@@robojax
      Can you send me related documents?

    • @robojax
      @robojax  5 років тому

      snag.gy/EG4O2l.jpg

  • @chaoshero223
    @chaoshero223 5 років тому

    How to use mpl to get row pitch and yaw?

    • @robojax
      @robojax  5 років тому

      this can give x, y and z. You can define your own Yaw, row and pitch. I have not spend time to figure that out.

  • @arvindnahar5711
    @arvindnahar5711 5 років тому

    In which unit of distance are you using in accerelometer.

    • @robojax
      @robojax  5 років тому

      I have provided the datasheet. On page 6 it say g/sec is the unit . see it here www.invensense.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf

  • @sheharyarmalik6259
    @sheharyarmalik6259 4 роки тому

    How can I open the COM11 file? The file that is showing us the real time values?

    • @robojax
      @robojax  4 роки тому

      sorry "COM11" file? or port? if you are referring to the port, you can learn it from this video ua-cam.com/video/4OOFlS75owA/v-deo.html

  • @tomaslesko
    @tomaslesko 3 роки тому

    Hi Robojax. Great project. Is it posible to export Serial.prints into some opentrack inputs (joystick input)? I have made some sort as EDtracker but there is only 3DOF.

    • @robojax
      @robojax  3 роки тому

      Hi, Thanks. I have never heard of EDtracker .

  • @prabhkiratsingh6388
    @prabhkiratsingh6388 5 років тому

    Can you please tell how to get roll pitch yaw data from above code??

    • @robojax
      @robojax  5 років тому

      This image might help you robojax.com/learn/images/ref/roll_pitch_yaw.jpg but I have used this for airplane or drone

    • @fifilulu
      @fifilulu 5 років тому

      Have a look at www.lucidar.me/fr/inertial-measurement-unit/mpu-9250-and-arduino-9-axis-imu/

  • @andanre07
    @andanre07 3 роки тому

    how to install manually mpu9250 library? i've tried but it doesnt work. could you tell me

    • @robojax
      @robojax  3 роки тому

      just put the driver in the "my document\arudino\libraries" folder. so this module should have it's own folder with all files. Restart the Arduino IDE and it should work and you should see the examples. 100k people used the instruction shown in video and it works.

  • @nooblegend3742
    @nooblegend3742 2 роки тому

    So is it really ok to connect vcc to 5v? Bcz mine suddenly become 0 output for every sensor after connecting it to 5v for a while

    • @robojax
      @robojax  2 роки тому

      Yes. Really. it has voltage regulator on the module. I have crated illustration image here robojax.com/node/931

    • @robojax
      @robojax  2 роки тому

      You didn’t reply? I spent about an hour to make the diagram so you understand it better.

    • @nooblegend3742
      @nooblegend3742 2 роки тому

      @@robojax sorry for late reply. Thx for reassuring me. I've read some papers and mpu9250 datasheet and both have different Vcc input so that's why I had confusion

  • @user-jw4cl8bv9l
    @user-jw4cl8bv9l 3 роки тому

    I borrow your code, but the value of acceleration isn't pretty like you.
    Namely, when chip is static, ax isn't 0 and az isn't -9.8. Do you know what is the probable reason?
    thanks a lot.

    • @robojax
      @robojax  3 роки тому

      LOL. calibrate the accelerometer using this :calibrateAccel() it shows in library file here on line (after) 705 github.com/bolderflight/MPU9250/blob/master/src/MPU9250.cpp

    • @user-jw4cl8bv9l
      @user-jw4cl8bv9l 3 роки тому

      @@robojax thanks for your answer !
      But i still confuse after I read the library.
      Can I ask how to use calibrateAccel()?

    • @user-jw4cl8bv9l
      @user-jw4cl8bv9l 3 роки тому

      here is my(your) code, the B part is same as A part, I guess I misuse the calibrateAccel()
      #include
      /*
      Advanced_I2C.ino
      Brian R Taylor
      brian.taylor@bolderflight.com
      Copyright (c) 2017 Bolder Flight Systems
      Permission is hereby granted, free of charge, to any person obtaining a copy of this software
      and associated documentation files (the "Software"), to deal in the Software without restriction,
      including without limitation the rights to use, copy, modify, merge, publish, distribute,
      sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
      furnished to do so, subject to the following conditions:
      The above copyright notice and this permission notice shall be included in all copies or
      substantial portions of the Software.
      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
      BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
      NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
      DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
      */
      #include "MPU9250.h"
      // an MPU9250 object with the MPU-9250 sensor on I2C bus 0 with address 0x68
      MPU9250 IMU(Wire,0x68);
      int status;
      void setup() {
      // serial to display data
      Serial.begin(115200);
      while(!Serial) {}
      // start communication with IMU
      status = IMU.begin();
      if (status < 0) {
      Serial.println("IMU initialization unsuccessful");
      Serial.println("Check IMU wiring or try cycling power");
      Serial.print("Status: ");
      Serial.println(status);
      while(1) {}
      }
      // setting the accelerometer full scale range to +/-8G
      IMU.setAccelRange(MPU9250::ACCEL_RANGE_8G);
      // setting the gyroscope full scale range to +/-500 deg/s
      IMU.setGyroRange(MPU9250::GYRO_RANGE_500DPS);
      // setting DLPF bandwidth to 20 Hz
      IMU.setDlpfBandwidth(MPU9250::DLPF_BANDWIDTH_20HZ);
      // setting SRD to 19 for a 50 Hz update rate
      IMU.setSrd(19);
      }
      void loop() {
      // read the sensor
      IMU.readSensor();
      // display the data
      //part A
      Serial.print("Ax: ");
      Serial.print(IMU.getAccelX_mss(),6);
      Serial.print("\t");
      Serial.print("Ay: ");
      Serial.print(IMU.getAccelY_mss(),6);
      Serial.print("\t");
      Serial.print("Az: ");
      Serial.println(IMU.getAccelZ_mss(),6);
      IMU.calibrateAccel();
      //part B
      Serial.print("Ax: ");
      Serial.print(IMU.getAccelX_mss(),6);
      Serial.print("\t");
      Serial.print("Ay: ");
      Serial.print(IMU.getAccelY_mss(),6);
      Serial.print("\t");
      Serial.print("Az: ");
      Serial.println(IMU.getAccelZ_mss(),6);
      /*Serial.print(IMU.getGyroX_rads(),6);
      Serial.print("\t");
      Serial.print(IMU.getGyroY_rads(),6);
      Serial.print("\t");
      Serial.print(IMU.getGyroZ_rads(),6);
      Serial.print("\t");*/
      /*Serial.print(IMU.getMagX_uT(),6);
      Serial.print("\t");
      Serial.print(IMU.getMagY_uT(),6);
      Serial.print("\t");
      Serial.print(IMU.getMagZ_uT(),6);
      Serial.println();
      delay(1000);
      Serial.print("calibrateMag: ");
      IMU.calibrateMag();
      Serial.print(IMU.getMagX_uT(),6);
      Serial.print("\t");
      Serial.print(IMU.getMagY_uT(),6);
      Serial.print("\t");
      Serial.print(IMU.getMagZ_uT(),6);
      Serial.println();*/
      //Serial.println(IMU.getTemperature_C(),6);
      delay(200);
      }

  • @BLAZMOD
    @BLAZMOD 5 років тому

    please help I'm getting this
    "IMU initialization unsuccessful
    Check IMU wiring or try cycling power
    Status: -1
    "

    • @robojax
      @robojax  5 років тому +1

      First run the I2C scanner (link is provided in the same page as the code) .It seems you there is issue with wiring. You should be getting I2C address when running I2C scanner.
      you can read about the error codes in the library in here at line 60 github.com/bolderflight/MPU9250/blob/master/src/MPU9250.cpp

    • @BLAZMOD
      @BLAZMOD 5 років тому

      @@robojax Thanks a lot, my problem was that I can't communicate with the mpu through the default address which is 0x68 the sloshing was to connect the ADO pin to 5v and change the address to 0x69 to establish the communication.
      Thanks again for the video brother.

    • @robojax
      @robojax  5 років тому +1

      You are welcome. I am glad the issue is resolved.

  • @theunfinishedbusiness2407
    @theunfinishedbusiness2407 3 роки тому

    It didn't work for me i displays no xyz cordinates in the serial monitor

    • @robojax
      @robojax  3 роки тому

      does it print any or nothing at all? it should say something at the beginning when you open the serial monitor.

  • @Feargaill
    @Feargaill 5 років тому

    Hey Robojax can you turn this into a mouse? I have a Pro Micro w/ a mpu9250 and i just can't get the code right

    • @robojax
      @robojax  5 років тому +1

      I have not worked on it but with some efforts it should work.

  • @suhaibsk2727
    @suhaibsk2727 2 роки тому

    I am only getting temparature value. What may be the issue?

    • @robojax
      @robojax  2 роки тому

      the module has temperature sensor but the library github.com/bolderflight/mpu9250 does not have that function. so it seems you are not using the library. Please use library, it will work.

    • @suhaibsk2727
      @suhaibsk2727 2 роки тому

      @@robojax getting negetive value for IMU.begin. what may be the issues

  • @keshavmukund5292
    @keshavmukund5292 2 роки тому

    Hi Robojax, will you be able to share the labVIEW code for this?

    • @robojax
      @robojax  2 роки тому

      Hi, this code works only with Arduino.

  • @mrmacsnail
    @mrmacsnail 5 років тому

    Hi thank's for the very good video. I did some try but I get the compiling error for the line 27 MPU9250 IMU(Wire,0x68); as follows "Wire was not declared in this scope". The library is well included in the arduino directory. Can You help me to fix it? I am quite a beginner... Thank's in advance....

    • @robojax
      @robojax  5 років тому

      this is due to missing library. Please try to include it by clicking on Sketch->include library->Add zip library.
      This can't be other error.

    • @mrmacsnail
      @mrmacsnail 5 років тому

      Thank You for the quick reply. With a freshest version of Arduino IDE all references work now fine.

    • @robojax
      @robojax  5 років тому

      You are welcome. I am glad it worked for you.

  • @amarendraranade4099
    @amarendraranade4099 3 роки тому

    Do you have SPI based code for MPU9250 and arduino ?

    • @robojax
      @robojax  3 роки тому

      not at the moments.

  • @hazghaz7223
    @hazghaz7223 3 роки тому

    why am i getting I2C not detected again and again? I've triple checked the wiring

    • @robojax
      @robojax  3 роки тому

      Something must be seeing . If you have multimeter check the voltage of the module to see if it is getting power.

  • @odityaandalasputra3982
    @odityaandalasputra3982 3 місяці тому

    do u know program spi arduino?

    • @robojax
      @robojax  3 місяці тому

      Just search on Bing.com for “mpu-9250 SPI GitHub arduino “ I am sure you will find so many.

  • @utcca7758
    @utcca7758 5 років тому

    Hi so I followed the steps, but for me it says MPU failed and then check connection followed by different symbols and letters. I checked the wiring and tested if my arduino can check if I2C devices are connected. Please let me know to why different symbols appear. Thanks.

    • @robojax
      @robojax  5 років тому +1

      Your serial monitor has incorrect baud rate. see it here snag.gy/y3pKwG.jpg either fixt the code or fix the serial monitor

    • @coleschreiner3067
      @coleschreiner3067 2 роки тому

      The code will have something like " Serial.begin(115200);" you need your serial monitor to match that

  • @MahmoodLahroodi
    @MahmoodLahroodi 4 роки тому

    Hello, Thank you for the video and code. I connected the Arduino Uno, installed MPU9250 library, and run the code and face with this error: no matching function for call to 'MPU9250_:: MPU9250_(TwoWire&, int)' -- it shows this line of code: MPU9250 IMU(write,0x68) as the source of error. I would appreciate it if you could let me know how to solve this problem.

    • @robojax
      @robojax  4 роки тому +1

      It means the library is not installed

    • @L_k44
      @L_k44 2 роки тому

      I have same problem . are you solve this problem .. can u help me

  • @francoisguyot789
    @francoisguyot789 5 років тому

    My wiring is correct since I get an I2C adress of 0x68 with the scanner, but I get this error with your code:
    IMU initialization unsuccessful
    Check IMU wiring or try cycling power
    Status: -1

    • @robojax
      @robojax  5 років тому

      Here it shows github.com/bolderflight/MPU9250/blob/master/src/MPU9250.cpp at line 1070 and it is due to reading I2C address. It is strange. I am not sure what is going on. If you've got another module, try that.

    • @francoisguyot789
      @francoisguyot789 5 років тому

      @@robojax I don't have any other module ...
      I've waited 3 weeks but gyro/accelerometer is so hard to get to work !
      I found a code that read gyro and accelerometer using registers and no library, but I don't know if it's reliable for a quadcopter PID

    • @robojax
      @robojax  5 років тому

      It is possible but the library makes you code simple and clean.

    • @francoisguyot789
      @francoisguyot789 5 років тому

      @@robojax Yes ! It was the perfect code

    • @francoisguyot789
      @francoisguyot789 5 років тому +1

      @@robojax Do you think that it's because I'm using an Arduino nano ?

  • @Miki-mv7el
    @Miki-mv7el 4 роки тому

    Hello. Could you tell me the sampling rate of this program?

    • @robojax
      @robojax  4 роки тому

      I have provided the link to the datasheet. Please check that out.

  • @rajabdeenali11
    @rajabdeenali11 5 років тому

    This code is not working for me... It is showing 'no matching function for call to MPU9250_::MPU9250_(TwoWire&, int)' what should I do for this? Anyone?

    • @robojax
      @robojax  5 років тому +1

      Yes. It means you did not follow my instruction in the video. You have not downloaded and installed the library.