This a project I've been working for some time now. It is a device that shows in a little LCD display the distance to the nearest object it can find, usually the floor, the ceilling and two walls or columns. So it can be so helpful to hang a picture, a shell, a light point, calculate the area of the entire wall, etc.
You can find the code here
If you are in your phone or tablet and you can't see the video, click here
I have chosen to use cheap materials cause I don't really need a high precision and like almost always I am doing it for fun... so I think you can buy all the electronics for less than 15$ on ebay:
1 Arduino Mega
4 Ultra-sonic sensor sr04
1 LCD 16x02 Display
1 Perfored Prototype board
2 10k Resistors
1 10k Potentiometer
Male and female arduino pin header connectors
A few cables
A little bit of hard plywood, of course
The sr04 has a 3mm resolution, so I am only using it in entire centimeters. You can also change it to inches pressing a button but then the resolution is even worse. I am trying to figure out how to get a better resolution, I know it is possible. Needless to say any help will be apreciated.
It has 4 programs:
Measures the distance from up, down, left and right to the hole, the center of the device.
When you chose the second program, all the measurements reset to 0 and it will start measuring from that point. In this case I am making a mark 10 centimeters away from the first one.
The number 3 does not measure from the hole but from the opposite side of the device. Useful if you want to know, for example, the distance from 2 walls or the height of the ceilling.
The last one calculates the area. If you place it in a corner it will show you the total area of the wall, in this case the number you can see on the right.