loading

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.

<p>what's the maximum range of it usually?</p>
<p>Nice Project. I have made a smilar one. But mine is talking according to distance :) You can check my project. :)</p><p><a href="https://www.instructables.com/id/Arduino-wtv020-Sd-16P-Talking-Distance-Meter/" rel="nofollow">https://www.instructables.com/id/Arduino-wtv020-Sd-...</a></p>
<p>Thanks for this awesome instructable. So much detail and educational. Thank you author. </p>
Hello. On my lcd distance is coming with some codes and these codes are continuously moving
<p>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?</p>
I skipped temperature sensing part.... <br>And it was fun.... <br>Thanks instructables<br>
<p>lcd pins to which pins ?</p>
<p>Thats a lot of pins to mention in the comment.Take a look at circuit diagram.</p>
<p>hi should i connect the lcd and ultrasonic senors pin 11 &amp; 12 together</p>
<p>You can connect the sensors pins to arduino `8 and 9. Just change the pin in the code.</p>
<p>hi i think there is a problem with a code</p><p>whenever i try to upload it gives me the error :</p><p>'NewPing' does not name a type</p>
<p>and yes the problem is solved </p><p>i had not unzipped the library</p>
<p>Did you set up the lib files in the right place</p>
<p>hey can we use a 9volt 1a adaptor instead of the battery</p>
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.
<p>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</p><p>another question:will it have any effect on my dogs?</p>
<p>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.</p>
<p>Educational and detailed, good job! :-)</p>
Hey cool inscrutable and well documented ... Thanks for posting.
<p>I suggest you to edit V1 adding updates, much better than having two almost identical instructables. I usually add [UPDATED] to the original title.</p>
Thanks for the updated version. Nice and educational

About This Instructable

16,343views

207favorites

License:

Bio: Hey I'm a College school student, I love to work on projects and Arduino powers most of them. Follow me @ https://www.facebook.com ...
More by ThisIsSteve:Linkit One Text to Speech Linkit One Kitchen Timer Intel Edison Talks to Linkit One 
Add instructable to: