Build an Electronic Level with MPU-6050 and Arduino
Тәжірибелік нұсқаулар және стиль
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!
Пікірлер: 422
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 KZreadr Bill. To be sure!
@mixgamer2908
3 жыл бұрын
yes! but subs don't say that 😢😢😢
@atlnlgga4568
2 жыл бұрын
youLamewhlteboi
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!
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
An eye opener to the device. Thanks Greetings from Tanzania 🇹🇿
@atlnlgga4568
2 жыл бұрын
you black?????
@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
Thanks for this Bill, been waiting for this!
@atlnlgga4568
2 жыл бұрын
youIameazz whlteboi
Thanks for another great tutorial. Excellent pun at 7:56 -- " ... the MPU6050 that IMUsing ... "
This was something I had been googling for, and I found a full explanation, thanks for your work, it seems selfless, we are grateful
I can not thank you enough for all these projects you make easy to understand keep on doing amazing work :)
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
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!
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
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.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
Because of wonderful creators like you, I am able to learn and grow so much! Thank you!
@Dronebotworkshop
8 ай бұрын
You are so welcome!
This channel is inspiring so many ideas. Another device to be added to an upcoming project.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
An exquisite source; so well done. Thank Bill so much for your dedication to electronic experiments.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
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.
@atlnlgga4568
2 жыл бұрын
youLamewhlteboi
Thanks for the regular videos and the education they provide. Keep up the great work.
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. :)
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
As usual , a fantastic video. I cannot thank you enough .
Thanks Sir for this video. I cannot emphasise how much this video helped me. Please keep coming with such videos.🥰
Thank you very much for the best arduino tutorial ever! Greetings from IRAN
@atlnlgga4568
2 жыл бұрын
youIameazz whlteboi
As always, great and comprehensive video.
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Thank you for the perfect demonstrations. I would be grateful for the ATtiny microprocessor projects.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
Really enjoyed this video. I've never this type sensor before. Thanks.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
Thanks for helping get through Uni.
@atlnlgga4568
2 жыл бұрын
youIame whlteboi
Great video as always.Thanks for sharing.
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Very good explained. Thanks for the helpful tutorial!
Your explanations are very welcome and clear. We only had to change the LCD adress to let the code provided for the level work.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
Always great informative videos and excellent content and very thorough. I look forward to every one.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
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!
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Nicely explaind! Especially the graphics!!
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
BEST Arduino professor.
@atlnlgga4568
2 жыл бұрын
youLAMEazz whlteboi
This is really great stuff! Thanks a bunch.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
@kapowbalw
2 жыл бұрын
@@atlnlgga4568 watch it, boy
You're awesome. Thank you!
@atlnlgga4568
2 жыл бұрын
youIame whlteboi
As usual highly professional and pragmatic delivery
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Thank you for making these awesome videos.
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Superb! Video. Thank you so much!!!
I am glad I found this channel.
@atlnlgga4568
2 жыл бұрын
youIameazz whlteboi
Well BALANCED episode
@atlnlgga4568
2 жыл бұрын
youLAMEazz whlteboi
Very good!
Incredibly helpful.
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Your channel is indispensable.
@atlnlgga4568
2 жыл бұрын
youIame whlteboi
Thank you so Much. A very very useful video .
So professional ! Bravo !!!
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
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!
@atlnlgga4568
2 жыл бұрын
youIame whlteboi
@tinkmarshino
2 жыл бұрын
@@atlnlgga4568 Thanks!
Thank you very much sir for making the video that I requested for.
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Well done !
Greetings from Greece. Grate video
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.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
Thank god I found this. Just discovered a new hobby!
@atlnlgga4568
2 жыл бұрын
youIameass whlteboi
Love this project
great explanation. you are a hero!
@atlnlgga4568
2 жыл бұрын
YouLAMEASSwhlteboi
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…
Thank you sir this was very helpful!
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
awesome…you are 1000x better than my lecturers…full respect from me 💋
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
Thank you. - Subscribed.
@atlnlgga4568
2 жыл бұрын
youIameazz whlteboi
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.
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Useful and very good video 👍
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Happy New Year!!!
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
2 жыл бұрын
youIame azz whlteboi
The way you explain this stuff is really awesome! Make More videos please.subscribed to channel and news letter
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
Thank you!
Thank you very much✌✌🌷🌷🌷🌷
I Love your video The why u explain huge Fann Sir Love From Pakistan
The man is just sooo good
@atlnlgga4568
2 жыл бұрын
youIameazz whlteboi
Very interesting and helpful Video, Thanks a lot for such valuable information
@atlnlgga4568
2 жыл бұрын
youLAME whlteboi
Very Useful for me as I am trying to build an rc airplane flight controller/stabilizer.
This build is perfectly balanced. As all things should be.
@atlnlgga4568
2 жыл бұрын
youIame whlteboi
Great!!
Cool label - "well balanced workshop!"
@atlnlgga4568
2 жыл бұрын
youIame whlteboi
Awesome!
@atlnlgga4568
2 жыл бұрын
youIameazz whlteboiyou black?????
nice work shop
Thank you
especially thank you for thr explanation of degrees of freedom ... I did not understand 6 (9) dof
Great job 👍👍👍
@atlnlgga4568
2 жыл бұрын
youIame azz whlteboi
Thanks teacher
Exactly what I was looking for. Thanks. I would like you to think about the thermometer for extreme conditions like sauna.
@abpccpba
5 жыл бұрын
Take note what Bill said in this video; only accept request from News Letter subscribers.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
Thanks a lot
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.
@atlnlgga4568
2 жыл бұрын
youLamewhlteboi
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.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
THANKS
Nice 😍 very useful
@atlnlgga4568
2 жыл бұрын
youIameazz whlteboi
Please do not forget the XOD. It would be interesting and useful. Nobody make a tutorial for XOD, but you. Thanks a lot.
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
Excellent video ! Thnxs for sharing ! A question... what video editing software do you use ?
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
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!
@atlnlgga4568
2 жыл бұрын
youIame whlteboi
I use it more for the Temperature Sensor feature
I have been wanting to use one on an RC Submarine for automatic leveling.
actually the I2C12 zip file is not on your website instead it is the zip file with the aurduino code for the level
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
@atlnlgga4568
2 жыл бұрын
youIame whlteboi
This is sooo cool! Could we extend this idea to make a three axis camera gimbal? Maybe add some servos?
@atlnlgga4568
2 жыл бұрын
youLAMEwhlteboi
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
Very nice. And the electronic level was exactly what I needed for a current project. I'm using laser LEDs that point to the ground. And I want to switch them off if my device is moved or tips over to avoid someone accidentally looking into the laser beam. Seems like the GY521/MPU-6050 is the component I need as a safety device. Thanks for your effort.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
It occurred to me that this video may be quite useful for the amateur rocket-building community due to the gyro & accelerometer information.
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
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
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
2 жыл бұрын
you Iamewhlteboi
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
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
2 жыл бұрын
YouLAMEwhlteboi
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
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
2 жыл бұрын
you Iamewhlteboi
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!
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 ;-)
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi
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?
@atlnlgga4568
2 жыл бұрын
you Iamewhlteboi
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?
mpu6000 or bust !!!!!! a lot of FPV folk had trouble with 6050, so always preferred a FC with 6000 onboard
Supperrb.
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)
@atlnlgga4568
2 жыл бұрын
YouLAMEwhlteboi