Introduction: Smart Distance Measuring Tape V2

After posting up the v1 of my project many people requested an more detailed instructable. So i decided to start with a new one with a little upgrades to my previous instructable.

What does this thing do?
Well its quite simple it is just an replacement for an distance tape. It can also measure temperature, this was an upgrade to the old circuit. The measured distance is displayed on the LCD screen. And this circuit is powered with a 9V battery.

What upgrades have I done?

I created a beginners guide with more detail and an easier version of my previous instructable.

Why make this?

Well I need to do something this weekend....... And i wanted to be a part of makerlympics2014.

OK enough of the talking and lets start building...

Step 1: Tools and ​Components

Let's start with gathering is all the parts. You may want to go step-wise or you will end up running all around when you start your build.

Components

Tools

  • Soldering iron
  • Multimeter
  • A Laptop - mine is dell vostro 1540 (I know I'm old school)

Step 2: LCD-Arduino for Beginners

I decided to change this to a beginners guide. So lets start with the basics of connecting the arduino to an LCD, if you think you know all of this you can proceed to the next step.

Materials required

  • Arduino
  • 10k Potentiometer

Procedure

Lets start with connecting all the wires to the pins as shown in the circuit. If you want to use the backlight then, connect LCD pin 16 to GND and LCD pin 15 to +5V.

Use the pot to adjust the contrast of the LCD.

Open up your arduino IDE, then click File -> Examples -> LiquidCrystal -> HelloWorld. Upload the code to the board. You must now see "Hello World" on the lcd if all you see is black boxes then try adjusting the potentiometer.

If your done with all this proceed to the next step.

Step 3: LCD

Connect the LCD as per the circuit, I soldered the wires to a PCB and latter attached it to the arduino board.. pic for reference. The 10k variable resistance is used to adjust the contrast of the lcd display... If you are a beginner to arduino-LCD then you must read the previous step.

Here I used a black box I found in my house. On the lid of the box draw an outline of the LCD (mine was 17x2.4 cm),use a pair of scissors to cut through the box. Check if the LCD fits in, if it does you are good to go to the next step. If you want yours neat and tidy buy a box don't follow my idea.

Extra Information

If your looking as to where to find the LCD then look for it on Ebay as there is a lot of 16x2 LCDs available over there.I have not given the LCD any back-light connection because I did not feel it was necessary.

Step 4: Ultrasonic Module for Beginners (HC-SR04)

Again this a guide for those who bought this module to build this project or for those who want to learn to connect the board. If you think you know how to set up the board you can skip this step.

Materials

  • Arduino
  • Ultrasonic distance module (HC-SR04)
  • Breadboard
  • Jumper wires

Procedure

The connections are relatively simple as compared to the LCD module all you have to connect is-

SR04 VCC pin to the Arduino 5v

SR04 GND pin to the Arduino GND

SR04 TRG pin to the Arduino Digital pin 12

SR04 ECHO pin to the Arduino Digital pin 11

Download the ping library from here, and place it in the arduino libraries folder. When you are done with that open up the Arduino IDE and you would fine an example code at this loacation File > Examples > NewPing > NewPingexample sketch. Upload the code to the board and Start the serial monitor you should get distance values in 'cm' on the screen. If you see this you can proceed to the next step.

Step 5: Ultrasonic Distance Module (HC-SR04)

For the ultrasonic range module I used HC-SR04 as it is easy to find and I had it available at my house from my previous robot. The module has a maximum distance of 4m. The readings are quite precise and it has its own library . You can find the library here. Read the previous step if you are trying this for the first time. The examples are include in the library.

Connect the module-

HC-SR04 VCC pin to the Arduino 5v

HC-SR04 GND pin to the Arduino GND

HC-SR04 TRG pin to the Arduino Digital pin

HC-12SR04 ECHO pin to the Arduino Digital pin 11

Draw the outline of the module and cut through the box with a pair of scissors. Try inserting the module and you can move to the next step

Step 6: Temperture Sensor

Time for the temperature sensor this is quite easy hence I'm not going to start a beginners guide to this.

Materials

  • Arduino
  • LM35

Procedure

Connect the LM35 as (refer to the image for pin configuration)-

+vs to arduino 5v

vout to arduino analog pin 0

gnd to arduino ground

LM35 gives us an analog signal as a output so we need to convert it to digital. Which is done in the code. To check the IC (if your doing this for the first time) use the code at the end of this step.

float temp;
int tempPin = 0;

void setup()

{

Serial.begin(9600);

}

void loop()

{

temp = analogRead(tempPin);

temp = temp * 0.48828125;

Serial.print("TEMPRATURE = ");

Serial.print(temp);

Serial.print("*C");

Serial.println();

delay(1000);

}

Step 7: Code

Download the code from the attachments and upload it to the arduino board. Power up the board and you would see that the temperature and distance displayed on the LCD screen. And that's it your done. Try improving and editing the code and let me know, what you came up with.

Comments

author
Mido Masry (author)2015-05-31

what's the maximum range of it usually?

author
BurakTutal (author)2015-04-26

Nice Project. I have made a smilar one. But mine is talking according to distance :) You can check my project. :)

https://www.instructables.com/id/Arduino-wtv020-Sd-...

author
sroy29 (author)2015-02-17

Thanks for this awesome instructable. So much detail and educational. Thank you author.

author
Dushyanta (author)2015-01-07

Hello. On my lcd distance is coming with some codes and these codes are continuously moving

author
RokY2 (author)2014-12-10

First I would like to say that I was thinking of a project and this instructable will be a great starting point, so thank you very much. Now the dreaded question, you stated the the range finder has a limited distance of 4m, how could I increase this distance to that of a standard tape measure?

author
pardeep kumar (author)2014-11-22

I skipped temperature sensing part....
And it was fun....
Thanks instructables

temp_712443558.jpgtemp_-2023877278.jpgtemp_-1409009602.jpg
author
hraymond (author)2014-05-03

lcd pins to which pins ?

author
ThisIsSteve (author)hraymond2014-05-03

Thats a lot of pins to mention in the comment.Take a look at circuit diagram.

lcd.bmp
author
atharva12 (author)2014-04-30

hi should i connect the lcd and ultrasonic senors pin 11 & 12 together

author
ThisIsSteve (author)atharva122014-05-02

You can connect the sensors pins to arduino `8 and 9. Just change the pin in the code.

author
atharva12 (author)2014-04-30

hi i think there is a problem with a code

whenever i try to upload it gives me the error :

'NewPing' does not name a type

author
atharva12 (author)atharva122014-04-30

and yes the problem is solved

i had not unzipped the library

author
ThisIsSteve (author)atharva122014-04-30

Did you set up the lib files in the right place

author
nkedar1 (author)2014-03-11

hey can we use a 9volt 1a adaptor instead of the battery

author
ThisIsSteve (author)nkedar12014-03-13

A arduino has a voltage range which covered 9V so you can use it without a problem . But why do you want to introduce a ac adapter to a portable device.

author
nkedar1 (author)ThisIsSteve2014-03-26

unavailability of good quality 9 volt batteries plus in our city and i want to display it in a science fair so i need power all day

another question:will it have any effect on my dogs?

author
ThisIsSteve (author)nkedar12014-03-27

First of all I don't have a dog, yet I can tell that this will not have any effect on dogs. 2nd use duracell battery it would run an day. But don't forget to take a back up with you. You could also use 4 AA battery in series.

author
hunter999 (author)2014-03-09

Educational and detailed, good job! :-)

author
iloveandroid (author)2014-02-26

Hey cool inscrutable and well documented ... Thanks for posting.

author
andrea biffi (author)2014-02-17

I suggest you to edit V1 adding updates, much better than having two almost identical instructables. I usually add [UPDATED] to the original title.

author
discostu956 (author)2014-02-17

Thanks for the updated version. Nice and educational

About This Instructable

16,367views

207favorites

License:

Bio: Hi, I just launched an Indigogo campaign support my projects by backing it. https://www.indiegogo.com/projects/tinker-usb-a-wifi-based-badusb#/
More by ThisIsSteve:Linkit One Text to SpeechLinkit One Kitchen TimerIntel Edison Talks to Linkit One
Add instructable to: