DIY Inclinometer

by HarshadB9 in Circuits > Arduino

12832 Views, 29 Favorites, 0 Comments

DIY Inclinometer

IMG_0023.JPG
IMG_0024.JPG
coverphoto.png
IMG_0026.JPG

As you might have guessed by looking at the photos, this device helps you measure the angle of a surface with respect to earth's gravitational field. In a nutshell, if i=the device measures an angle of 0.0something degrees it means you have done a nice job at leveling the desk.

In this instructable I will take you through the steps that I followed to make this awesome project.

I hope you will like it.

Watch the Video

DIY Digital Inclinometer

Checkout the video on YouTube for the same project. Do like the video if you GENUINELY like it.

In this video I have mentioned the steps for making this project.

Components-

IMG_0014.JPG
IMG_0026.JPG
IMG_0022.JPG

The list of components is fairly straight forward. A simple arduino, (Nano in my Case), MPU 9250 IC, and an OLED display to output the data. As usual, having the monitor is not mandatory but thinking of a laptop eveytime you want to test a surface might be a bit absurd.

I got the MPU 9250 from Ali Express for about $3.5. This is not the cheapest IC but the noise levels were considerably lower. I highly recommend this IC

There's nothing special about the arduino or the wood. Arduino is a clone and works great. Just make sure to use some descent quality wood that will not chip off every single time.

The Body

Screenshot (22).png
Screenshot (23).png
Screenshot (24).png
Screenshot (27).png

For the main body, I took some simple square wood and cut it to a rough length of around 10cm. I then marked two holes in length of the IC. It is important that you fit the IC correctly. Also, if you do go wrond, please use some other side or even better, use another wood. Do not try to correct a missed hole. The screw may not hold good grip on such hole.

I then cut female headers on appropriate lengths and pasted them with two component adhesive. Once everything fit in place, I was pretty happy with the looks.

Adding the Wires

Screenshot (25).png
Screenshot (26).png
Screenshot (21).png
IMG_0028.JPG

I then started tinning the wires and the female headers. The wiring is very very simple.

SDA- A4

SCl- A5

Vcc- 5V

GND-GND


Also, to save your effort, mark the pins on arduino and pretin only those 4 wires.

Also, make sure that you have enough lengths for your wires, and also make sure that no wires run below the flat surface as that surface is super important to us.

This is the time you make sure that the IC fits perfectly as the next step would be calibration and if you don't place the IC correctly, you will calibrate the project wrong and you may have to start form scratch.

Proramming

Screenshot (28).png
Screenshot (31).png
Screenshot (32).png

e is the GitHub link-

https://github.com/bolderflight/MPU9250

Download the file and add the library to your arduino IDE.

Once I uploaded the code I found that there were some calibration issues as the IC gave an acceleration of -11.4 m/s^2. This is not possible for a stationary object. On the earth's surface, the value has always tobe smaller than

9.81m/s^2 in magnitude.

So, I used plain old map function in the arduino sketch to compensate for that and this seems to work fine.

I have discussed this theory in my YouTube video.

Also, if you're calibrating again by yourself, make sure that you check the surface with a spirit level if you have one or else a simple ball will also do the job. Just make sure the ball doesn't roll of your calibration desk.

Downloads

Enjoy Your Project

IMG_0027.JPG
IMG_0025.JPG
Screenshot (20).png

You can now use your project to make perfect shelfs. Happy Doing It Yourslef.

As always, if you need any sort of help feel free to message me directly or comment down below.