Arduino Digital Level using Nano + MPU6050 Gyroscope/Accelerometer + OLED display
HTML-код
- Опубликовано: 10 сен 2024
- Let's build a functional and stylish Digital Level (aka spirit level or bubble level) using an Arduino Nano, MPU-6050 6 Axis Gyroscope & Accelerometer with an OLED display to show angle value and some menu options. This is a more practical approach to building a useable device housed in a 3d printed case that looks like any standard bubble level you'd buy.
Download Source Code and STL files at designbuilddes...
How the code works: • Arduino Based Digital ...
Parts used here:
Arduino Nano: amzn.to/2YNt9GI
MPU6050 6 Axis: amzn.to/3lG93Gr
OLED Display 128x64: amzn.to/395cRLp
TP4056 Li-ion Charging board: amzn.to/2VELSmC
Boost Converter: amzn.to/3zazPeK
Excellent. More detail, explanation and features than similar projects on YT . The calibrate and precision features = 2 thumbs up.
Thanks for the educational video. Unusual and useful crafts the main thing is the possibility of repeating the project. Im 65 years old and i did it.
Just fantastic, I will do it, it's cool. I would like to modernize it further. here are a few ideas, and then we’ll see for ourselves, but this is already cool.
Tilt Indication: Add visual and audible indication function to indicate tilt in a certain direction.
Attachment Magnets: Add magnets to the level body to allow users to easily attach it to metal surfaces.
Nice design. You could use your enter button to lock / unlock your axis, or even cycle between (level, plumb, auto).
Maybe Calibrate could make a reading in the Z axis, then you rotate 180 degrees and make another reading. Easier than requiring a level surface.
Great idea, I'll have to play around with that. I've only ever had to calibrate it just the one time on an existing level surface and it hasn't drifted off, not yet anyway! It would definitely be a big improvement to take the need for an existing level surface out of the mix.
@@DesignBuildDestroy I have a idea of something like this for another project would you mind chatting with me and I can give my idea and get your input ?
Great job designing and building this project. I recently came across a power bank called wemos esp32 battery sheild.. To me this is a great power unit to use, and will simplify things. Once again two thumbs up!!!
Thank you! I've seen the battery shield and agree it would be cleaner approach! I tend to just use what I have laying around.
you could also make it into a cube shape to use on the table saw blade :D pretty neat tool you've made here :D
Nicely designed and presented!
Very nice, its a great diy electronic spirit level meter
I already tried to build it... and It works!
However, I recognized that the yaw will increasingly drift by the time even you do not move/touch the calibrated sensor. Do you have any solution for this?
This is freaking amazing. Subscribed and looking forward to more arduino videos
This is a super cool project! Well done!
I know im asking the wrong place but does any of you know of a trick to log back into an Instagram account??
I was dumb lost my login password. I would appreciate any tips you can give me!
@Rhett Myles instablaster :)
@Warren Rohan I really appreciate your reply. I got to the site on google and Im trying it out atm.
Takes quite some time so I will get back to you later when my account password hopefully is recovered.
@Warren Rohan It did the trick and I actually got access to my account again. I am so happy:D
Thank you so much, you saved my account :D
@Rhett Myles Glad I could help xD
bravo pour le projet 👍, merci pour le partage
Really cool project!
GENIUS.
Thanks a lot very nice project....
Great project! I have an old hardwood level that would benefit from this as an upgrade. Would really like to see an in-depth video of the coding side of the project (I'm a complete newb with Arduino)
Thanks! I am planning to put a video together on the code side soon, it would have been a little too much to include here. I think there is a much better way to handle the rotation and angles than how I coded it, maybe someone out there can propose a better solution ;)
@@DesignBuildDestroy
hi , how can i detect 360 degree rotation of mpu6050 and when it completes it . IT will print (" la la ") ; please help me
When the program loads, the OLED screen shows "IMU fail". When I press a button the menu appears. If I then press calibrating and then start, "Calibrating" remains on the OLED screen. What am I doing wrong?
Update on the project is that i have solved the issue with the code and needed to change the name of the #include file(s) as the code wasn't recognising the libraries that were installed.
Now I'm having the issue of the screen not turning on, everything else works correctly and everything is being powered and i have double and triple checked many times as well as de-soldering and re-soldering the parts together.
What would you recommend i do?
Can you show me how to program exacly the same but with a light strip, without numbers only leds going to the right or left
I am having a hard time with making this work. Even after instaling such library as Adafruit Gfx, I get an error massage saing "error compiling for audrino nano" I even don't know what this means let alone how to fix it. Please help. I am NOT a programer at all.Do you have a file that includes all the librerries so I can just install them and be done with it? Thanks in advance.
I would l ike to run this on the SEEEDstudio XAio SAMD will this work?
Nice build, in the related article you mention printing the case without supports. Can you detail on this (how to arrange the support etc)?
where do i get quaternion to euler angle matrix whatever you have used is completely different can u please send the link ?
Graciassss
Bonjour
Bravo pour votre réalisation beau produit, cependant avec celui que j'ai réalisé il y a un soucis de mémorisation du calibrage problème de librairie EEPROM?
merci de votre réponse
cool!!! can i ask how could i choose a proper accelerometer for my project? what parameters i should pay attention ?
where can i get the MPU6050_6Axis_MotionApps20.h file?
Good explanation, i have tried your code is working . thanks for your effort . i face one problem x angle vary continuously 0.01 degree for every second in sensor stable position .any guide for that.after few minutes it goes 5 to 20 degree.waiting for your reply.
Some very nice features unfortunately 1degree over 1metre is some 17mm rise, you really need more precision.
Can You Send Me design file with .SLDPRT format?
Can't tell from the schematic or the video.... Is the battery connected between the charger and the booster?
If you are using a TPU4056 charging board the battery connects directly to the board at the B+ B- terminals. Someone in the comments or on Hackaday pointed out the power switch really should be between the output (OUT+) of the TPU4056 and the positive INPUT of the Booster board. The way I originally built it has the power switch between the positive OUTPUT of the booster, which means the booster board is always powered even when the device is "off" so it will eventually drain the battery. I need to find some time to update the drawings on designbuilddestroy.com
How do i get the code for this project?
Hi, thanks for the excellent explanation. i want to ask, is it linear acceleration or angular acceleration which can be measured by MPU6050? can it be used to measure angular acceleration?
I think so, because it's a gyroscope with accelerometer the gyro is telling you how its moving in space (like the angle) while the accel is telling you how fast. If you want direction your moving you probably want to use a different model that also has a compass so you can know which direction you are moving in and at what angle and speed.
Nice project, I’m currently building this as my first project 😅 but I get an error that dmpinitialise is missing. Do you know what I am doing wrong?
I'm guessing you do not have the right library installed. I am using Jeff Rowberg's MPU6050 library they may be a little different from some other's out there. I threw them up on our site for you: designbuilddestroy.com/fileshare/digital_level/MPU6050_library.zip. Unzip to your Arduino IDE library folder, on Windows it's in My Documents->Arduino->libraries. The folder should be named MPU6050. Jeff's awesome Github repo is github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050
Cool project! I’m trying to build one bye myself but i have problems with downloading the write zip codes and getting them to work in Arduino. Are you able to make a video to explain how you got everything to work? Thanks
Just uploaded a code review couple days ago: ruclips.net/video/FhBxuh8dtpE/видео.html
Also check out ruclips.net/video/lGvympJcHdM/видео.html if you are not sure how to load custom libraries found on Github, I use a specific MPU6050 library found on Github not the one in Arduino Repository.
Loving the idea, but can't get the libraries to work. Stymied at 'class MPU6050' has no member named 'CalibrateAccel'
Sounds like you may not be using the correct MPU library there are a bunch for the MPU6050 and they can vary quite a bit. I'm using Jeff Rowberg's MPU6050 library link is in the top comments of the source for the project, you can download the library here: github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050
@@DesignBuildDestroy after installing, uninstalling 4 times it finally worked.
Hello, i am trying to create this project myself and I'm having some trouble with getting the code correct. The first few times i used the code and verified it, there were a few error messages that said that they libraries in the code didn't exist at all. I've watched your other videos explaining the code and uploading the zip files and now instead of those error messages coming up, its stating that the code cannot compile with the arduino nano board.
if you get to reading this i would really appreciate some help.
Hmm I wonder if you try changing the #include "MPU6050_6Axis_MotionApps20.h" to #include May need to do the same with the I2cdev and wire. Arduino IDE is kind of tricky and oddly it seems to install differently on some machines with folders/config files in different locations probably depending on the version of when you first installed it.
@@DesignBuildDestroy would there be any code changes since the arduino software app has updated so maybe some of the older systems don't work anymore?
I have the most recent release of the arduino app and I'm just wondering if that may be the issue
@@scaryotter_0352 The code itself wouldn't ever need to change with different versions of the Arduino IDE.
@@DesignBuildDestroy Ah ok, I might go and do a few more run throughs of your videos and try and follow them exactly, if it works then I'll be happy. If it doesn't then I'll try and get further assistance
You don't need a boost converter
Calbriate or Calibrate?...
Is it possible to use this as a potentiometer that can supply 0v-5v base on an angle?
I suppose using AnalogWrite() and a low pass filter circuit you could create a variable output voltage based on the angle
@@DesignBuildDestroy Trying to see if I can use it for my electric trike.I will need to learn from basic 101. thanks!
@@RideBicycleUSA Curious what the use case is? Automatically change gears based on the angle?
@@DesignBuildDestroy I just ordered listed items for this fun project. I hope my high school electronic 38 years ago helps.
I only have the circuit completed but it functions just like in this video. Thanks!!
Great. By the way, if I want to display full 360 degrees rotation I just need to comment out "angVal = (90..."?
It's been a while since I've wrote this code but off the top of my head *I think* you'd just need to set angVal = ea.y. angVal variable is used in the formatDisplay function to print the value on the LCD. So within the IF statement blocks that handle the screen orientation and come up with angVal you could comment out all the angVal's in those IF blocks, and then right above formatDisplay function call add a line angVal = ea.y or make the call as formatDisplay(ea.y, dispRotate);
@@DesignBuildDestroy Thanks!! Awesome job, congratulations!!
source code?
the switch is too far - the booster is always powered by battery - I would move it 1 step to the left on your diagram to make sure when off battery never provides power to booster
Yeah, dumb on my part, I updated the layout on the site. A couple people pointed this out but looks like I forgot to update the drawing
@@DesignBuildDestroy people who cannot accept the critics are dumb - since you accepted then it is... accepted ;-) And my comment was not to discredit your great job! ;-)
Kindly provide schematic and code
Заебись!!!
imu fail, how do i resolve this
all good i had the scl and sda connect mixed up
How to u charge it?
Around 11:39 time stamp I talk about charging. There is a TP4056 board onboard to allow for USB charging of the 18650 cell
@@DesignBuildDestroy oh ya, thank you
Where is code
You have a email from me! :) / Emil