Ultrasonic Tape Measure by msuzuki777
Featured

Have you ever wanted an ultrasonic tape measure, like this Stanley? (See picture). Well, I have but then I am a Lazy Old Geek. I don’t really need one but I thought I’d try to make one. And naturally, I thought of an Arduino.

August 2012 update: I just found out the software used in this Instructable does not work in the latest Arduino environment, 1.0. I think it is the LCDKeypad library but haven't found an updated version or software fix. However, this does work with version 023. LOG

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts List

Arduino                                  $17.60 (Duemilanove 2009) ebay.com
HC-SR04 Ultrasonic           $  4.61 ebay.com

LCD Keypad (Arduino)       $  8.88 ebay.com

Now I realize this is about $30 where the Stanley is available for around $24 but these parts are not committed to one function like the Stanley is.

Parts selection:
I wanted an Arduino that was shield compatible. I already have two, a Freeduino and Seeduino so I decided to buy a third. Right now, one of the best deals I liked is for a standard Arduino Duemilanove 2009 on ebay.
By the way, mine came with an Atmega 328-PU instead of the ‘standard’ Atmega328P-PU. I discussed this in another Instructable:

http://www.instructables.com/id/My-Arduino-Bootloader/

The LCD keypad also has Arduino support plus five user pushbuttons and a 16x2 (16 characters x two rows) display.

achupick64 says: Feb 4, 2013. 11:19 AM
Hi:
I replicated the tape measure exactly, but hooking up Trig & Echo to 2,3 results in it just showing 0.0 and not measuring. I transferred it to my mega 2560 and it works when assigned pins not connected to the LCD shield. I would like to know what i'm doing wrong with my UNO R3.

Thank You,
Albert L. Chupick
msuzuki777 (author) says: Feb 4, 2013. 12:41 PM
The way I would troubleshoot it:
0. Do a visual inspection of your work to look for shorts, solder bridges or cold solder joints.
1. Connect HCSR04 and LCD to UNO R3
2. Without power, with a DMM, measure for continuity between HCSR04 Trigger and D2 on the UNO R3 which is Atmega328 pin 4.
3. Measure continuity between Echo and Atmega pin 5
4. If ok, then turn on power and make sure you have 5V and ground on the HCSR04
5. Load sketch and carefully wiggle all added connections to see if you get any reading.
6. If still not working, turn off power and make sure pin 4 or 5 aren't bent over instead of going into the socket.
7. If still not working and you have one, try a different Atmega328.

Hope this helps.

LOG
chrisn68 says: Dec 6, 2012. 7:14 AM
I installed all the library files but after compiling I get this error -

In file included from sketch_dec06a.cpp:2:
C:\Users\Chris\Desktop\ARDUINO\arduino-1.0.1\libraries\HC_SR04Ultrasonic/Ultrasonic.h:11:22: error: WProgram.h: No such file or directory

The HC_SR04 library has been installed. Anyone any ideas please - still relatively a noob . Tx
chrisn68 says: Dec 6, 2012. 7:26 AM
Its ok I got it, for anyone else you need to 'edit' the library files and change anything that says wprogram to arduino if you are using a newer version of arduino.
msuzuki777 (author) says: Dec 6, 2012. 10:50 AM
Thanks for figuring this out. This Instructable was written using Arduino 0023 Environment and I don't have the hardware readily available. When Arduino released 1.0.0, I heard that were some compatibility problems. Usually, when I run into a problem, I'll revert to the older Environment. But your solution is probably better.

Thanks

LOG
mhastie1234 says: Mar 29, 2012. 6:13 PM
I'm a total Noob. I can't figure out how to even save this so i can compile it. I can't figure where to save it to. I don't have the sub folders as described.
msuzuki777 (author) says: Aug 2, 2012. 9:08 AM
I just discovered that this software will not work with the latest Arduino environments. However you can still get and use older versions like 0023 that does work.

LOG
msuzuki777 (author) says: Mar 29, 2012. 9:49 PM
Hopefully, you are using a Windows computer as I'm not familiar with Linux or Mac. I assume you already have the Arduino software loaded onto your computer. You should have a directory called Arduino-???. Mine is Aruduino-0023 for the version number. Under this is a subdirectory called libraries. Unzip the first three downloads and copy the zipped directory into libraries. So under libraries you should have directories called HC_SRO4Ultrasonic, LCD4Bit_mod and LCDKeypad.
The UltraRanger file is the program sketch. I don't think it matters where you store it but I store all of my sketches in a directory under Arduino-0023 called MTS. So it would look like this c:\arduino-0023\MTS\UltraRanger.
TIP: Apparently a .pde file has to be in a subdirectory of the same name. So I have UltraRanger.pde under UltraRanger directory.
Now I'm not sure but it seems like sometimes I had to reboot my computer to get the Arduino environment to see everything.
Now when you start up your Arduino software, you go to file open and find the UltraRanger directory and open up UtraRanger.pde.

Hope this helps.

LOG
mhastie1234 says: Mar 30, 2012. 6:09 PM
I have it working now. Finally. I was having the same problem as crack hacker.
When using Arduino-1.0 you have to change all of the WProgram.h to Arduino.h for it to work with the new software. I thought i was downloading it wrong. Very cool project. Thanks for the Instructable.
CarnivoreBeefRage says: Jul 27, 2012. 8:51 PM
Hey thanks a lot for the instructable! It's very helpful for beginners such as myself. The device's simplicity makes it easy to understand, as well as add new features to it in the future. Your shared knowledge is much appreciated!
msuzuki777 (author) says: Aug 2, 2012. 8:56 AM
I started using the Arduinos as they are user friendly and there is so much support online. For all the help I received and receive, I like to pay back with some of my own experiences.

LOG
megaduty says: Feb 24, 2012. 11:39 AM
Thanks for this instructable, it will help me with a current project!
msuzuki777 (author) says: Feb 24, 2012. 12:52 PM
Hope it works!

LOG
crackHacker says: Mar 9, 2012. 8:25 AM
i am having some trouble with the include header for the lcd keypad. i am using arduino 1.0 IDE and the libraries i have downloaded just toss errors when compiling. did you have this trouble?
msuzuki777 (author) says: Mar 9, 2012. 11:53 AM
I didn't have any trouble with the libraries but I think I used Arduino version 22.

I suspect you need to update your Arduino IDE but you might also try to reload the header files. One source is:
http://iteadstudio.com/application-note/arduino-library-for-ultrasonic-ranging-module-hc-sr04/

though the download is an *.rar file

Iteadstudio has some good information on the HC-SR04.

Hope this helps.

LOG
crackHacker says: Mar 9, 2012. 3:43 PM
arduino 1.0 is the most current IDE.

not having trouble with the ultrasonic just the lcd keypad thing but i will check out the site you mentioned.

thanks for the reply bro
msuzuki777 (author) says: Mar 9, 2012. 6:33 PM
You're right. I didn't know they changed their revision numbering. If you don't have any luck, you might try 0022, I know mine worked with that one.

LOG
Demonic69 says: Feb 17, 2012. 10:32 AM
Very nicely done! I take it that the distance is measured from the very front of the device? Would it be easy enough to add a variable adding the length of the device so that it could be placed against a wall, for example? I'm assuming you could just add the measurement to dist before the printLCD?
msuzuki777 (author) says: Feb 17, 2012. 6:48 PM
Thanks,

Yes, the measurement is from the front of the device,

That's a good idea about measuring from the back of the Arduino. It's a little tricky in that the power connector is on that side so that would have to be added in also or you could mount the sensors on one of the sides or maybe even perpendicular to the LCD.
Right now I have mine torn apart for some other projects but the idea behind my design is so that it can be easily recreated just by plugging in the cable connectors and the sensor. Assuming that I can find them again.

LOG
Spaceman Spiff says: Feb 23, 2012. 2:40 PM
You could power it with a battery (for example 9V with 5V regulator), and then do some simple math. Take the measurement + the length of the device.
msuzuki777 (author) says: Feb 23, 2012. 7:02 PM
Yes. With the way I have it setup, the 2.1mm power jack and wire would also have to be added to the length since the connector comes out of the 'back'.
LOG
Spaceman Spiff says: Feb 23, 2012. 2:42 PM
What's the total measurable distance on these ultrasonic sensors?
msuzuki777 (author) says: Feb 23, 2012. 6:59 PM
It is supposed to measure up to 500cm about 16.4 ft. I couldn't get mine to measure over 11 feet but haven't really looked into this.

LOG
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!