No video

Interface MPU6050/GY-521 with STM32 || LCD 20x4 || CubeMx || HAL || SW4STM

  Рет қаралды 44,931

ControllersTech

ControllersTech

Күн бұрын

Пікірлер: 99
@egar1956
@egar1956 3 жыл бұрын
I could see the acceleration values in Live View tab. For testing purposes, it worked fine. Thanks for sharing
@woldecosgrove
@woldecosgrove 3 ай бұрын
Hello, i try this on H723 Nucleo its not working at all... LCD is working but X, Y Z values are not changing...Why?
@tuannguyenhoanganh6982
@tuannguyenhoanganh6982 2 жыл бұрын
Thank you very much, you makes me clearly know how does it work.
@ashotklekchyan
@ashotklekchyan 4 ай бұрын
After HAL_Init(); in main , stm32 out off order, i have test next block again chip out of order.. i am block ///HAL_Init(); every thing work correct..Thank
@lonny_breaux
@lonny_breaux Жыл бұрын
hi why data array Rec_Data has type uint8_t, while sum of two first numbers of this array (Rec_Data[0]
@amadinsix7359
@amadinsix7359 2 жыл бұрын
Thank you very much. You just helped me alot with this video. But I have a littke problem because the values that I get are a little bit high and if I want to calculate the momentary angle, it just keep counting up. Could someone help me?
@Mustafa-cp8wc
@Mustafa-cp8wc 9 ай бұрын
No value of check is being returned. Please help!
@muhammadhelmihanif9764
@muhammadhelmihanif9764 9 ай бұрын
hello , its very helpfull video , but do u have any suggestion if i want to get the data exactly 1K data per second ( 1 Khz ) or 500 Hz
@ruifazhou7300
@ruifazhou7300 4 жыл бұрын
很棒!非常感谢!
@anghao7050
@anghao7050 4 жыл бұрын
I have a problem. When I turn on USB FS and set clock 48MHz, I can't communication with I2C. please tell me why. thank you so much!
@Lucialunivers
@Lucialunivers 2 жыл бұрын
In fact you have configured the MPU6050 in one of your videos I would like to know how to get a curve from it. If you could make a small video to show how to get a curve of the gyro and acceleration parameters. Thanks
@syahputra1770
@syahputra1770 2 жыл бұрын
Hi sir, may I ask for code because the link you gave you can not be accessed
@anbuscientist4635
@anbuscientist4635 2 жыл бұрын
Thank you for a very informative tutorial, I tried the same way to communicate with my accelerometer, but i can't able to get output from my port. While at compiling it shows o errors and 0 warnings and successfully deployed, but i can't able to get any output form the module. And the LD4 in ST link continues to blink from green to red, even during debugging. Can you help me to sort out the issue. And at I did step into debug, which shows variables have a value both raw and float, but if I try to print those values via putty, its not showing anything. And it seems to be like constant.
@LSUDTechTelugu
@LSUDTechTelugu 4 жыл бұрын
Can this be used for MPU6500(with stm32) as well or are there any register changes? has any one tried that?
@jiansun6341
@jiansun6341 4 жыл бұрын
pay more attention to the address of mpu6050 is 0xD0 not 0x68 in HAL, otherwise it will return HAL_ERROR
@gopalagrawal2270
@gopalagrawal2270 3 жыл бұрын
I am getting the wrong values while interfacing MPU6050 Accelerometer with STM32F446RE. For Example for value of X, Y, Z axis as 0 , 0, 1 i am getting 0, 3.16, 1 for 0 ,1, 0 i am getting 3.16, 3.16, 0 and so on i am continuously getting this unexpected 3.16. i have chosen accelerometer range as +/-2g, I2C1 peripheral with Standard mode and 50% duty cycle and APB1 clock as 16MHz help me in getting my values correctly
@ControllersTech
@ControllersTech 3 жыл бұрын
If you are continuously getting same value, that means your configuration is not right. Check the calculation part for for the range you have chosen
@jorgejacome4269
@jorgejacome4269 4 жыл бұрын
absolutely brilliant, thanks for all
@ControllersTech
@ControllersTech 4 жыл бұрын
Thanks for the contribution man. Really appreciate it... 👍
@jorgejacome4269
@jorgejacome4269 4 жыл бұрын
@@ControllersTech I always say: Left hand help right hand and both wash my face
@tarkucar8040
@tarkucar8040 2 жыл бұрын
hi, I try a little to get euler angles from dmp(digital motion processor) but I couldn't do that. do you know how I can get that from easy way? any source or whatever? I will use complementary filter or mahony filter if dmp is so exhausting. thanks in advance
@ControllersTech
@ControllersTech 2 жыл бұрын
I didn't tried it. I tried some algorithms to stabilize the gyro, but that didn't worked. I will try it again after few days ( I am out of my workstation right now)
@maulanawahyudi7127
@maulanawahyudi7127 3 жыл бұрын
Please correct me if I am wrong in a statement or otherwise, #define MPU6050_ADDR 0xD0 where the value 0xD0 is obtained from 7 bits + RW . From 7 bits (MSB) depending on pin level AD0, in this case let's say 0x68(AD0 at low level). and RW means do we want to write or read, my question is when we use "HAL_I2C_Mem_Write" do we keep using 0xD0 and not using 0xD1? Thank you sir I'm a beginner to learn STM and MPU sensors
@ControllersTech
@ControllersTech 3 жыл бұрын
The R/W bit should be 0 for write and 1 for read. But we don't need to worry about the read address. The HAL adds that 1 during the read operation.
@maulanawahyudi7127
@maulanawahyudi7127 3 жыл бұрын
@@ControllersTech ok sir, what if now i change the address with 0xD1 will HAL also add automatically too or will it be a problem?
@ControllersTech
@ControllersTech 3 жыл бұрын
Nope. It only takes care of receive address.
@suleymanerdogan6271
@suleymanerdogan6271 2 жыл бұрын
The linker flags part does not appear at 15.38 minutes, can you help me?
@ControllersTech
@ControllersTech 2 жыл бұрын
In cubeIDE, you can enable it in Properties-> C/C++ Build -> Settings -> MCUSetting. You will see the checkbox there to enable it.
@ed223-p5g
@ed223-p5g 4 жыл бұрын
i don't know how to calculate pitch, roll and yaw please help me
@SA-ys8eg
@SA-ys8eg 3 жыл бұрын
can you build a reaction wheel following this code?
@anghao7050
@anghao7050 4 жыл бұрын
thank you! I was successful.
@kenancanko443
@kenancanko443 2 жыл бұрын
Hello mate did you made second video?
@babotvoj
@babotvoj 3 жыл бұрын
Hello, I want to process the signal from the accelerometer. Because the read function is in the main loop which goes at a much faster rate than the 1kHz defined for the accelerometer, will the samples be red multiple times? Should interrupts or DMA be used to get samples at the exact sampling rate I want?
@ControllersTech
@ControllersTech 3 жыл бұрын
It doesn't go faster than 1KHz. If you read every 1 ms, that would be 1KHz.
@babotvoj
@babotvoj 3 жыл бұрын
@@ControllersTech hello, but to restrict it to read every 1ms you would need a delay or a timer interrupt. Otherwise it would sample as fast as the while loop goes. That's how I understood it.
@ControllersTech
@ControllersTech 3 жыл бұрын
Yeah you put a delay of 1 ms in the while loop
@babotvoj
@babotvoj 3 жыл бұрын
@@ControllersTech thanks for the reply, I have 1 just one more question, does it make sense to work with timer interrupts or DMA to get the sampling timing more accurate.
@triumph6328
@triumph6328 2 жыл бұрын
thank you!
@electronicsguy8609
@electronicsguy8609 3 жыл бұрын
Hello, thank you for the video, how can i find the part 2?, isit still in the making?
@ControllersTech
@ControllersTech 3 жыл бұрын
There is no part 2..
@SANDJONG123
@SANDJONG123 2 жыл бұрын
Hello Controllers Tech! First of all I'd like to thank you for your video. I have encountered some problems with the displaying part of the accel value. 1. After I builded the programm, I received an error. "buf" is undeclared. I cant recalled you declared a char volatile buf variable to use it in the sprintf function, or? 2. I dont get any value on the display. What could be the problem? Does anyone else encountered this?
@ControllersTech
@ControllersTech 2 жыл бұрын
You should work on them separately first and then combine the codes. Better focus on LCD alone and when you understand it, then check the MPU6050.
@SANDJONG123
@SANDJONG123 2 жыл бұрын
@@ControllersTech Understood. Thx for replying.
@user-ee6js5oh4n
@user-ee6js5oh4n 2 жыл бұрын
Excuse me, where do I go to find the header file "i2c-lcd.h" and the source file "i2c-lcd.c"?
@ControllersTech
@ControllersTech 2 жыл бұрын
Link is in the description and files are in the src and inc folders..
@mohamedhassane6347
@mohamedhassane6347 11 ай бұрын
Thank you sir
@pusatberk4193
@pusatberk4193 5 жыл бұрын
Thank you !
@EmbeddedEnigma
@EmbeddedEnigma 2 жыл бұрын
Hi, I created my own I2c library in stm32f I am doing bare metal, the only confusion I have is that my stm32 only detects mpu6050 when I give it address (0x68
@ControllersTech
@ControllersTech 2 жыл бұрын
Because that's the address of the slave (mpu6050)
@EmbeddedEnigma
@EmbeddedEnigma 2 жыл бұрын
@@ControllersTech yes I know that but I mean while check slave address on arduino we give 0x68 but on stm32 we have to shift 1 bit why is that?
@ControllersTech
@ControllersTech 2 жыл бұрын
Because Arduino takes 7 bit address. STM needs 8 bits (7 bits + read/write)
@EmbeddedEnigma
@EmbeddedEnigma 2 жыл бұрын
@@ControllersTech thank you
@cristiansandor4435
@cristiansandor4435 4 жыл бұрын
Hi, It's a good tutorial, thanks Anyway, I'm trying to make this working together with a LCD display and a PCF8574 module. Both working except GY521. I tried to debug and I found I get HAL_Status error in the call of I2C_WaitOnFlagUntilTimeout in stmf1xx_hal_i2c.c . This is insider of first call of HAL_I2C_Mem_Read I will buy another GY521,... only thing I can think of is the module is faulty.
@achoangnguyen8796
@achoangnguyen8796 4 жыл бұрын
Hi sir , i read your comment and i think i get the same error .. Did you buy another GY521 ? and Did it work after that ? Thanks.
@cristiansandor4435
@cristiansandor4435 4 жыл бұрын
@@achoangnguyen8796 Hi, no I did not continue this project. Sorry
@ControllersTech
@ControllersTech 4 жыл бұрын
Check tha address. Also check the connections. Use 4K7 pull up resistors on the sck and sda lines
@cristianmelian4655
@cristianmelian4655 Жыл бұрын
Great video! Maybe just a small clarification if it's possible, I'm not so good at coding. Maybe someone could explain. For example for acceleration: How do we get the reading for all the axes both for H and L part, given the fact that there is only one command where only the ACCEL_XOUT_H_REG is read? How does this command "HAL_I2C_Mem_Read (&hi2c1, MPU6050_ADDR, ACCEL_XOUT_H_REG, 1, Received_Data, 6, 1000);" knows that I also want to read ACCEL_XOUT_L_REG, ACCEL_YOUT_H_REG, ACCEL_YOUT_L_REG and so on...? Thanks!
@ControllersTech
@ControllersTech Жыл бұрын
In that function we are reading 6 registers starting from the ACCEL_H_REG. If you check the datasheet of the device, you will find out the next 5 registers.
@cristianmelian4655
@cristianmelian4655 Жыл бұрын
@@ControllersTech Thanks! And one more thing regarding the values of the gyro. I have managed to build the setup but from what I see the generated values doesn't take into consideration the previous value. If for example I move the gyro at a certain angle I can see an instant change in the value but if I keep the senzor in the same position then the next values will start from zero instead of taking into consideration the angle. Did you manage to solve this issue? I know from Arduino implementation that the read values took into account the position of the sensor instead of creating a reference to zero at each new reading. Thanks!
@ControllersTech
@ControllersTech Жыл бұрын
You can define the variable as static.. For eg- Static float angle;
@startobytes
@startobytes 3 жыл бұрын
can you make a Video about the 16x2 i2c LCD without this library?!
@ControllersTech
@ControllersTech 3 жыл бұрын
It's already there on my channel search it
@franciscotoapanta3926
@franciscotoapanta3926 4 жыл бұрын
if i using cubeide, and i couldn't found the part that said linker flags where i can put the -u _printf_float
@ControllersTech
@ControllersTech 4 жыл бұрын
It's in project setting -> c/c++ build -> setting -> tool setting -> mcu setting and enable u printf float
4 жыл бұрын
Window not?
@ManojKumar-mg5wb
@ManojKumar-mg5wb 5 жыл бұрын
The readings are coming but the values are unreliable, Can you help me to config it? Also you have commented the gyro config ..should we enable it for good values..
@ControllersTech
@ControllersTech 5 жыл бұрын
Right now only acceleration values are usable. I tested some theories and some other methods to calibrate gyro but wasn't successful. They always drift away 🤦‍♂️. I will soon start working on dmp port from arduino. That will definitely stabilize the gyro
@kazimkhan4259
@kazimkhan4259 Жыл бұрын
@@ControllersTech Any joy with porting DMP to STM32?
@lexxyar
@lexxyar 5 жыл бұрын
Hi friend. First of all thx for this video. Could you show, how to measure current angle? I measure ticks at start loop and end loop. Get difference between ticks. Then I get gyro dps and multiply on tick difference. The result I add to float vareable. Unfortunately, I didn't get axpected result. Could you help me?
@ControllersTech
@ControllersTech 5 жыл бұрын
There are lot of errors and other things to be taken into consideration while measuring angle. Like I mentioned in the video I'll make another one involving all those things soon. Or you can refer any arduino based code and port it. It should work
@lexxyar
@lexxyar 5 жыл бұрын
@@ControllersTech Thx for answer. I'll try it... again :)
@yusufaksel-2737
@yusufaksel-2737 5 жыл бұрын
@@ControllersTech you did not do it yet right?
@andrews5630
@andrews5630 4 жыл бұрын
Hi, how to convert angular velocity to regular angle?
@ControllersTech
@ControllersTech 4 жыл бұрын
I have to start working on the angle part. I forgot as it was due for a while. The problem is that the error get developed in the gyro as the time passes. There are some algorithms to solve the issue. I'll take a look. If you want to use angular velocity to do so, you can use the formula (w = ∆theta/∆t)
@animalinwildlife
@animalinwildlife 4 жыл бұрын
How can i download these libraries ?? Pls help me, thank you !!!
@ControllersTech
@ControllersTech 4 жыл бұрын
Goto the link in the description.. at the end of the post, there is a download button
@Lucialunivers
@Lucialunivers 2 жыл бұрын
Hi, is it possible to plot the acceleration and gyroscope curve?
@ControllersTech
@ControllersTech 2 жыл бұрын
yes but you need some application which can do the plotting for you. Then use uart to send the data to the app and it will plot the curve
@Lucialunivers
@Lucialunivers 2 жыл бұрын
@@ControllersTech Okay, thanks! I'll give it a try.
@Lucialunivers
@Lucialunivers 2 жыл бұрын
@@ControllersTech In fact you have configured the MPU6050 in one of your videos I would like to know how to get a curve from it. If you could make a small video to show how to get a curve of the gyro and acceleration parameters. Thanks
@abutaymiyyahlectures
@abutaymiyyahlectures 3 жыл бұрын
hey can i know where did we innitialize Accel_X_RAW ,Accel_Y_RAW & Accel_Z_RAW?
@ControllersTech
@ControllersTech 3 жыл бұрын
Right click on it and goto declaration
@abutaymiyyahlectures
@abutaymiyyahlectures 3 жыл бұрын
@@ControllersTech ooo okay, can i know where i can find your sample code?, because on your website i cant seem to find it(the one you put on your discription), anyways, thanks for your awesome tutorial, it helped me a lot !!
@ControllersTech
@ControllersTech 3 жыл бұрын
it's there... at the bottom of the page
@abutaymiyyahlectures
@abutaymiyyahlectures 3 жыл бұрын
@@ControllersTech yup i found it just a second ago, there is a downlaod button. Thank you
@pawel12313
@pawel12313 3 жыл бұрын
does not work check stays as 0
@egar1956
@egar1956 3 жыл бұрын
It is redundant WHO_AM_I register, I think. Because if I'm not address it correctly, the device will not ACK
@ControllersTech
@ControllersTech 3 жыл бұрын
I don't think that affects it. That's just to confirm if the device is connected and is responding
@Muhammad-qf9vl
@Muhammad-qf9vl 2 жыл бұрын
@@ControllersTech Hello.Thank you for your great tutorial! I tried a lot but i couldn't receive correct data from MPU6050. I followed everything that you said. Also why do you Define MPU address D0? shouldn't it be 0x68 or 0x69? Regards
@user-oo5pq7xb7f
@user-oo5pq7xb7f 4 жыл бұрын
what Os?
@betulguncaldi4676
@betulguncaldi4676 3 жыл бұрын
how will the sensor be filtered?
@ControllersTech
@ControllersTech 3 жыл бұрын
What you mean filtered ?
@betulguncaldi4676
@betulguncaldi4676 3 жыл бұрын
@@ControllersTech I want to filter my pressure, acceleration sensors. Is this something done during coding?
@ControllersTech
@ControllersTech 3 жыл бұрын
I still don't understand what you mean by filter the acceleration.. But anyway yes you have to do all at the time of coding itself. If your query is more related to sensor, you can check the datasheet. There might be some register which can help you
@betulguncaldi4676
@betulguncaldi4676 3 жыл бұрын
@@ControllersTech thank you anyway, I couldn't explain myself.
PART I: STM32 HAL I2C and MPU6050 IMU
13:49
Steppe School
Рет қаралды 19 М.
managed to catch #tiktok
00:16
Анастасия Тарасова
Рет қаралды 20 МЛН
WORLD'S SHORTEST WOMAN
00:58
Stokes Twins
Рет қаралды 179 МЛН
Harley Quinn's desire to win!!!#Harley Quinn #joker
00:24
Harley Quinn with the Joker
Рет қаралды 7 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 102 МЛН
SSD1306 OLED and STM32 || 128x64 || SW4STM || CubeMX
14:22
ControllersTech
Рет қаралды 52 М.
The Clever Way to Count Tanks - Numberphile
16:45
Numberphile
Рет қаралды 939 М.
#76 MPU6050 3-Axis Accelerometer Gyro - First Look
18:27
Ralph S Bacon
Рет қаралды 21 М.
STM32 + OLED = Display Anything
18:01
Nick Electronics
Рет қаралды 18 М.
14 | Measure angles with the MPU6050 accelerometer
13:03
Carbon Aeronautics
Рет қаралды 140 М.
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 144 М.
LCD via I2C in STM32 || CUBEIDE || PCF8574
12:22
ControllersTech
Рет қаралды 79 М.
Arduino for STM32 + MPU-6050 == Improve your programming skills!
16:44
managed to catch #tiktok
00:16
Анастасия Тарасова
Рет қаралды 20 МЛН