I could see the acceleration values in Live View tab. For testing purposes, it worked fine. Thanks for sharing
@woldecosgrove3 ай бұрын
Hello, i try this on H723 Nucleo its not working at all... LCD is working but X, Y Z values are not changing...Why?
@tuannguyenhoanganh69822 жыл бұрын
Thank you very much, you makes me clearly know how does it work.
@ashotklekchyan4 ай бұрын
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 Жыл бұрын
hi why data array Rec_Data has type uint8_t, while sum of two first numbers of this array (Rec_Data[0]
@amadinsix73592 жыл бұрын
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-cp8wc9 ай бұрын
No value of check is being returned. Please help!
@muhammadhelmihanif97649 ай бұрын
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
@ruifazhou73004 жыл бұрын
很棒!非常感谢!
@anghao70504 жыл бұрын
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!
@Lucialunivers2 жыл бұрын
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
@syahputra17702 жыл бұрын
Hi sir, may I ask for code because the link you gave you can not be accessed
@anbuscientist46352 жыл бұрын
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.
@LSUDTechTelugu4 жыл бұрын
Can this be used for MPU6500(with stm32) as well or are there any register changes? has any one tried that?
@jiansun63414 жыл бұрын
pay more attention to the address of mpu6050 is 0xD0 not 0x68 in HAL, otherwise it will return HAL_ERROR
@gopalagrawal22703 жыл бұрын
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
@ControllersTech3 жыл бұрын
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
@jorgejacome42694 жыл бұрын
absolutely brilliant, thanks for all
@ControllersTech4 жыл бұрын
Thanks for the contribution man. Really appreciate it... 👍
@jorgejacome42694 жыл бұрын
@@ControllersTech I always say: Left hand help right hand and both wash my face
@tarkucar80402 жыл бұрын
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
@ControllersTech2 жыл бұрын
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)
@maulanawahyudi71273 жыл бұрын
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
@ControllersTech3 жыл бұрын
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.
@maulanawahyudi71273 жыл бұрын
@@ControllersTech ok sir, what if now i change the address with 0xD1 will HAL also add automatically too or will it be a problem?
@ControllersTech3 жыл бұрын
Nope. It only takes care of receive address.
@suleymanerdogan62712 жыл бұрын
The linker flags part does not appear at 15.38 minutes, can you help me?
@ControllersTech2 жыл бұрын
In cubeIDE, you can enable it in Properties-> C/C++ Build -> Settings -> MCUSetting. You will see the checkbox there to enable it.
@ed223-p5g4 жыл бұрын
i don't know how to calculate pitch, roll and yaw please help me
@SA-ys8eg3 жыл бұрын
can you build a reaction wheel following this code?
@anghao70504 жыл бұрын
thank you! I was successful.
@kenancanko4432 жыл бұрын
Hello mate did you made second video?
@babotvoj3 жыл бұрын
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?
@ControllersTech3 жыл бұрын
It doesn't go faster than 1KHz. If you read every 1 ms, that would be 1KHz.
@babotvoj3 жыл бұрын
@@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.
@ControllersTech3 жыл бұрын
Yeah you put a delay of 1 ms in the while loop
@babotvoj3 жыл бұрын
@@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.
@triumph63282 жыл бұрын
thank you!
@electronicsguy86093 жыл бұрын
Hello, thank you for the video, how can i find the part 2?, isit still in the making?
@ControllersTech3 жыл бұрын
There is no part 2..
@SANDJONG1232 жыл бұрын
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?
@ControllersTech2 жыл бұрын
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.
@SANDJONG1232 жыл бұрын
@@ControllersTech Understood. Thx for replying.
@user-ee6js5oh4n2 жыл бұрын
Excuse me, where do I go to find the header file "i2c-lcd.h" and the source file "i2c-lcd.c"?
@ControllersTech2 жыл бұрын
Link is in the description and files are in the src and inc folders..
@mohamedhassane634711 ай бұрын
Thank you sir
@pusatberk41935 жыл бұрын
Thank you !
@EmbeddedEnigma2 жыл бұрын
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
@ControllersTech2 жыл бұрын
Because that's the address of the slave (mpu6050)
@EmbeddedEnigma2 жыл бұрын
@@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?
@ControllersTech2 жыл бұрын
Because Arduino takes 7 bit address. STM needs 8 bits (7 bits + read/write)
@EmbeddedEnigma2 жыл бұрын
@@ControllersTech thank you
@cristiansandor44354 жыл бұрын
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.
@achoangnguyen87964 жыл бұрын
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.
@cristiansandor44354 жыл бұрын
@@achoangnguyen8796 Hi, no I did not continue this project. Sorry
@ControllersTech4 жыл бұрын
Check tha address. Also check the connections. Use 4K7 pull up resistors on the sck and sda lines
@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 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
You can define the variable as static.. For eg- Static float angle;
@startobytes3 жыл бұрын
can you make a Video about the 16x2 i2c LCD without this library?!
@ControllersTech3 жыл бұрын
It's already there on my channel search it
@franciscotoapanta39264 жыл бұрын
if i using cubeide, and i couldn't found the part that said linker flags where i can put the -u _printf_float
@ControllersTech4 жыл бұрын
It's in project setting -> c/c++ build -> setting -> tool setting -> mcu setting and enable u printf float
4 жыл бұрын
Window not?
@ManojKumar-mg5wb5 жыл бұрын
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..
@ControllersTech5 жыл бұрын
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 Жыл бұрын
@@ControllersTech Any joy with porting DMP to STM32?
@lexxyar5 жыл бұрын
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?
@ControllersTech5 жыл бұрын
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
@lexxyar5 жыл бұрын
@@ControllersTech Thx for answer. I'll try it... again :)
@yusufaksel-27375 жыл бұрын
@@ControllersTech you did not do it yet right?
@andrews56304 жыл бұрын
Hi, how to convert angular velocity to regular angle?
@ControllersTech4 жыл бұрын
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)
@animalinwildlife4 жыл бұрын
How can i download these libraries ?? Pls help me, thank you !!!
@ControllersTech4 жыл бұрын
Goto the link in the description.. at the end of the post, there is a download button
@Lucialunivers2 жыл бұрын
Hi, is it possible to plot the acceleration and gyroscope curve?
@ControllersTech2 жыл бұрын
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
@Lucialunivers2 жыл бұрын
@@ControllersTech Okay, thanks! I'll give it a try.
@Lucialunivers2 жыл бұрын
@@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
@abutaymiyyahlectures3 жыл бұрын
hey can i know where did we innitialize Accel_X_RAW ,Accel_Y_RAW & Accel_Z_RAW?
@ControllersTech3 жыл бұрын
Right click on it and goto declaration
@abutaymiyyahlectures3 жыл бұрын
@@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 !!
@ControllersTech3 жыл бұрын
it's there... at the bottom of the page
@abutaymiyyahlectures3 жыл бұрын
@@ControllersTech yup i found it just a second ago, there is a downlaod button. Thank you
@pawel123133 жыл бұрын
does not work check stays as 0
@egar19563 жыл бұрын
It is redundant WHO_AM_I register, I think. Because if I'm not address it correctly, the device will not ACK
@ControllersTech3 жыл бұрын
I don't think that affects it. That's just to confirm if the device is connected and is responding
@Muhammad-qf9vl2 жыл бұрын
@@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-oo5pq7xb7f4 жыл бұрын
what Os?
@betulguncaldi46763 жыл бұрын
how will the sensor be filtered?
@ControllersTech3 жыл бұрын
What you mean filtered ?
@betulguncaldi46763 жыл бұрын
@@ControllersTech I want to filter my pressure, acceleration sensors. Is this something done during coding?
@ControllersTech3 жыл бұрын
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
@betulguncaldi46763 жыл бұрын
@@ControllersTech thank you anyway, I couldn't explain myself.