Build an Electronic Level with MPU-6050 and Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 เม.ย. 2024
  • Today we will be working with the MPU-6050 IMU, and we will use it to build an electronic level with an Arduino.
    Article with libraries and code - dronebotworkshop.com/mpu-6050...
    More articles and tutorials: dronebotworkshop.com
    Join the conversation on the forum: forum.dronebotworkshop.com
    Subscribe to the newsletter and stay in touch: dronebotworkshop.com/subscribe/
    Today we will be working with the MPU-6050, a low-cost Inertial Measurement Unit, or IMU. This device has a lot of different applications in many fields including robotics, gaming, quadcopters, and IoT devices.
    The MPU-6050 has an internal gyroscope and accelerometer. It's an inexpensive device, available in several packages and modules. The module I am using is very common and has a built-0in voltage regulator so it can work with 5-volt logic.
    We will start by looking at the MPU-6050 internals, as well as at the pinout of the module I am using.
    Next, we will load a couple of libraries into our Arduino IDE and ruins some sample code to display Pitch, Yaw, and Roll.
    After that, we will build a small project, an electronic level. Our level will display on an LCD and will also use 5 LEDs to give a good visual indication of how level the surface is.
    Here are the contents for today's video:
    00:00 - Introduction
    02:53 - MPU-6050 Intro
    11:20 - MPU-6050 Arduino Experiments
    20:29 - Electronic Level
    You can get the sketch and the two libraries used in the experiments on the DroneBot Workshop website.
    Hope you enjoy the video!
  • แนวปฏิบัติและการใช้ชีวิต

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

  • @Mystic0Dreamer
    @Mystic0Dreamer 5 ปีที่แล้ว +111

    HOLLY SMOLLY!
    Bill ---> Professor of the Year Award from me!
    I'm not kidding! I've had professors in college who weren't anywhere near as good as you Bill.
    History lessons:
    In-depth mathematics lesson on Quarternions.
    Does all the homework for us finding libraries etc.
    College Level programming explained in-depth.
    Unbelievable concise and even animated Schematic Graphics
    Live in-lab demonstration of the final results.
    LCD digital readout and an LED graphic display to boot!
    And if all that isn't already above and beyond the call of duty,... A link to a full web page complete with the same lesson all typed out with graphics, links, and code!
    Unbelievable! There's just no other word to describe this.
    You are a Younique TH-camr Bill. To be sure!

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

      yes! but subs don't say that 😢😢😢

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

      youLamewhlteboi

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

    Thanks for another great tutorial. Excellent pun at 7:56 -- " ... the MPU6050 that IMUsing ... "

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

    I have been watching quite a bit of DroneBot's videos these past few weeks and this one is by far for me the most inspiring! I have to thank whomever it was that suggested the MPU-6050 sensor as a focus, as well as DroneBot of course. His videos are always great. I have a good feeling about where the wheels in my mind are rolling to now!

  • @DucatiMTS1200
    @DucatiMTS1200 5 ปีที่แล้ว +1

    What an excellent teacher you are sir. You really are superb at putting information across in a very clear and measured manner. Keep up the good work!

  • @raymondmichael4987
    @raymondmichael4987 5 ปีที่แล้ว +19

    An eye opener to the device.
    Thanks
    Greetings from Tanzania 🇹🇿

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

      you black?????

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

      @@atlnlgga4568 , if you’re asking whether I’m black, as of black matter; yes I’m black , native African from Tanzania 🇹🇿.
      Otherwise, I didn't get your question dude, uliza tena tafadhali

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

    This is another great video from the Dronebot Workshop! I'm looking forward to experimenting with the MPU-6050 after having enjoyed watching this clip.

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

    This was something I had been googling for, and I found a full explanation, thanks for your work, it seems selfless, we are grateful

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

    An exquisite source; so well done. Thank Bill so much for your dedication to electronic experiments.

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

    Fantastic, I was looking for something I could use for an automatic leveling system on a camper van and I think this will be perfect, thanks.

  • @DodgyBrothersEngineering
    @DodgyBrothersEngineering 5 ปีที่แล้ว +4

    This channel is inspiring so many ideas. Another device to be added to an upcoming project.

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

    I can not thank you enough for all these projects you make easy to understand keep on doing amazing work :)

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

    Your explanations are very welcome and clear. We only had to change the LCD adress to let the code provided for the level work.

  • @stuartg40
    @stuartg40 5 ปีที่แล้ว +6

    Thanks for the regular videos and the education they provide. Keep up the great work.

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

    Absolute genius! Trying to adapt for a different use and the roll is changing way too slowly (unlike the pitch which is spot on). In the vid it responds instantly!

  • @VictorDoomakaSumanthGottipati
    @VictorDoomakaSumanthGottipati 6 หลายเดือนก่อน +5

    Because of wonderful creators like you, I am able to learn and grow so much! Thank you!

  • @Taran72
    @Taran72 5 ปีที่แล้ว +1

    Thank you very much for the wonderful video and for providing the libraries that work! You have been of great help to complete my Arduino projects. :)

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

    Thank you for the perfect demonstrations. I would be grateful for the ATtiny microprocessor projects.

  • @JesusGamayon
    @JesusGamayon 5 ปีที่แล้ว +4

    Thanks for this Bill, been waiting for this!

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

    thank you for another great video Bill. If I might say it would have been nice had you shown how to install the libraries in the ide.

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

    Thanks Sir for this video. I cannot emphasise how much this video helped me. Please keep coming with such videos.🥰

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

    Really enjoyed this video. I've never this type sensor before. Thanks.

  • @TheUnofficialMaker
    @TheUnofficialMaker 5 ปีที่แล้ว +1

    Always great informative videos and excellent content and very thorough. I look forward to every one.

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

    Thank you very much for the best arduino tutorial ever!
    Greetings from IRAN

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

    Really cool. I have had one of the 9DOF sensors in my drawer for several years, only tried playing with it a couple of times, didn't find it all that exciting since I am not into drones. Now, however I can see where it may be very handy in my RV for leveling her. The built in sensors are so slow that getting the old gal level enough for both walking and the operation of the frige are essential. I currently use an old spirit level and my wife telling me which way to go with the hydrolic levelers, but this would make life for both of us much easier and lest chaotic when we move to a new site. That is if we can ever get on the road again with this damn virus crap.

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

    Very good explained. Thanks for the helpful tutorial!

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

    As usual , a fantastic video. I cannot thank you enough .

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

    As always, great and comprehensive video.

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

    Thanks for helping get through Uni.

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

    18:34 The YPR angles drifted like crazy when the IMU sat still… you need to double check the code to see if there’s any compensation or filtering built in…

  • @tinkmarshino
    @tinkmarshino 5 ปีที่แล้ว

    egads.. I came late to class... I have an mpu-6050 but have not yet had a chance to play with it.. Now I have some great ideas.. thanks Bill.. I don't worry about my ssd because I can't get anything to work on windows 3.1 any more... keep smile Billiam.. life is good... thanks for the share and please carry on.. till thursday!

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

    Hey, thanks, you are great, your workshop is great, your videos are great .
    I wish I could drink a cup of coffee with you in your workshop and poke around.

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

      youIame azz whlteboi

  • @aberateklehaimanot9804
    @aberateklehaimanot9804 5 ปีที่แล้ว +1

    Great video as always.Thanks for sharing.

  • @kapowbalw
    @kapowbalw 5 ปีที่แล้ว +1

    This is really great stuff! Thanks a bunch.

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

      you Iamewhlteboi

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

      @@atlnlgga4568 watch it, boy

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

    Nicely explaind! Especially the graphics!!

  • @SivaKumar-ny8pg
    @SivaKumar-ny8pg 2 ปีที่แล้ว

    As usual highly professional and pragmatic delivery

  • @cyadid
    @cyadid 5 ปีที่แล้ว

    So professional ! Bravo !!!

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

    Thank you for making these awesome videos.

  • @Prompt24
    @Prompt24 5 ปีที่แล้ว +1

    Exactly what I was looking for. Thanks. I would like you to think about the thermometer for extreme conditions like sauna.

    • @abpccpba
      @abpccpba 5 ปีที่แล้ว

      Take note what Bill said in this video; only accept request from News Letter subscribers.

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

      you Iamewhlteboi

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

    The way you explain this stuff is really awesome! Make More videos please.subscribed to channel and news letter

  • @karthiksubhash5596
    @karthiksubhash5596 5 ปีที่แล้ว

    Thank you very much sir for making the video that I requested for.

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

    I really enjoy your videos, I appreciated the effort that you put into them.
    How do you use the XCL, XDA and INT pins ? I have address conflicts.

  • @jasonrbodie
    @jasonrbodie 5 ปีที่แล้ว +1

    You're awesome. Thank you!

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

    actually the I2C12 zip file is not on your website instead it is the zip file with the aurduino code for the level

  • @rogerbeck3018
    @rogerbeck3018 5 ปีที่แล้ว +1

    especially thank you for thr explanation of degrees of freedom ... I did not understand 6 (9) dof

  • @ttibor
    @ttibor 5 ปีที่แล้ว

    I am glad I found this channel.

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

    Thank god I found this. Just discovered a new hobby!

  • @jparky1972
    @jparky1972 5 ปีที่แล้ว

    Thank you.
    - Subscribed.

  • @MrDdgiustina
    @MrDdgiustina 5 ปีที่แล้ว +1

    BEST Arduino professor.

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

    Thank you sir this was very helpful!

  • @willofirony
    @willofirony 5 ปีที่แล้ว +5

    Excellent video, as per (how soon we take perferection for granted). Am I correct in assuming that the initial calibration should be done on a levelled surface. As this will be the "zero" attitude for all future calculations?

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

      you can do the initial calibration while not being on a leveled surface. You can use the accelerometer values for the calibration of the gyro to "tell" it in what position it is in.

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

      you Iamewhlteboi

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

    Incredibly helpful.

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

    Your channel is indispensable.

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

    Very interesting and helpful Video, Thanks a lot for such valuable information

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

    great explanation. you are a hero!

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

    Beautiful ! Thanks much.
    In other cases using my drone, cellphone, etc I have to move it in a figure 8 etc to calibrate its initial position. Does that 1000 reads at the beginning do that ? Thanks again.

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

      That method will get you a rough approximation. Try MPU6050_tockn - Arduino library for easy communicating with the MPU6050: github.com/Tockn/MPU6050_tockn

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

      YouLAMEwhlteboi

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

    Superb! Video. Thank you so much!!!

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

    awesome…you are 1000x better than my lecturers…full respect from me 💋

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

    Thank you so Much. A very very useful video .

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

    It's the best lecture ever.
    There is something I want to do.
    I want to get more than 3 mpu6050s connected to one Arduino Uno.
    I'm a novice at Arduino.

  • @army6669990101
    @army6669990101 5 ปีที่แล้ว +1

    This build is perfectly balanced. As all things should be.

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

    Love this project

  • @electronic7979
    @electronic7979 5 ปีที่แล้ว +1

    Useful and very good video 👍

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

    Nice video and gave me an idea to build an joystick that does not rely on potentio meters but can use the gyro.
    just to see if I get better and finer results compared to a analog joystick

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

    When the MPU is first initialized and calibrated on a level surface are the results stable or do they drift over time? If there is drift how often would the lever require a reset?

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

    what did you use to mount the MPU6050 to the wood? I keep having difficulties with the MPU6050 connection failing or turning off due to the pins not making proper contact with the holes of the MPU6050, any ideas on how to help maintain this connection? I see that your MPU6050 never turns off even when you turn it many which ways. Thanks in advance!

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

    Very Useful for me as I am trying to build an rc airplane flight controller/stabilizer.

  • @user-hj4bm1kz2l
    @user-hj4bm1kz2l ปีที่แล้ว

    Greetings from Greece. Grate video

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

    Happy New Year!!!

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

    I have been wanting to use one on an RC Submarine for automatic leveling.

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

    I use it more for the Temperature Sensor feature

  • @makersaustralia6563
    @makersaustralia6563 5 ปีที่แล้ว +1

    Hi Bill, i'm new to your channel... but loving so far! I've been playing around with the 6050 for a while.... I've just tried running through your tutorial (instructions are clean and easy to follow) but cannot seem to get much accuracy out of the level ----- i.e. the indicated angles are off compared to actual. I'm not sure if i'm doing anything wrong (ambient temperature is around 20c)? Do you think temperature is playing a part here? Is there any simple way we can incorporate temperature compensation? ----- THANKS AGAIN! LOVE YOUR STUFF!

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

      I've been playing with this chip and in some other libraries there are calibration procedures. Apparently each chip is unique and has to be calibrated to get it to be precise.

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

      you Iamewhlteboi

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

    I Love your video The why u explain huge Fann Sir Love From Pakistan

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

    Cool label - "well balanced workshop!"

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

    nice but as you only lit one LED at a time, you could save 4 resistors and only put one on the common ground wire of the LEDs ;-)

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

    The man is just sooo good

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

    Always great videos; I actually listen to them on my long drive to and from work.
    I tried the accelerometer, btw, and it is giving me readings of x:10.63 (roughly), y: -0.43, and Z: -1.16 m/s^2 Any ideas why this is the reading when it is sitting still on my desk next to me?

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

    Well done !

  • @user-nv4vj8rp9b
    @user-nv4vj8rp9b 6 หลายเดือนก่อน

    Can RS485 be used to communicate? If so how can it be configured

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

    Hey @DroneBot Workshop, can this device give live update of coordinates of accelerometer? Like every second?

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

    Hi! How long could be the cable from the "UNO" to the sensor, in other words, how far away could be the sensor from the controller?

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

    Thank you!

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

    Would you explain it to me why you didn't use pull up resistors and the i2c pins on right top (18 and 19)?
    Thanks for the explanatory video.

    • @SK-ow4vw
      @SK-ow4vw 6 หลายเดือนก่อน

      I think that the gy-521 module has inbuilt pull-up resistors.

  • @PhG1961
    @PhG1961 5 ปีที่แล้ว +1

    Excellent video ! Thnxs for sharing ! A question... what video editing software do you use ?

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

    As much as I liked this video, I think I'll keep to the Level App of my iPhone :) Also, many new articles have come out about staying *AWAY* from SSD drives. It's scary!

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

    nice work shop

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

    Well BALANCED episode

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

    i spent like four days trying to manually communicate via I2C and interpret the IMU + gyro myself (and failed)
    thanks for pointing out these libraries

  • @Eng.AwsNafea
    @Eng.AwsNafea 4 ปีที่แล้ว

    Thank you very much✌✌🌷🌷🌷🌷

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

    Please do not forget the XOD. It would be interesting and useful. Nobody make a tutorial for XOD, but you. Thanks a lot.

  • @stuartg40
    @stuartg40 5 ปีที่แล้ว +1

    It occurred to me that this video may be quite useful for the amateur rocket-building community due to the gyro & accelerometer information.

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

    really very good explain i have one question i want to control a moving platform its having 4 wheels connected with

    • @mattn.8941
      @mattn.8941 3 ปีที่แล้ว

      If that's a question, you need to be more specific. What is this "4 wheeled moving platform" supposed to do? Why do you need an IMU for it?

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

      YouLAMEwhlteboi

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

    Great job 👍👍👍

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

      youIame azz whlteboi

  • @robertparker5369
    @robertparker5369 5 ปีที่แล้ว

    Great video Bill. At 20:35 you suggest we could use a 16mHz Pro Mini. Could a 3.3v 8mHz Pro Mini be used? (kinda new at this)

  • @stefanvanraemdonck9054
    @stefanvanraemdonck9054 5 ปีที่แล้ว

    Great video. I have one of my MPU-6050's mounted on a breadboard and started the example in the library but the numbers are drifting quiet a lot with the non-moving module? Today i maybe try it with an other MPU-6050.

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

      mine is drifting as well, did you ever find a fix for this?

    • @mattn.8941
      @mattn.8941 3 ปีที่แล้ว

      Essentially, the small amount of error in the measurements adds up over time, creating this large drift from reality. Some math can be used to get more accurate results, but I'm pretty sure a magnetometer is needed to reduce the drift significantly. I'd suggest the IMU tutorial series on TH-cam by Paul McWhorter for a very detailed explanation.

    • @mattn.8941
      @mattn.8941 3 ปีที่แล้ว

      @@MattyMacNJ Read my above comment^ Also I think a magnetometer can be connected to the MPU6050's digital motion processor if need be

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

      @@mattn.8941 okay awesome thanks so much I'll look into it!

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

      YouLAMEwhlteboi

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

    Very good!

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

    This is sooo cool! Could we extend this idea to make a three axis camera gimbal? Maybe add some servos?

  • @metametax
    @metametax 5 ปีที่แล้ว

    THANKS

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

    Hi Bill, can i calculate speed using this i cant seem to find photoelectric sensors where i am

  • @dufric88
    @dufric88 20 วันที่ผ่านมา

    how do you handle drift though? I've found these have a bad tendency to lose their position very quickly, even when not in motion.

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

    Thank you