Тёмный

ESP32 Web Server with MPU-6050 Accelerometer and Gyroscope (3D object representation) 

Rui Santos
Подписаться 69 тыс.
Просмотров 133 тыс.
50% 1

For complete project details (schematics + source code), visit ► RandomNerdTutorials.com/esp32...
In this project we’ll build a web server with the ESP32 to display readings from the MPU-6050 accelerometer and gyroscope sensor. We’ll also create a 3D representation of the sensor orientation on the web browser. The readings are updated automatically using Server-Sent Events and the 3D representation is handled using a JavaScript library called three.js. The ESP32 board will be programmed using the Arduino core.
Like my page on Facebook:
/ randomnerdtutorials
Follow me on twitter:
/ ruisantosdotme
Subscribe for more projects like this!
bit.ly/subscribeRNT
#ESP32 #ESP8266 #Arduino

Наука

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

 

6 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 132   
@romycruz4498
@romycruz4498 3 года назад
Thanks Rui. You're great. when I retire from my job, i am looking into making projs. as a hobby and a small business to earn for a living while getting old. I have also downloaded many of your tutorials. Thanks - Romy-Philippines.
@RuiSantosdotme
@RuiSantosdotme 3 года назад
You can find the complete project details (schematics + source code) on my blog ► RandomNerdTutorials.com/esp32-mpu-6050-web-server/ Build a web server with the ESP32 to display readings from the MPU-6050 accelerometer and gyroscope sensor. We’ll also create a 3D representation of the sensor orientation on the web browser. The readings are updated automatically using Server-Sent Events and the 3D representation is handled using a JavaScript library called three.js.
@dcpowered
@dcpowered 3 года назад
Great tutorial! I love videos about the MPU6050! Please post more!!
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you! I'm glad you liked it, we'll post more
@carlosbugs
@carlosbugs 3 года назад
its a coll project. a great approach to demonstrate the capabilities of the magnetometer + gyroscope sensor. keep doing good things like that :)
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you, I'm glad it was helpful!
@wimalmanage
@wimalmanage 2 года назад
Thanks for shearing. Highly appreciated.
@finnyfunplace824
@finnyfunplace824 3 года назад
very cool .. Many Thanks for sharing your efforts ..
@paulvint
@paulvint 3 года назад
That's a great demonstration! Fortunate timing for me too, as I recently ordered some MPU6050s for testing for a project. :)
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Happy to know it was published in good timing!
@HelmutNumberOne
@HelmutNumberOne 3 года назад
Super, thanks for sharing, good ESP32 projects are not found that often. thanks for that
@RuiSantosdotme
@RuiSantosdotme 3 года назад
You're welcome, thanks for watching
@EnglishLaw
@EnglishLaw 3 года назад
Check out Meshtastic
@Kaka-zs4cp
@Kaka-zs4cp 3 года назад
Hey, your ascent is getting better! Let me give you a tip, angular + webpack + websocket will make a weightless interface to the esp32 board! It’s just perfect
@Kaka-zs4cp
@Kaka-zs4cp 3 года назад
And gzip the files ! Everything gets super fast if you do
@avejst
@avejst 3 года назад
Great projektet 😊👍 Thanks for sharing your experience with all of us 👍😊
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you, I’m glad you liked it!
@johnhschuster
@johnhschuster 3 года назад
Most excellent video!! Your website has great matching content and is a great guide to show how to deliver learning content. Curiosity question, what software do you use to manage your website? Keep broadcasting!!
@papablopapapablo8123
@papablopapapablo8123 3 года назад
Cool. Could be useful connect two or three accelerometers and mix results.
@shoryavardhaangupta4607
@shoryavardhaangupta4607 5 месяцев назад
you should use the interrupt pin for digital motion processor
@prasunbiswas8025
@prasunbiswas8025 3 года назад
Nice tutorial. Do you have any tutorial for simulation of gyro MPU6050, in proteus ?
@charlesbarros8153
@charlesbarros8153 3 года назад
Rui, você fala um inglês excelente! Suas explicações são claras e objetivas! Parabéns pelo trabalho! 👏🏼👏🏼👏🏼👏🏼
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Muito obrigado Charles! Abraço!
@pravinchavhan8890
@pravinchavhan8890 3 года назад
@@RuiSantosdotme hi , i want to know how can i calulate number of 360 degree rotations completed by MPU6050 using arduino . it would be nice if u help me
@ahmadhasan3258
@ahmadhasan3258 3 года назад
Another Awesome Video! Thanks ALOT!
@RuiSantosdotme
@RuiSantosdotme 3 года назад
You're welcome, thanks for watching
@karolpala9522
@karolpala9522 3 года назад
@@RuiSantosdotme Is it possible to send data directly from ESP32 to mobile phone? So I could apply this sensor to rocket model in a safety distance from home
@juttomita
@juttomita Год назад
Rui, como faço com as portas de comunicação se eu estiver utilizando um nodemcu esp8266? Quais pinos serão utilizados para comunicar com o MPU6050
@javierpallalorden
@javierpallalorden 3 года назад
Excellent
@ArbaouiBillel
@ArbaouiBillel 3 года назад
Amazing I did it with smartphone as well, it was cool experience
@ArbaouiBillel
@ArbaouiBillel 3 года назад
I used javascript
@viniciusnoyoutube
@viniciusnoyoutube 3 года назад
Excellent!
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you!
@grommel5693
@grommel5693 3 года назад
can you use multiple gyroscope to precise the dynamic motion?
@prathambumb5593
@prathambumb5593 3 года назад
Excellent 👍🏻
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you, I’m glad you liked it
@itsSHKR
@itsSHKR Год назад
Use a complimentary filter between the accelerometer and gyro to get a better angle estimate
@dhiyaakmal7762
@dhiyaakmal7762 Год назад
Hi, can I ask you what is the code for the complementary filter that you put between gyro and accel?
@pravinchavhan8890
@pravinchavhan8890 3 года назад
hi , i want to know how can i calulate number of 360 degree rotations completed by MPU6050 using arduino . it would be nice if u help me
@diamtakselaluemas8650
@diamtakselaluemas8650 Год назад
thanks sir
@pedrovelazquez138
@pedrovelazquez138 3 года назад
Use a Kalman Filter to fuse gyroscope and accelerometer data.
@lecheelemental4739
@lecheelemental4739 3 года назад
Gracias.
@piconano
@piconano 3 года назад
The MPU-6050 has a DSP built in to it. I think it can run some sort of Kalman filter on the raw sensor data. I think the old Wii controller from 2008'ish used them. The gyros need to be reset when the accelerometers read no change in acceleration, and the gyros see no rotational changes, or something like that. That's to compensate for gyro drift. It gets too complicated for me. I tried to follow the ArduPilot code, and gave up in one day! The quitting force is strong in me...
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you, we will look into more detail in the upcoming weeks!
@argentinomacrifuevidaltamb3772
@argentinomacrifuevidaltamb3772 3 года назад
Excelente gracias!
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you!
@radarmusen
@radarmusen 3 года назад
Very nice
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you!
@thomasmclucas4723
@thomasmclucas4723 Год назад
Is there a way to use three.js to upload a custom 3d model rather than the blue cube? Would you be able to point me in the right direction for this please?
@everaldosilva6637
@everaldosilva6637 3 года назад
muito legal o projeto show de bola
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Obrigado!
@dalbyte
@dalbyte 3 года назад
fight the drift with the kalman filter
@scgsantos22
@scgsantos22 3 года назад
Thanks. I have to try it out.
@fredvanderreijden8759
@fredvanderreijden8759 3 года назад
Nice tutorial. I have uploaded your sketch to ESP32 (ESP-WROOM 32). It works fine until after a few minutes in the Serial Monitor I constantly get an error message: ERROR: Too many messages queued. I don't know what is causing this. Do you have any idea?
@arssra2454
@arssra2454 Год назад
how to use OLED 1306 with web server just to see parameters in oled and other parameters with shape in webserver?????
@RandoniumTJ
@RandoniumTJ Год назад
Hi. I have a question... How could i change the reference 3d model into something custom ...
@FPChris
@FPChris 3 года назад
Does this have yaw drift?
@patoromero1229
@patoromero1229 Год назад
Can you do the same program but with 6 accelerometers?
@djkadakamc1889
@djkadakamc1889 Год назад
I think my mpu6050 is broken. It drift a lor also if i leave it on the table without touch it.
@kaceypryor2326
@kaceypryor2326 2 года назад
What should I do when Connecting to Wi-fi will not connect to IP address?
@yogeshitaliya473
@yogeshitaliya473 3 года назад
Nice one
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you!
@yogeshitaliya473
@yogeshitaliya473 3 года назад
@@RuiSantosdotme your video all time good and Most useful
@nikhilkumar_2788
@nikhilkumar_2788 2 года назад
What is the data cable connected to?
@platek549
@platek549 2 года назад
Hi buddy.is there option using data from accelerometer for sending requests to APi ?
@pabllopires26
@pabllopires26 6 месяцев назад
Can I use the BMI160 instead of the MPU6050? Can you suggest a solution for measuring the acceleration of an automotive suspension system in real time and recording the data? Since the car will always be moving and it would have to be a "wireless" system. Can I use more then 1 sensor with the same board (ESP32)?
@yilberrojas8306
@yilberrojas8306 3 года назад
excellent, does it work on the esp8266?
@gustavovieira9082
@gustavovieira9082 3 года назад
Can I do this using my pc as the esp ?
@Thuliolima2008
@Thuliolima2008 3 года назад
Very Good
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thank you for watching!
@benissabika7807
@benissabika7807 3 года назад
@@RuiSantosdotme merci beaucoup de ce document
@wearesisterstube7354
@wearesisterstube7354 2 года назад
Great
@TheHarp11
@TheHarp11 3 года назад
Hi Rui. I appreciate your projects, they helped me a lot. Can you suggest me how to transfer data wirelessly every 10 milliseconds without stuttering (ECG data)? I tried to use websockets but sometimes it was shuttering. Will using SSE fix the problem? Or is it better to send the collected data in array (eg. from 1 second interval) to the MySQL database? (Data can be buffered, I don't need live broadcast.) Is it possible to draw a graph from an array of data stored in one cell or each value must be stored in a new database cell? Thank you for your work.
@bhupiistersingh4097
@bhupiistersingh4097 2 года назад
Did you solve it? If yes, how?
@hwhhamp9858
@hwhhamp9858 3 года назад
Hi, as the drift is always related to one of the axis, is it possible to add 2 more MPUs with always complementary directions? With this you would be able to make a 2 out of 3 calculations and can overcome the drift. Not sure, whether this idea is correct.
@filipecoelho9855
@filipecoelho9855 3 года назад
I think that the drift is because of gravity acceleration, so it's always on the same axis, don't matter how you position the IMUs.
@shakerileiwat4341
@shakerileiwat4341 3 года назад
Great ♥♥♥
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thanks!
@karik2880
@karik2880 3 года назад
WooooW
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thanks for watching!
@wowfactorzxcvbnm
@wowfactorzxcvbnm 2 года назад
hey i have made a lib the works pretty well with mpu almost no drift
@witchestify
@witchestify 2 года назад
Can you share it sir? thanks
@djkadakamc1889
@djkadakamc1889 Год назад
Share it pls
@ShirishJadav162
@ShirishJadav162 2 года назад
what is the update rate
@jualopejayp.1522
@jualopejayp.1522 2 года назад
hi, do i need to create a 3d model?
@mt-qc2qh
@mt-qc2qh 3 года назад
Great project, Rui. Apparently I haven't used the ESPAsyncWebserver class before. I have the esp32 1.04 core installed, but the md5.h is missing for the ESPAsyncWebServer-master/src/WebAuthentication.cpp. Any ideas? I believe it should be in the core.
@mt-qc2qh
@mt-qc2qh 3 года назад
Just for kicks, I compiled it for the D1 esp8266 and it is in the 8266 core!
@emmetray9703
@emmetray9703 3 года назад
Are you using MPU's internal DMP(Digitan Motion Processor) or just reading raw datas from a registers?
@batugunduz3950
@batugunduz3950 3 года назад
It looks like raw data. He probably just integrates the angular rate values and doesnt even touch the accelerometer as he needs to reset the position from time to time
@scgsantos22
@scgsantos22 3 года назад
@@batugunduz3950 Yes. For this example, we just integrated the angular rate values to get the position. We didn't use the accelerometer values because the result was worse. And, yes, from time to time, there's the need to reset the position because the sensor drifts a bit and the error accumulates over time.
@batugunduz3950
@batugunduz3950 3 года назад
@@scgsantos22 How did you attempt to use the accelerometer?
@webbryan1
@webbryan1 3 года назад
All gyroscope drift (same problem during the moon mission in the 60s). To somewhat remove drift of gyro, i think a magnetrometer can be used.
@khadijahfebriana6119
@khadijahfebriana6119 Месяц назад
Hello Rui. I tried to follow it step by step. I have a doubt. I can't find ESP32 sketch data upload options
@RuiSantosdotme
@RuiSantosdotme Месяц назад
The Arduino IDE software has changed slightly, please check our blog post for the updated instructions: randomnerdtutorials.com/esp32-mpu-6050-web-server/
@N100NXX
@N100NXX 3 года назад
Looks like I have to get one of these! Would the esp8266 handle it?
@scgsantos22
@scgsantos22 3 года назад
Hi. Unfortunately, the ESP8266 can't handle this example.
@hermitcow7045
@hermitcow7045 Год назад
SPIFFS mounted successfully Failed to find MPU6050 chip how to fix this please i wanna try
@tanmeowsoon5252
@tanmeowsoon5252 9 месяцев назад
Hi Sir Good day i want to learn from you have show can you share with me all the step how you did it . Many Thanks, Tan Meow Soon
@jovicassia
@jovicassia 2 года назад
error ---> 'JSONVar' does not name a type in // Json Variable to Hold Sensor Readings JSONVar readings;
@djkadakamc1889
@djkadakamc1889 Год назад
Have you installed the Arduino_json library?
@karenkarapetyan1479
@karenkarapetyan1479 Год назад
ERROR: Too many messages queued I have this error when I use code after a little time the core is dumping! someone knows how I can resolve it?
@carlosfelipe4379
@carlosfelipe4379 Год назад
same
@felixmayoral6909
@felixmayoral6909 Год назад
Its possible to do it with Raspberry Pi and Python? I want to do something similar with this technology
@djkadakamc1889
@djkadakamc1889 Год назад
Of course yes
@himel_tasrif
@himel_tasrif 11 месяцев назад
I can't get "esp32 sketch data upload" I use all the step properly but can't get it anyone please help me to get esp32 sketch data upload
@0m1d
@0m1d 2 дня назад
Does this work on esp8266?
@timjx3675
@timjx3675 3 года назад
I connected 6050 up as instructed SCL, SDA pwr, gnd and loaded libraries and ran example read values code but on the serial monitor im getting failed to detect mpu 6050 chip message any ideas anyone ?
@jeanyluisa8483
@jeanyluisa8483 3 года назад
Did you check if your mpu6050 module might have a different I2c address? Might mnake sense to upload an i2c scanner mode to check if it detects your mpu and what adrress it uses. playground.arduino.cc/Main/I2cScanner/
@timjx3675
@timjx3675 3 года назад
@@jeanyluisa8483 Thx a bunch for the reply very helpful I will try the scanner out 👍😀
@prathambumb5593
@prathambumb5593 3 года назад
Can we measure vibration using this ?
@RuiSantosdotme
@RuiSantosdotme 3 года назад
You could, it detects motion
@prathambumb5593
@prathambumb5593 3 года назад
@@GeeEmJay ok
@the_hasnat
@the_hasnat Год назад
I built my one using JS. But after a couple seconds of crazy movement, I have to reset positon.
@the_hasnat
@the_hasnat Год назад
Ohh you mention it at 3:14 seconds. I couldn't figure it out either. Maybe an algorithm that tracks it and then reduces its effect?
@FilmFactry
@FilmFactry 3 года назад
This is Excellent work! Thank you. Are there any easy CSS or HTML editors, that I can use to change the web page? Example if i wanted to change the font, the size or location on the page? This is a much more general question. i often need to read two i2c sensors. They are on different addresses, same bus. How easy is it to just add in the script portion for say a Time of Flight distance sensor (VL53L0X). And just at the distance to the webpage? I guess I'm asking you already built 90% of this, is it just adding the VL53L0X in the script and passing it to the HTML? So, you have a robotic arm. The 6050 can read the angles, and you can read the distance via the VL53L0X to the bed.
@scgsantos22
@scgsantos22 3 года назад
Hi. If you have some basic knowledge you can easily change the colors, font, size, etc... By just following some basic HTML and CSS tutorials you might be able to do that. We have a new eBook that shows how to build your web servers from scratch including all the HTML, CSS and JavaScript files: randomnerdtutorials.com/build-web-servers-esp32-esp8266-ebook/ We also have many free tutorials with the ESP32 that you might find useful for your project: randomnerdtutorials.com/projects-esp32/ As for the sensors, it is easy to add another sensor. You might want to take a look at this tutorial:randomnerdtutorials.com/esp32-web-server-sent-events-sse/ Then, you might be able to easily adapt it to your case. At the moment, we don't have any tutorials with the VL53L0X sensor. I hope this helps. :)
@chrisxs4479
@chrisxs4479 3 года назад
can it work in esp8266?
@andreashobby
@andreashobby 3 года назад
yes
@hoowknight2712
@hoowknight2712 3 года назад
I need help with a project :c. Can you help me plis? :C
@galileyan
@galileyan 8 месяцев назад
SPIFFS mounted successfully Failed to find MPU6050 chip
@mihoisoya7957
@mihoisoya7957 3 года назад
hi, i don‘t know if you can see my comment, but if you could answer i would really appreciate it! I have followed your tutorials step by step from hier: Visualize Your Sensor Readings from Anywhere in the World (ESP32/ESP8266 + MySQL + PHP) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-a1567vlSVC8.html and everything went well until step4, when i enter the page of esp-chart.php, it shows access denied for user (password yes) . So i though maybe i should start from the beginning again, then i deleted the old database, file manger etc and created all of them again. But it come out no matter what i write, the website didn‘t change. like even if i give a wrong username in post-data.php. and change the echo from „no data posted with http post“ into „hahaha“, the website still shows no data posted with http post. what should i do ? thank you so much!
@RuiSantosdotme
@RuiSantosdotme 3 года назад
if you see something like this "shows access denied for user", your database user might not have the proper permissions to access the database. Make sure it has all permissions enabled.
@al-raffysarip4812
@al-raffysarip4812 5 месяцев назад
Hello, what does this mean? undefined reference to `mbedtls_md5_starts' collect2.exe: error: ld returned 1 exit status *** [.pio\build\esp32doit-devkit-v1\firmware.elf] Error 1
@a29stech33
@a29stech33 3 года назад
Great
@RuiSantosdotme
@RuiSantosdotme 3 года назад
Thanks!
Далее
Build an Electronic Level with MPU-6050 and Arduino
33:37
Это iPhone 16
00:52
Просмотров 924 тыс.
MPU-6050 Gyroscope Teapot demo 3D simulation
5:34
Просмотров 116 тыс.
ESP32 Web Server - ESP32 Beginner's Guide
11:52
Просмотров 59 тыс.
14 | Measure angles with the MPU6050 accelerometer
13:03
Try these 16 Brilliant ESP32 projects!!!
11:18
Просмотров 560 тыс.
КРАХ WINDOWS 19 ИЮЛЯ 2024 | ОБЪЯСНЯЕМ
10:04