How to use MPU6050 with Raspberry Pi Pico (End to End)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so in order to make the physical connection between your mpu-650 and the Raspberry Pi Pico W it's pretty straightforward you just need four jumper wires I'm gonna link the ones I bought on Amazon that I used for this video they're pretty cheap and you can use a breadboard for this you don't have to you can make the connection straight to the Raspberry Pi Pico but I'm just using a breadboard for the sake of organization for this video and as you can also see I have my Raspberry Pi plugged in to the power source which is my computer right now and I just have my four pins set up like this so I have two on the top left here on pins one and two and these are for the interfacing with the signals from the mp650 and on the other side I have red which is the power and then I have black which is ground and these are for of course uh uh handling the power for the mp650 so it's pretty straightforward but just to note here I'm not using the top right most pin there so I'm actually using pin 39 for the red pin pin 38. so don't get confused it's not the top right most pin where I started these two uh jumper wires it's uh the second to top right most so I start the red one here which is pin 39 and then pin 38 and I'll link a schematic of uh how the pins are organized and the Raspberry Pi Pico in the description below so if you're still confused about that and correspondingly on the mpu650 as you can see here um we have the red connecting to V VOC or VCC as you can see there we have black connected to ground and we have the other two signal processor jumper wires connected to SDA and scl so white is connected to SDA and then yellow is connected to SEO and if everything's set up properly you should see that red uh power sign on the mp650 showing everything is working and then that being said I hope it's clear there let's jump straight to the code all right so in order to start interfacing with your mp650 now that it's physically connected you just want to have thoni set up and you want to have your Raspberry Pi Pico connected as you can see here mine is connected I just connected it via USB or micro USB to my Mac and you'll know it's connected if you see this on the bottom left you'll have the files for your Raspberry Pi Pico there and I just have two files here that you need and or that I used to do this whole interaction with the mp650 so I have this Library code which I found online as you can see it's copyrighted by Sebastian Plummer that's it's very popular online to interface with the mp650 we're not going to go into the scope of this because it's uh it's beyond the scope of this video but the main thing you want to focus on is this main file I have here you can ignore these two lines here I just have this code here to show that my my Raspberry Pi Pico is turned on this is just turning LED on as you guys saw previously my LED was automatically on this was thanks to this line of code in my main file other than that we just import IMU from the imu.pi file as you can see I have IMU on my Raspberry Pi Pico and I have other Imports here I have time I import sleep and from machine I import pin and the reason I import that is so I can know the corresponding SDA and scl pins on my Raspberry Pi Pico W interface with the mpu650 so as you guys saw before we had the the white and yellow corresponding to SDA and scl respectively and then we have this IMU object which is uh created with the IMU Library here and once that's done and you have all the pins set up and everything is good you should be able to run this while loop here which just prints out all the values and I'm just rounding here the values and I'm printing them out a nice format and I'm generating new values every 0.2 seconds so if you decrease this it'll it'll so if I make it 0.1 seconds it'll show me values more frequently if I make it one second it'll show me the updates and acceleration more frequently so as you can see here I have acceleration at a x a y a z and I have the the angular acceleration g x g y g z and interestingly the mp650 also has a temperature sensor it's not that accurate but you can still get temperature readings from it to some degree of accuracy and that's pretty much it guys and for those of you guys who didn't see the library code or the or don't want to copy all this code I'm going to have it linked in the description below this you can find online but I'll still Link in the description on my GitHub page and I'm just going to go ahead and run this and show you that it works so let's go ahead and run it and as you can see it's printing out values here on the bottom and I'm just going to move my mp650 you guys can't see it but I'm moving it now and the more I move it the more you see the values change the temperature is fairly consistent it's a it's around I think 23.5 degrees Celsius so if you did everything from the beginning to the end and you have Micro python installed and you have all your Hardware set up this should work let me know what you guys think in the comments down below let me know if you like this video please like comment subscribe and stay tuned to this YouTube channel thanks for watching guys
Info
Channel: Shilleh
Views: 3,867
Rating: undefined out of 5
Keywords: mpu6050 raspberry pi pico, mpu6050 raspberry pi pico w, mpu6050, how to connect mpu6050 to raspberry pi, mpu6050 micropython pico, raspberry pi pico, mpu6050 pi pico, mpu6050 code, mpu6050 with raspberry pi, micropython mpu6050, thonny mpu6050, raspberry pi pico connect accelerometer, raspberry pi pico connect mpu, raspberry pi pico connect mpu6050, raspberry pi pico w connect mpu6050, raspberry pi, motion sensor
Id: HezXoT12E40
Channel Id: undefined
Length: 5min 5sec (305 seconds)
Published: Tue Dec 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.