DIY Digital Spirit Level

24,634

130

22

Introduction: DIY Digital Spirit Level

About: Awesome Electronics Tutorials, Projects and How To´s

In this project we will have a closer look at accelerometer ICs and find out how we can use them with an Arduino. Afterwards we will combine such an IC with a couple of complementary components and a 3D printed enclosure in order to create a digital spirit level. Let's get started!

Step 1: Watch the Video!

The video gives you all the information you need to create your own digital spirit level. During the next steps though I will present you some additional information.

Step 2: Order Your Components!

Step 3: Build the Circuit and Upload the Code!

Here you can find the schematic and code for the circuit. Use them to create your own circuit. Also do not forget to include the SSD1306 Library from Adafruit.

Step 4: 3D Print the Enclosure!

Here you can find the .stl files of my designed enclosure. Feel free to use them to 3D print your own housing.

Step 5: Success!

You did it! You just created your own Digital Spirit Level!

Feel free to check out my YouTube channel for more awesome projects: http://www.youtube.com/user/greatscottlab

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information:

https://twitter.com/GreatScottLab

https://www.facebook.com/greatscottlab

2 People Made This Project!

Recommendations

  • Raspberry Pi Contest

    Raspberry Pi Contest
  • New Year, New Skill Student Design Challenge

    New Year, New Skill Student Design Challenge
  • Jewelry Challenge

    Jewelry Challenge

22 Comments

0
tombankz
tombankz

Tip 1 year ago on Step 4

Probably a year or more late to some replies down there but in case there are any future people looking for answers. If you want to add the x and z axis, comment out the line:

//I2CwriteByte(MPU9250_ADDRESS, 108, 0x2F);

and add these in the loop()

int16_t ax = -(Buf[0] << 8 | Buf[1]); //y axis
int16_t az = -(Buf[4] << 8 | Buf[5]); //z axis

xangle = ax/ 182.04;
zangle = az/ 182.04;

xangle = ax/ 182.04;
zangle = az/ 182.04;

Below each of the ones for 'y'. You may want to average the data over two points (not more as it will introduce higher inaccuracies actually).


0
5p0o
5p0o

Reply 10 months ago

Insted of quoting out the "I2CwriteByte(MPU9250_ADDRESS, 108, 0x2F);" Change it to "I2CwriteByte(MPU9250_ADDRESS, 108, 0x0F);" that should disable all but X & Y axis.

0
Bitamax
Bitamax

Reply 1 year ago

hi tombankz

thanks for the info however it dosent seem to be working
i am using a 6050 could that be why

0
AlW33
AlW33

Question 2 years ago

Hi. Nice interesting project. I have most of the parts and will be trying it. However, I have read that MPU9250 uses a 3.3V supply with a max of 4v. You are apparently using 5V. Isn't there a problem of it being blown by overvoltage? Can anyone please confirm whether this is correct?

0
SarahInfo
SarahInfo

Answer 1 year ago

The LiPo battery is rated at 3.7V

0
ecm
ecm

Question 1 year ago

How can I add an X axis measurement? similar to Nektapioki's reuest. Thx …
0
ΝΕΚΤΑΡΙΟΣΚ1
ΝΕΚΤΑΡΙΟΣΚ1

Question 2 years ago

SUPER NICE WORK!
I AM TEACHER OF PHYSICS AND WE NEED as physics tool A INO SKETCH THAT PROVIDE ALSO PITCH AND ROLL ANGLE..CAN YOU HELP US ? IF SO SUPER,MY GMAIL IS
nektarios.25ma@gmail.com thanks

0
AlW33
AlW33

2 years ago

Could I please re-ask the question posted by offtherails2010. I also would like to know the lipo battery charge module shown in this instructable but totally ignored in the build description.

0
offtherails2010
offtherails2010

Question 2 years ago

Good day to you GreatScott and everyone !!

Please please could ANYONE help identify this charging module, its not shown or mentioned in this instructable but its in the main photo which is really BUGGING the HECK outta ME lol !!

ive tried to find it online in the usual places, ebay and aliexpress, dx, banggood etc but no luck finding this exact module

just curious on its specs and yes, i know theres the TP4056 alternative out there, but it would be nice to solve this puzzling module that not mentioned lol

Pretty please help ?!? lol

BE POSITIVE in replies please, no negativity, thanks in advance.

img66.png
0
asaneie
asaneie

3 years ago

Hi
Thank you for this awesome instructable
can I use ADXL345 instead of MPU9250?
Merry Christmas ❤️

0
Pro.S
Pro.S

3 years ago

How can I use Z Axis and XAxis

0
aCuriousCreator
aCuriousCreator

3 years ago

This is really cool! A project I doubt I'll ever make, but love that its possible!

0
YumanBeing
YumanBeing

3 years ago

Not to put too fine a point on it, but a "spirit" level is so-called because it consists of a partially filled vial of a tinted spirit or alcohol. This is a digital level. No spirits involved, unless of course you consume some while making or using it.

0
narb08
narb08

Question 3 years ago

Can you recommend a good alternative/equivalent to the IRLZ44N?

0
JohnC430
JohnC430

Answer 3 years ago

The IRLZ44N is an huge N-Channel transistor in a TO220 package. almost any

N-Channel TO220 package transistor will do.

0
lloydsteve0
lloydsteve0

Answer 3 years ago

Research, why ask this here?

0
itsmescotty
itsmescotty

3 years ago on Step 5

when I saw this I thought Good, viable alternative to the commercial versions. But after, only, watching the video I gave it a pass, sigh. No bells and whistles - no calibration method or angle transfer or hold or accuracy dampening ability.

It's a good start, just needs some work. Oh and how do you make the chip and rail parallel, shims?

0
GIFrank
GIFrank

Question 3 years ago

Nice application for the 9250 but I'm also curious about the accuracy. Do you have any meaurements done?