In this tutorial we will learn how to make an Arduino range measurer and a digital spirit level. You can watch the following video or read the written tutorial below.

Overview
The device features an ultrasonic sensor for measuring the distance to the nearest object, an accelerometer for measuring the angle with respect to the ground, an LCD display for showing the results and a custom designed PCB on which all components are connected.

We can operate the device with just a single button. Once we power the device we need to select the unit of measurement.

By pressing the button we can toggle through the units, and if we press and hold the button for a while we will get into the first program. Here we can measure the distance and also have the ability to store the last two measurements.

For getting into the second program, again we have to press and hold the button for a while. In this program we can measure a square area by taking two perpendicular distance measurements.”

Link