loading

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:

Materials:

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:

1. Hole
Measures the distance from up, down, left and right to the hole, the center of the device.

2. Rel
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.

3. Total
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.

4. Area
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.

Step 1: Making the Case

You can start cutting the plywood. If you have a different idea for the design of the box, you can avoid this part and go directly to the electronics. Tilt the disk 45 degrees and cut the four pieces for the frame.

Drill the holes for the sensors and for the usb cable and use a chisel adapt the place for the connector. You can use a little bit of fabric to make sure they fit exactly in the middle and mark with the drill.

Ready to apply the glue. Remove the remains of glue and check if it is squared.

Step 2: Top and Base

Cut the base and cover and use the hand plane if needed. Mark and drill the holes for the buttons, the screws and the bubble, wich is recycled from a cheap spirit level.

Make the hole for the display. Glue and screw a little block of plywood to hold the steel pipe.

Step 3: Varnish

We can apply now the varnish, 3 coats of nitrocellulose lacquer in my case, and between them you can use transfer paper to write the names of the buttons.

Step 4: Electronics

Following the schematic, I have used a bread board to make sure all the stuff worked before I soldered all the componets. Connect it to the computer and upload the code you can find in the intro, check all is working ok and you can start the assembly.

With a perforated board I made a shield for the arduino with a little circuit. You can actually do it without it but this way it will save us a lot of wires and the result will be cleaner.

To make it lower in order to fit in the case I moved the plastic part of the pins to the end and soldered them from below.

To connect the display I had used a female pin header connector like this one.

You'll probably have to solder the pins of the display depending on where you bought it.

This female connectors can be so useful if you don't want to solder the sensors.

Solder the potentiometer, the resistors and the rest of the cables and you can finish assembling it.

Step 5: Assembling

With a little plastic pipe you can make these little spacers. Now asembly the buttons and the level.

I didn't have screws as small as the holes of the ultrasonic sensor so I had to use a drill to make the holes bigger. Take care if you have to do the same, I think a 2mm drill could be the bigger one you can use if you don't want to brake something.

Assembly the arduino with the board and the display and all the wires following the schematic.

Bend a little plate and screw it to the base to hold the battery. You can use a little piece of EVA to avoid scratching the base or the wall.

I have tried in the Arduino Uno, successfully ... !! But there is less to see often changed, but when the "unit, prog" pressed on the display will not change.
<p>I don't know what can be happening, check the buttons wires and resistors. If you are using a different board, you will have to modify the code changing the digital pins for the buttons.</p>
<p>very nice build!</p>
<p>thank you!</p>
<p>why di i need the code and i do i get it work,my computer dont recognize the file</p>
<p>Thumbs up !!!</p>
<p>thanks!</p>
<p></p>
<p>Hi, this is nice work. But you say &quot;I am trying to figure out how to get a better resolution, I know it is possible.&quot; One way is to measure temperature and compensate for the variation in the speed of sound with temperature. I did an experiment with that and documented it here &lt;a href=&quot;http://la3za.blogspot.no/2014/05/temperature-compensation-for-arduino.html&quot;&gt;</p><h3>Temperature compensation for an Arduino ultrasonic distance sensor&lt;/a&gt;</h3>
<p>Thanks LA3ZA. It seems to be an amazing solution. I'll give it a try! </p>

About This Instructable

8,266views

201favorites

License:

Bio: My name is Suso Caamanho. I like doing all sorts of stuff related to musical instruments, woodworking, computer science, electronics... On my website you will ... More »
More by Paoson Woodwork:Bending Wood With a Bending Iron  How to Make Kitchen Utensils How to Make a Mini AXE 
Add instructable to: