Make Distance and Temperature Measuring Sensor

Introduction: Make Distance and Temperature Measuring Sensor

About: An electronic hobbist and a tech-savvy. Love to know and publish good electronic projects. I use some popular micro controller like raspberry pi, arduino, linkit one and also some basic ICs to make my projec...

Hello friends. Today i am here to tell you how to make a distance measuring sensor which also tells you the temperature of your surrounding. If you want to measure distance of a object then you can use it or you are new to arduino projects. I made this because i want to do something interesting with my arduino. If you want to make some interesting projects with arduino then you are on right place. Friend this is my first instructable so please like it and also don't forget to comment on it. You are free to make my instructable better.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: COMPONENTS:

for this project you need following part:

  • Arduino UNO
  • Ultrasonic sensor(HC-SR04)
  • 16x2 LCD
  • Temperature sensor(LM35)
  • 10K potensio( i say it potensio you can call it variable resistance or preset)
  • Breadboard
  • some wires

Lets get started......

Step 2: Connecting LCD to Arduino

Connect the lcd to arduino according to the circuit give in the picture above.

if you are new to LCD and want to check weather your LCD is working connect the LCD to arduino according to the connection given in picture and open your arduino software on your PC. go to File >Examples >liquidcrystal >Hello world and upload the sketch to your arduino board. If you see hello world on lcd then your lcd is working perfectly but if nothing is displayed on your LCD just adjust the potensio and your LCD will start working.

Step 3: Connecting Ultrasonic Sensor

now we will connect the ultrasonic sensor.



• connect vcc pin of of sensor to arduino 5v pin
• connect trig pin of sensor to arduino digital pin 8
• connect echo pin of sensor to arduino digital pin9
• connect gnd pin of sensor to arduino gnd pin


if you want to check your ultrasonic sensor upload the following program to your board

#define trigPin 8

#define echoPin 9

void setup(){
Serial.begin(9600);
pinMode(trigPin, OUTPUT) ;
pinMode(echo pin, INPUT) ;
}

void loop() {

int duration,distance;

digitalWrite(trigPin,HIGH);

delayMicroseconds(1000);

digitalWrite(trigPin,LOW);

duration=pulseIn(echoPin,HIGH);

distance=(duration/2)/29.1;

Serial.print(distance);

Serial.print(" cm");

delay(500);

}

Step 4: Connecting LM35 to Arduino

now we will connect LM35 to Arduino.

  • connect vs pin to 5v
  • connect vout pin to analog pin A0
  • connect gnd pin to gnd in arduino board

here is a program to check your LM35.

Step 5: The CODE

here is the code for distance and temperature measuring sensor. Upload it to your board and have fun with your project. Don't forget to like and comment

Be the First to Share

    Recommendations

    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest

    7 Discussions

    0
    Saiyam
    Saiyam

    4 years ago

    Nice attempt on your first instructable.

    0
    sroy29
    sroy29

    5 years ago on Introduction

    your ultrasonic sensor code says error compiling

    0
    Dushyanta
    Dushyanta

    Reply 5 years ago

    Their was a problem in the ultrasonic sensor code which I have now corrected

    0
    sroy29
    sroy29

    5 years ago on Introduction

    and when I'm applying codes, only blackboxes appear in the display after upload. Please help.

    0
    Dushyanta
    Dushyanta

    Reply 5 years ago

    Blackboxes appear when your lcd is not connected properly. Please check your lcd connection

    0
    sroy29
    sroy29

    5 years ago on Introduction

    and when I'm applying codes, only blackboxes appear in the display after upload. Please help.