Monday, June 27, 2016

Ultra Sonic Sensor Interfacing with Arduino

Most of us are aware of Ultra-Sonic Sensor Module, which is used to measure the obstacle distance using Ultra Sonic Waves.
In this project, Obstacle Distance is measured using Ultra Sonic Sensor and Arduino and then data is displayed on MATLAB or LabVIEW.
MATLAB or LabVIEW application sends the query packet to Arduino asking for the Obstacle Distance and then Arduino will reply back with the Obstacle Distance.
For sensing Obstacle distance using Arduino, the NewPing library is used.

To play with Ultra Sonic Sensor, you need one plus Arduino UNO Board (or any other Arduino board).


Description
MATLAB/LabVIEW application will send query commands to the Arduino UNO board, which sends the results back to the MATLAB/LabVIEW application. Right now in this application, there is only two types of command that MATLAB/LabVIEW sends, one is Led Status and another is Ultra Sonic Sensor Obstacle distance status.
Arduino Board sends the Obstacle distance to MATLAB/LabVIEW whenever an application needs it, right now it is configured for 1sec.
Arduino Board toggles the LED state whenever LabVIEW queries the Led Status.

The Wiring Diagram is as follows:

Arduino Uno and UltraSonic Sensor Connection Diagram

MATLAB GUI Demonstration



LabVIEW GUI Demonstration


We have posted a detailed tutorial on interfacing Ultrasonic sensors with Raspberry Pi, click here to read the tutorial.

5 comments:

  1. Hi, do we need to download arduino library for matlab before using the code?

    ReplyDelete
    Replies
    1. No, you don't need to do that.
      Just follow the instructions shown in video or in this post.

      Delete
  2. Hi, it shows error: "NewPing library is missing". how to solve it?

    ReplyDelete
  3. Where can we download the NewPing library?

    ReplyDelete
  4. NEW PING LIBRARY IS NECESSARY! please provide the link where we can download it

    ReplyDelete