Тёмный

Raspberry Pi Pico W LESSON 40: Measuring Acceleration with the MPU6050 Six Axis IMU 

Paul McWhorter
Подписаться 382 тыс.
Просмотров 6 тыс.
50% 1

UPDATE: If you are getting an error when you try and import IMU, then change the name of the library folder on your pico from libs to lib. That should fix it.
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
/ paulmcwhorter
In this class we will be using the Sunfounder Raspberry Pi Pico W Keppler Kit. It will make things a lot easier if we are working on identical hardware. the link below is to amazon, and is for the identical hardware I will be using in this entire class.
amzn.to/3ubMRs1
In this video, I will show you how to measure acceleration using the MPU6050 Six Axis IMU chip. I will give an explanation of the math and physics behind measuring acceleration, and will show you how to incorporate the MPU6050 into your projects. Enjoy!
[Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. ]
#IMU
#mpu6050
#micropython

Опубликовано:

 

8 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 97   
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
UPDATE: If you are getting an error when you try and import IMU, then change the name of the library folder on your pico from libs to lib. That should fix it. Seems it is an issue for some and not for others. In any event, if it is a problem, rename the folder.
@drdentin3215
@drdentin3215 10 месяцев назад
I found that out. Thanks for confirming. Charlotte mentioned that in the premier. I tried a second Pico and changed the library name at the same time. It had to be one or the other.
@jimworden9021
@jimworden9021 6 месяцев назад
I had this problem and (after a bit of research) ran across this bit of code: import sys sys.path.append("/libs") Seems to work fine. Now I have both /lib (which contains to ssd1306 libraries) and /libs. Is there a downside to this method?
@karl-heinzwaldmann6389
@karl-heinzwaldmann6389 3 месяца назад
Dear Paul, I would like to thank you for the excellent presentation of this topic. I wasted a lot of time on German tutorials and didn't understand anything. Your channel then brought me enlightenment. Greetings from Germany and my appreciation
@paulmcwhorter
@paulmcwhorter 3 месяца назад
Excellent!
@deskriptamcl3966
@deskriptamcl3966 3 месяца назад
Dear Paul, this video is maybe the best spent time for me on RU-vid ever. I like the scientific secrets you reveal, to know how engineering was able to make that those tiny elements are aware of the sensation that we humans are able to feel (but only to some extent). I find that fascinating, and your explanations are very concise and full of information. Thank you so much. I have just discovered this channel.
@louistoweill4232
@louistoweill4232 4 месяца назад
I appreciated your explanation of the mechanics and physics behind this process!
@quaternion-pi
@quaternion-pi 10 месяцев назад
Love the under the hood discussions. The more math and engineering details, the better. Would love to hear more about your hands-on experiences in nanotech.
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
Excellent!
@diggee172
@diggee172 10 месяцев назад
I love this detail. This stuff wasn’t invented when I was in school Paul. I’m retired and I’m older than you😅. I thank God everyday I’m still learning.
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
Oh wow!
@luizbergo
@luizbergo 10 месяцев назад
It's always time to learn, all we need is humility and strive. Keep going and congratulations.
@polkcountymike6274
@polkcountymike6274 10 месяцев назад
Paul, I really appreciate your descriptions of what is going on under the hood. I understand accelerometers, but I didn't know it was done with ic technology. Thank you.
@luizbergo
@luizbergo 10 месяцев назад
Thanks sir, we may call this a Masterclass. Indeed, I've found problem with libs directory, change to lib and fix, "surprising" I've found measurement on z axis, but makes sense. What I noted is this is less than 1G, I think it's because I'm almost 1 thousand meters high from sea level. Thanks for the opportunity to learn with you.
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
Excellent
@singingadwita2846
@singingadwita2846 9 месяцев назад
I just hooked up to your channel and the details you take through are invaluable.
@nejatpolat
@nejatpolat 9 месяцев назад
I love this extra theoretical information. I have never heard of micro-mechanical devices built in chips. I thought only electronic devices were inside these chips. I follow your lessons with admiration, excitement, and a huge curiosity. My appreciation!
@paulmcwhorter
@paulmcwhorter 9 месяцев назад
Glad you enjoyed it!
@bobvines00
@bobvines00 10 месяцев назад
Paul, please continue explaining the details of subjects like MEMS and other items used with microcontrollers/SBCs that you cover!
@rickbonari4493
@rickbonari4493 10 месяцев назад
Great lesson Paul. Please continue with your great explanations including the math. This makes everything easier to understand. Thanks again for your awesome lessons and teaching skills and amazing technical knowledge !!!!!
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
More to come!
@jamescullins2709
@jamescullins2709 8 месяцев назад
I love the details and you do it so well!
@merrymonkey5172
@merrymonkey5172 10 месяцев назад
I really like your lessons. Simple, straightforward, very useful!
@philkelsall1207
@philkelsall1207 8 месяцев назад
19:16 Having work with accelerometers on an industrial scale. Great to hear how micro-electronic versions work
@qzorn4440
@qzorn4440 10 месяцев назад
A wonderful Acceleration video. Something that is used so much and I know very little about like drones? Let the games begin! 😎 Thank you.
@DrDave327
@DrDave327 10 месяцев назад
I always enjoy your videos when you are explaining what is happening under the hood, Paul!
@cbrombaugh
@cbrombaugh 10 месяцев назад
This is a great lesson! The explanation of how the accelerometers work is very interesting. Please include similar information in future lessons. I spent a couple hours with the libs issue and a couple operational problems, but adding the z-axis data was done in a couple minutes.
@reb13262
@reb13262 4 месяца назад
love these videos! Keep it up you are doing a wonderfull work!
@stephenlightkep1621
@stephenlightkep1621 10 месяцев назад
Thanks Paul. I love your MEMS and Hookes Law explanation. You rock. My prediction is not zero because of gravity.
@garethhunt6220
@garethhunt6220 10 месяцев назад
hi paul really appreciate classes, i love you taking the time to explain the math and physics of how these amazing devices work! how great it would have been to work on these in their infancy, would love to hear more on your works! - good stuff looking forward to the next lesson❤
@sirfredericksonfasbeangerp1673
@sirfredericksonfasbeangerp1673 10 месяцев назад
I love your lessons sir. I've just started learning about the Arduino board and your channel has helped me a lot
@edSabio572
@edSabio572 10 месяцев назад
Thanks Paul! I had a bit of a problem with Thonny loading the libraries but now everything works.
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
If you have trouble importing the library, rename libs to lib on the pico.
@MmWw-zk7hv
@MmWw-zk7hv 10 месяцев назад
Thank you sir for great videos.
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
My pleasure
@mobiletitan4484
@mobiletitan4484 10 месяцев назад
Sir my carrier changed by your Arduino tutorial 4years ago I really appreciate it and you are always mentor for me .
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
Keep it up!
@DrDave327
@DrDave327 10 месяцев назад
I predict the mpu6050 will be sensing a positive G force of 1, from the force of the tabletop supporting it, keeping it from falling. I had a mishap with my PicoW connection and regret I cannot complete the homework this week. Thanks for the great content, Paul!!!!
@louisdirect
@louisdirect 10 месяцев назад
I had to rename the subfolder ''libs'' as ''lib'' to get the program to run from the root folder. We are going to have lots of fun with the MPU6050.
@ilagallainebenedictc.2830
@ilagallainebenedictc.2830 10 месяцев назад
really love this man, much respect!
@zflipside
@zflipside 10 месяцев назад
OMG!! You're TEACHING RASBERRY PI TOO!!! THANK YOU SO MUCH ;u; SIR You're a blessing!!!!
@leeg.1402
@leeg.1402 10 месяцев назад
Great lesson Paul, Thanks.
@davidbosserman3247
@davidbosserman3247 7 месяцев назад
Rumble is the new free speach YT for the moment.
@scottwait3585
@scottwait3585 10 месяцев назад
Thank you so much Paul!
@AleksandrIvin
@AleksandrIvin 10 месяцев назад
Nice lesson!
@pieretjo
@pieretjo 9 месяцев назад
brilliant
@freddyveza
@freddyveza 5 месяцев назад
I have that IMU from Sunfounder's Raphael Kit (RPi Kit). X and Y axes are returning negative on the direction pointed for those little arrows marked on PCB, just the opposite you mentioned on 34:09, only Z axis works properly
@freddyveza
@freddyveza 5 месяцев назад
Forget it, everything is working fine...
@deniszawad
@deniszawad 10 месяцев назад
Fun fun fun
@crs1548
@crs1548 10 месяцев назад
I love looking under the hood!
@crj9416
@crj9416 10 месяцев назад
I also like the "under the hood" discussions. I didn't make a video but when I added the Z-axis, it reads 1G which is expected because the force of gravity is normal (down) toward the earth. Also when I turned the breadboard on any of the edges, the Z-axis becomes 0G and either the X-axis or Y-axis becomes +/-1G depending on the board orientation.
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
Which means we could use it to make a . . . ?
@crj9416
@crj9416 10 месяцев назад
@@paulmcwhorter a level
@johnsnow7043
@johnsnow7043 10 месяцев назад
Please make tutorial on the FreeRTOS And Embedded Linux You are the best teacher ever i found. If you have paid version i am ready to pay. Please 🙏 please 🙏
@EETechStuff
@EETechStuff 10 месяцев назад
Absolutely brilliant. I'm not worthy 😁 What I've never understood about those nanometer-type mechanics is how it's possible to get, for example, super tiny springs that have the right combination of tininess and also the right amount of spring force for such a tiny "proof mass". And also the tiny wires which connect to the proof mass and substrate to measure capacitance. How can their presence not impact the motion of the mass? Every time I pick up my smart phone and it detects the acceleration and turns on the screen I'm scratching my head how it's possible. I guess I've always assumed that instead of springs it used some type of magnetic repulsion force. Thanks.
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
OK the answer is very complicated, but let me at least give a few simple answers. As far of tiny, understand that with IC manufacturing I can lay down a layer of material to almost atomic precision. That is, the thickenss of the layer is exactly what I want, within the thickness of an atom. Secondly, I can then etch it to create a structure in x and y to almost atomic precision. So the tiny spring I want is exact in width, height and length. Now as far as tiny wires to connect, the springs themselves are conductive, so I connect to the proof mass electrically through the springs themselves. The springs are the wires if you will. Matybe I should do a live stream on how these things are made in detail.
@EETechStuff
@EETechStuff 10 месяцев назад
@@paulmcwhorter Ahh, okay, conductive springs. Though my brain is exploding trying to imagine designing and fabricating atomic-level springs. Why not use magnets instead of springs, like when we see a repelling magnet hovering above another magnet? Thanks much!!
@TheTechRancher
@TheTechRancher 10 месяцев назад
@@paulmcwhorter I would enjoy a live stream on this.
@user-oe5kp5ee5m
@user-oe5kp5ee5m 10 месяцев назад
Can arduino be used to implement in a product that should work 27x7???
@rupadarshisamanta3288
@rupadarshisamanta3288 7 месяцев назад
Traceback (most recent call last): File "", line 6, in File "/lib/imu.py", line 95, in __init__ MPUException: No MPU's detectedTraceback help me to get over this error please.
@taurus548
@taurus548 10 месяцев назад
No I don't hate it!
@alialebady2376
@alialebady2376 10 месяцев назад
Hello sir. I want class about Kallman filter plz
@arnoldschmucker9977
@arnoldschmucker9977 10 месяцев назад
I had a problem while using a PC with Windows 11. The Thonny didn't recognize the directory /libs. I had to change the directory to simply /lib to get it to work. Any thoughts?
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
People are reporting that. So, yes if you have the problem, rename libs to lib.
@rupadarshisamanta3288
@rupadarshisamanta3288 7 месяцев назад
When i run the program it always throws an error like : MPUException: No MPU's detected. I did everything perfectly, can anybody help me to get over this ?
@user-oe5kp5ee5m
@user-oe5kp5ee5m 10 месяцев назад
can you do a tutorial for Arduino Mega?
@jwaddin
@jwaddin 7 дней назад
Do u have a video how to make this coffee?
@paulmcwhorter
@paulmcwhorter 7 дней назад
Should do that one of these days.
@Fbarrett
@Fbarrett 10 месяцев назад
Anybody else get this error? File "", line 1, in ImportError: no module named 'imu'
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
If you have trouble importing the library, rename libs to lib on the pico.
@Fbarrett
@Fbarrett 10 месяцев назад
@@paulmcwhorter Thanks Paul .It works now.
@richardvanworkum4964
@richardvanworkum4964 10 месяцев назад
I created the lips directory and added the Kepler libraries. The pick w file structure looks exactly like in the video. When I try to import imu I get an error - no module named imu. Any lead of what the problem might be? Thanks.
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
If you have trouble importing the library, rename libs to lib on the pico.
@richardvanworkum4964
@richardvanworkum4964 10 месяцев назад
Changing libs to lib worked. Thanks Paul.😊
@bigbogeyface
@bigbogeyface 10 месяцев назад
Here's my homework: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-jmbA3FXizSc.htmlsi=icliv1u1rSjzC83w I have recorrelated the Axis to align with general consensus 🤷🤷🤷
@TheTechRancher
@TheTechRancher 10 месяцев назад
Homework Solution Link: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE--xruJ5hRZSw.html Thanks Paul for the great explanation on under the hood of the MPU6050
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
LEGEND!
@patrickfox-roberts7528
@patrickfox-roberts7528 10 месяцев назад
hmmm 9.81 appears ?? :)
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
hmmm . . . we will learn more next week.
@briankelly4095
@briankelly4095 5 месяцев назад
I'm very late handing in my assignments Paul. Life gets in the way sometimes. But I will catch up! Here's my homework for Lesson 40 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-paxBIhAeAgI.html Please continue explaining the math & physics in your lessons. It's important that people understand the principles behind the technology. Thanks for all your hard work. PS - I like the new trailer, the armed guards were a bit of a surprise. And did Suno create your soundtrack from a lyric sheet ?!? . I'd like to hear about the creation process.
@paulmcwhorter
@paulmcwhorter 5 месяцев назад
LEGEND!
@LiamAllbright
@LiamAllbright 10 месяцев назад
Why has no one commented yet-
@paulmcwhorter
@paulmcwhorter 10 месяцев назад
I review all comments before publishing them. So, lots of people had commented, I had just not reviewed. I review comments once a day.
@jbelmont72
@jbelmont72 9 дней назад
I'm hoping someone can offer some insight. I have made numerous attempts to follow the tutorial and have done so to the 'T.' I have changed the chip address in the imu.py library to reflect mine. I get this persistent error( I thought I addressed the 'chip_id' in line 158 by changing the i2c address to mine) : I2C SCANNER i2c devices found: 1 I2C hexadecimal address: 0x68 Traceback (most recent call last): File "", line 19, in File "/lib/imu.py", line 105, in _init_ File "/lib/imu.py", line 158, in chip_id MPUException: I2C failure when communicating with IMU this is the simplified program I am trying to run: from imu import MPU6050 from machine import I2C,Pin import time i2c=I2C( 0,sda=Pin(16), scl=Pin(17), freq=400000) print('I2C SCANNER') devices = i2c.scan() if len(devices) == 0: print("No i2c device !") else: print('i2c devices found:', len(devices)) for device in devices: print("I2C hexadecimal address: ", hex(device)) time.sleep(.2) mpu = MPU6050(i2c) while True: xAccel=round(mpu.accel.x,1) yAccel=round(mpu.accel.y,1) print('x: ',xAccel,' G ', 'y: ',yAccel,' G') time.sleep(.1) Using Thonny as well as VS code with micro-pico
Далее
Bacon на громкость
00:47
Просмотров 53 тыс.
Bike vs Super Bike Fast Challenge
00:30
Просмотров 10 млн
Let's Get Started with the PICO W
19:40
Просмотров 8 тыс.
RP2040 - PIO and Bare Metal Programming - BMA06
24:09
Просмотров 2,4 тыс.
Hacking my garage door with the Raspberry Pi Pico W
11:50
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18
Bacon на громкость
00:47
Просмотров 53 тыс.