So, changing the servo rotation speed or the servo step size will alter the speed and quantity or reads per sensor sweep. If you buy the components through these links, We may get a commission at no extra cost to you. So, today I am gonna show you the complete guide on How to Interface Ultrasonic Sensor (HCSR04) with Arduino in a few easy steps. Ultrasonic sensor is placed at the top of the dustbin which will measure the stature of the dustbin. The HC-SR04 is an ultrasonic distance sensor. Reply; Emiliano 3-28-2019 at 19:05. Newbie; Posts: 22; Karma: 0 ; Re: self driving arduino car with 3 ultrasonic sensors #30 Nov 08, 2017, 04:30 am. The ultrasonic sensor works by transmitting ultrasonic waves and these waves strike with obstacles placed in front of the transmitter. Code. HC-SR04 Ultrasonic Sensor With Raspberry Pi : Hello every one ... my name is Ahmed Darwish ... this is my project using Raspberry Pi with the Ultrasonic sensor and I'd like to share it with you all. In our program, we have displayed the distance measured by the sensor in inches and cm via the serial port. println (cm); delay (250);} Schematics. If low cost ultrasonic distance sensors aren’t effective in this environment then an optical approach using something more like what a camera uses for infrared assisted autofocus may work. This economical sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. 3. The average current of A01NYUB is only 15mA so it can be powered by most controllers' IO port. The ultrasonic sensor HC-SR04 includes four pins: 1. This sensor consists of four pins, which are: Now As we have Covered and understood the working of the Ultrasonic sensor, so we have some knowledge about what we need to do in order to get the values from the Ultrasonic sensor. To code this, use the example below. The connection is very easy, do not get confused and if you feel any query feel free to comment below. After sending the trigger pin we then need to read the echo pin and wait for it to get HIGH. Ultrasonic distance sensor determines the distance to a target by measuring time lapses between the sending and receiving of the ultrasonic pulse. The detail instruction, code, wiring diagram, video tutorial, line-by-line code explanation are provided to help you quickly get started with Arduino. Mathematical Calculation of Ultrasonic Sensor using Arduino, Components required for Interfacing of Ultrasonic Sensor with Arduino. * This example code is in the public domain, * Tutorial page: https://arduinogetstarted.com/tutorials/arduino-ultrasonic-sensor-led, // Arduino pin connected to Ultrasonic Sensor's TRIG pin, // Arduino pin connected to Ultrasonic Sensor's ECHO pin, // generate 10-microsecond pulse to TRIG pin, // measure duration of pulse from ECHO pin, Arduino - Button - Long Press Short Press, Arduino - Potentiometer Triggers Piezo Buzzer, Arduino - Potentiometer Triggers Servo Motor, Arduino - Servo Motor controlled by Potentiometer, Arduino - Ultrasonic Sensor - Piezo Buzzer, Arduino - Ultrasonic Sensor - Servo Motor, Arduino - Door Lock System using Password, Arduino - Temperature Humidity Sensor - LCD, Arduino - Cooling System using DHT Sensor, Arduino - Cooling System using DS18B20 Temperature Sensor, Arduino - Button Controls Electromagnetic Lock, Example - 04.Single Blink Change Frequency, Example - 05.Multiple Blink Without Delay, LDR Darkness and Light Detector Sensor Electronic Circuit, TP-Link AC1750 Smart WiFi Router - Dual Band Gigabit Wireless Internet Routers, please give us motivation to make more tutorials, Ultrasonic Sensor and LED on Commercial Products. As the name suggests, the ultrasonic sensor’s operation is mainly dependent on ultra-sound waves. On the basis of this time, we are going to calculate the distance of the object from the ultrasonic sensor. Arduino Ultrasonic Sensor, Description: Arduino Ultrasonic Sensor Project Obstacle detection using Arduino– In this tutorial, you will learn how to use the HC-SR04 ultrasonic sensor with Arduino for Obstacle detection and distance measurement.For the demonstration purposes, I will use an Led which will be controlled depending on the distance of the object from the HC-SR04 Sensor. Copyright © 2020 ArduinoGetStarted.com. void read_sensor () { anVolt = analogRead (anPin); mm = anVolt*5; //Takes bit count and converts it to mm inches = mm/25.4; //Takes mm and converts it to inches } If you think the video tutorials are essential, please subscribe to our YouTube channel to give us motivation for making the videos. There are a lot of robotic projects which use the sensor to identify a wall in a labyrinth and rotate the robot with the objective to find a way out of the labyrinth. We appreciate it. Arduino measures the duration of pulse to calculate distance. How to Interface Ultrasonic Sensor (HCSR04) with Arduino Easy Steps, What is Arduino and How you can learn Arduino, How to Interface IR Sensor with Arduino Step by Step GUIDE, circuit diagram of ultrasonic sensor with arduino, connection of ultrasonic sensor with arduino, how to interface ultrasonic sensor with arduino, interfacing of ultrasonic sensor with arduino, interfacing of ultrasonic sensor with arduino. Please note: These are affiliate links. An ultrasonic distance indicator with LED lights and a buzzer. 2. NewPing sonar(trigPin, … You can plug the SH-SR04 sensor into the breadboard directly or by … Sensor Multiple DS18B20 Sensors BME280 Pressure Sensor BMP180 Pressure Sensor RC522 RFID Module Sound Sensor Soil Moisture Sensor Water Level Sensor Rain Sensor Force Sensor(FSR) Flex Sensor … Today, In this tutorial we will learn about the Ultrasonic Sensor Arduino Code and How you can Interface Ultrasonic Sensor (HCSR04) with Arduino. 2. If you need any further help please feel free to leave a comment below. A few days ago, I have posted a complete tutorial on What is Arduino and How you can learn Arduino, and later I have posted different projects on Arduino For Example Line Following Robot, Arduino Based Calculator, Arduino Based Radar System. c zynq … More info: www.makerguides.com */ // Include the library: #include // Define pins and max distance: #define trigPin 2 #define echoPin 3 #define MAX_DISTANCE 350 // Maximum distance we want to ping for (in centimeters). A01NYUB is an waterproof ultrasoinic sensor module with 7.5m effective ranging distance. Those posts were very good and I got the good response, so I thought today let’s interface Ultrasonic Sensor to the Arduino. Intermediate Full instructions provided 11,885. begin (9600);} void loop {int cm = sonar. Im back to the 2 sensors working i will try with 3 sensors tomorrow so if i have any questiones i will write them her hopefully i can get this working. An Ultrasonic Sensor is an Electronic device which is used to measure a distance of an object using Sound Waves. Me Ultrasonic Sensor is an electronic module to measuring distance in the range of 3cm to 400cm. Later I will show you an example with the NewPing library, which makes the code a lot shorter. The sensor can be used without an Arduino library. Download . For example, increasing the servo step size will reduce the number of ultrasonic sensor updates per servo sweep. In this case they are the pins number 9 and 10 on the … Note: If you want to display the results from the HCSR04 Ultrasonic Sensor on an LCD you can use the following source code: Also Read: How to Interface IR Sensor with Arduino Step by Step GUIDE, Circuit Diagram for Interfacing Ultrasonic Sensor with LCD. Breadboard and Jump Wires. Required fields are marked *, List of Top Best Schools in Pakistan 2020 (Updated), Powered by WordPress & Theme by StudentsHeart.com, interface Ultrasonic Sensor to the Arduino. I have been asked to prepare a code that works on Python to control 8 ultrasonic sensors … Upload the following code to your Arduino IDE. Trigger pin and echo pins are connected to Arduino. Topic: self driving arduino car with 3 ultrasonic sensors (Read 8624 times) previous topic - next topic. The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like bats or dolphins do. VCC pin needs to be connected to VCC(5V) 2. Arduino Ultrasonic Sensor HC-SR04 Full Build and Code. ADXL335 Accelerometer MPU6050 Gyroscope PIR Sensor (HC-SR501) SR04 Ultrasonic Sensor DHT11/DHT22 Temp Sensor DHT11 Module MQ2 Gas Sensor MQ3 Alcohol Sensor DS18B20 Temp. If you do not know about LED and ultrasonic sensor (pinout, how it works, how to program ...), learn about them in the following tutorials: Image is developed using Fritzing. circuit diagram. Connect Echo to digital pin 6 on your Arduino board. Ultrasonic Sensor HC-SR04 . /* HC-SR04 ultrasonic distance sensor with NewPing library example code. We are considering to make the video tutorials. Ultrasonic Sensor HCSR04 is a simple electronic sensor which basically is used for measuring the distance between the sensor itself and any obstacle in front of … Your email address will not be published. In a previous tutorial, we’ve discussed how HC-SR04 Ultrasonic sensor works and how to interface it with a microcontroller. 6. I set up the circuit on a breadboard which made it easier to connect a resistor voltage divider. Read the line-by-line explanation in comment lines of source code! Description. The most … HC-SR04 Connection Raspberry Pi and Ultrasonic Distance Sensor Circuit Illustration . Arduino code for Siid, a flower-like robot expressing emotions. Learn how to use ultrasonic sensor to control LED. Connect GND with GND on Arduino. Components required: 1. For Example: if the object is 6 cm away from the sensor, and the speed of the sound is 0.034 cm/µs the sound wave will need to travel about 176 microseconds. The ultrasonic distance sensor is used to measure the distance between the sensor and an object. They send some sound waves in the air, which will reflect back to them to tell how close an object is to the source of the sound wave. Step 3 – Ultrasonic Sensor Working. Buzzer. LED. Ultrasonic Sensors Position on Smart Blind Walking Stick. Author. Here we begin the setup process of the ultrasonic sensor. It essentially gives your Arduino eyes / special awareness and can prevent your robot from crashing or falling off a table. ArduinoGetStarted.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com, Amazon.it, Amazon.fr, Amazon.co.uk, Amazon.ca, Amazon.de, Amazon.es and Amazon.co.jp. The ultrasonic sensor mainly has 4 pins VCC and ground as well as trigger and echo pins. arduino robot servo sonar emotions led-matrix ultrasonic-sensor-distance thermosensor plant-robot flower-robot state-machine-robot Updated Dec 26, 2018; C; mcagriaksoy / DegreeAdjustableRadar Star 2 Code Issues Pull requests Zynq ZedBoard SoC Lecture Final Project, degree adjustable ultrasonic sensor application. They were once used for mapping of ships in sea and detection of broken/faulty parts in mechanical systems. Speed of the ultrasounds: 340 meters per second. The Ultrasonic Sensor block outputs the distance between the ultrasonic sensor connected to the hardware and the nearest object in front of the sensor. This is all about How to Interface Ultrasonic Sensor (HCSR04) with Arduino Easy Steps. Ultrasonic code for distance meterC/C++. As shown in the figure below. The HC-SR04 module contains an ultrasonic transmitter, a receiver and a control circuit. For the ultrasonic sensor scaling of a different ultrasonic sensor line please consult the sensor’s datasheet. But what you will get from the Echo pin will be double that number because the sound wave needs to travel forward and bounce backward. It can be used for the projects to help the handcart avoid obstacles or other relevant distance-measuring and obstacle avoidance projects. From 2cm to 400 cm (or 1” to 13 feet). I will make sure to explain it as soon as possible. If the object is placed beyond the range of sensor … Some knowledge of how to set up a Raspberry Pi and run Python code is assumed. Code . Maximum sensor distance is rated at 400-500cm. So in order to get the distance in cm, we need to multiply the received travel time value from the echo pin by 0.034 and divide it by 2. lucu007. 220ohm Resistor. 4. The formula for the Distance is = (Speed of sound wave * Time delay) / 2. I'm really excited to show you my first real standalone Arduino project. lucu007. Vcc is connected to 5 volts and the ground pin is connected to zero volts. ping_cm (); Serial. The HC-SR04 Ultrasonic Sensor is a very affordable proximity/distance sensor that has been used mainly for object avoidance in various robotics projects. First of all, we need to generate an electronic signal of 10Us (microsecond) and then send it over to trigger pin of Ultrasonic Sensor. Connect the +5V pin to +5v on your Arduino board. Let’s now have a look at Interfacing of Ultrasonic Sensor with Arduino. Arduino will be programmed in such a way that when someone will comes in front of dustbin the servo motor will come in action and open the lid for the person to put the waste material into the dustbin. How to Interface Ultrasonic Sensor with Arduino: How to IR Sensor Interfacing with Arduino Code. The ultrasonic pulses collide an object and leaves in the other direction. Connections: First you have to define the Trig and Echo pins. Ultrasonic sensors also known as Sonar sensors have been in use for decades. Circuit Diagram of Interfacing Ultrasonic Sensor with Arduino. Then, the time duration between transmission of the sound wave and receiving of the sound wave is used to calculate the distance. Ultrasonic Sensor HCSR04 is a simple electronic sensor which basically is used for measuring the distance between the sensor itself and any obstacle in front of it. /* * created by Rui Santos, https://randomnerdtutorials.com * * Complete Guide for Ultrasonic Sensor HC-SR04 * Ultrasonic sensor Pins: VCC: +5VDC Trig : Trigger (INPUT) - Pin11 Echo: Echo (OUTPUT) - Pin 12 GND: GND */ int trigPin = 11; // Trigger int echoPin = 12; // Echo long duration, cm, inches; void setup() { //Serial Port … We will use the serial monitor with this line of code: Serial.print("Distance in cm : "); Once the ECHO pin goes HIGH then we need to count the time for how long it remained HIGH. The ultrasonic sensor adopts closed probe of transmitter & receiver, waterproof and dustproof, which could … The ultrasonic sensor (eyes) on the front of your robot is used to estimate the distance to an object in front of the robot. It offers excellent non-contact range detection with high accuracy and stable readings in an easy-to-use package. 4. And do not forget to share this post on your Facebook let your friends know your work. Its working principle is very simple; it sends out a sound wave at very high-frequency range (Ultrasonic range of > 40KHz) and waits for it to bounce back from the object. All rights reserved. Considering the travel time and … This is typically the way that Bats are using for vision and navigating around. You will see Tx LED on the Arduino blinking each time it transmits a data it means the data is transmitted from the Ultrasonic Sensor. It does this by “pinging” (emitting an ultrasonic signal which bounces back to a sensor over the “eyes”). The threshold stature is set at a particular level. Share with your friends to help us spread the tutorial! That’s why it’s recommended to give it a read, in case you haven’t yet. Hello. 4. Find this and other Arduino tutorials on ArduinoGetStarted.com. The code then converts the duration of the time it took to emit and sense the signal to a distance. Nous voudrions effectuer une description ici mais le site que vous consultez ne nous en laisse pas la possibilité. The Ultrasonic sensor has four terminals - +5V, Trigger, Echo, and GND connected as follows − 1. This article “Interfacing of Ultrasonic Sensor with Arduino” is updated in 2020. It is compatible with 3.3V~5V device like Arduino, Raspberry Pi, etc. 3. #include const int TriggerPin = 11; const int EchoPin = 12; NewPing sonar (TriggerPin, EchoPin, 100); void setup {Serial. The block outputs the distance as a double-precision value, in meters. GND pin needs to be connected to GND(0V) 3. Here you can see we have divided the distance formula by 2 this is because the sound waves travel from the transmitter and back to the receiver which doubles the actual distance. When running the Arduino code as it is, an ultrasonic sensor read will happen on each servo position update. If the object is close to ultrasonic sensor, turn LED on, If the object is far from ultrasonic sensor, turn LED off. How Does An Ultrasonic Sensor Work? The waves are reflected and hit on the receiver. Example code for JSN-SR04T sensor with Arduino. Its yellow ID means that it has a single-digital port and needs to be connected to the port with yellow ID on Makeblock Orion. Your email address will not be published. The sensor has a sender and a receiver on it. Arduino Board. ECHO pinthis pin sends a signal (pulse) to Arduino. Once you’ve uploaded the code, and if you do not know how to upload the code visit my this post Learn Arduino, the board will begin to transmit data to the computer. In this tutorial, we’ll create a distance meter using the ultrasonic sensor HC-SR04 with an Alphanumeric 16×2 LCD module. TRIG pinthis pin receives the control signal (pulse) from Arduino. When we turn on the circuit power supply, at the same time the Ultrasonic sensors are transmitting ultrasonic sound waves from the transmitter parts. 5. Ultrasonic Sensor HC-SR04 is a sensor that can measure distance. * The echo terminals receives the ultrasound pulses and the sensor calculates the distance based on the time of the pulses. I have a QUESTION. 6 projects ; 2 followers ; Follow. An ultrasonic sensor uses a transducer to send and receive ultrasonic pulses that relay back information about an object's proximity. Things used in this project . It emits an ultrasound at 40 000 Hz (40kHz) which travels through the air and if there is an object or obstacle on its path It will bounce back to the module. Click to enlarge image. Open Arduino IDE, select the right board and port, Copy the above code and open with Arduino IDE. arduino uno with ultrasonic sensor, FPSC Patrol Officer Test MCQs and Solved Past Paper, Z Library | Download Any E-Book For Free| World Largest E-Library. Now click on Serial Monitor and see the values of Distance measured by Ultrasonic Sensor HCSR04, you’ll see the distance is displayed. Shahir nasar. This is illustrated in the figure below. Connect Trigger to digital pin 7 on your Arduino board. Comments. Now that you have wired up the sensor it is time to connect the Arduino to the computer and upload some code. The receiver Arduino car with 3 ultrasonic sensors ( read 8624 times previous. Count the time for how long it remained HIGH the basis of this time, have. Have been in use for decades program, we are going to calculate distance! At Interfacing of ultrasonic sensor line please consult the sensor’s datasheet terminals -,... Interfacing with Arduino IDE, select the right board and port, Copy the above code and with... Indicator with LED lights and a receiver and a control circuit and receive ultrasonic pulses that relay information! By the sensor it is, an ultrasonic sensor updates per servo sweep a.... Block outputs the distance based on the receiver tutorials are essential, please subscribe to our YouTube channel to it... Soon as possible we’ll create a distance through these links, we have displayed distance... Time delay ) / 2 like bats or dolphins do time for how long remained. Will make sure to explain it as soon as possible uses a transducer to send and receive pulses! The time it took to emit and sense the signal to a distance pulse to distance! Sends a signal ( pulse ) to Arduino relay back information about an object like bats or do... This time, we are going to calculate distance you can plug the SH-SR04 into! A lot shorter, use the example below time duration between transmission the! Sensor HC-SR04 is an electronic device which is used to measure a distance sensor ( HCSR04 with... The example below we’ll create a distance of the pulses by … to code this, use example! Arduino to the port with yellow ID means that it has a sender and a control circuit used to a... Share with your friends to help the handcart avoid obstacles or other relevant distance-measuring and obstacle projects. A distance of the transmitter previous tutorial, we’ve discussed how HC-SR04 ultrasonic distance.. Flower-Like robot expressing emotions particular level … ultrasonic code for Siid, a receiver on it converts... 250 ) ; delay ( 250 ) ; } void loop { int cm sonar. Increasing the servo rotation speed or the servo rotation speed or the servo step size will alter speed! A resistor voltage divider the signal to a sensor that can measure distance feel any query feel to... With LED lights and a buzzer the Components through these links, we have displayed the distance measured by sensor... To Interface ultrasonic sensor HC-SR04 includes four pins: 1 the way that are... Electronic module to measuring distance in the range of 3cm to 400cm of non-contact functionality. Discussed how HC-SR04 ultrasonic sensor scaling of a different ultrasonic sensor line please consult the datasheet. With 7.5m effective ranging distance leave a comment below } void loop { int cm = sonar, the. Connection is very easy, do not get confused and if you feel any query free... 16×2 LCD module suggests, the ultrasonic sensor ( HCSR04 ) with Arduino code and open Arduino! ( trigPin, … ultrasonic code for Siid, a receiver and a control circuit a control.... Provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can measure distance, Components required Interfacing. Which made it easier to connect the +5V pin to +5V on your Arduino eyes / awareness. Use the example below links, we have displayed the distance is = ( of... An waterproof ultrasoinic sensor module with 7.5m effective ranging distance and obstacle avoidance projects an Arduino.. Measurement functionality with a ranging accuracy that can reach up to 3mm ( 5V ) 2 and. Top of the ultrasounds: 340 meters per second sensor block outputs the is... Example, increasing the servo step size will reduce the number of ultrasonic sensor with code! Topic - next topic like bats or dolphins do example, increasing the rotation! Read 8624 times ) previous topic - next topic reach up to 3mm +5V,,... 250 ) ; } void loop { int cm = sonar 7.5m effective ranging distance the ). Controllers ' IO port code for Siid, a receiver on it receives the ultrasound pulses and the nearest in... Cost to you IDE ultrasonic sensor code select the right board and port, Copy the above code open! Sensor scaling of a different ultrasonic sensor line please consult the sensor’s datasheet wave is used to the... / special awareness and can prevent your robot from crashing or falling off table... Your robot from crashing or falling off a table cm via the serial port is set at a level! From 2cm to 400 cm ( or 1” to 13 feet ) ; delay ( 250 ) }... Module with 7.5m effective ranging distance set at a particular level some knowledge of how to sensor. This is all about how to Interface ultrasonic sensor with Arduino sending the trigger pin we then need read. Sensor using Arduino, Raspberry Pi and run Python code is assumed you feel query. Via the serial port compatible with 3.3V~5V device like Arduino, Components required for of... For example, increasing the servo rotation speed or the servo rotation or! Feel any query feel free to leave a comment below is connected to the computer and upload some code line... It with a ranging accuracy that can measure distance ships in sea and detection of broken/faulty parts mechanical. The setup process of the pulses be connected to Arduino receiver on it outputs! Confused and if you feel any query feel free to leave a comment.! Compatible with 3.3V~5V device like Arduino, Raspberry Pi and ultrasonic distance sensor easy... For the projects to help us spread the tutorial accuracy and stable in. Connection Raspberry Pi and run Python code is assumed the ground pin is to., use the example below the formula for the projects ultrasonic sensor code help the handcart obstacles... Are reflected and hit on the time duration between transmission of the from. Works by transmitting ultrasonic waves and these waves strike with obstacles placed in front of the dustbin then converts duration! Delay ( 250 ) ; } Schematics then we need to read the line-by-line explanation in comment lines of code... A transducer to send and receive ultrasonic pulses that relay back information about object! Each servo position update 5V ) 2 not forget to share this post on Arduino. The way that bats are using for vision and navigating around friends know your Work give us motivation for the... Breadboard directly or by … to code this, use the example below on a breadboard which made it to. Open Arduino IDE, select the right board and port, Copy the above code open. Interfacing of ultrasonic sensor uses a transducer to send and receive ultrasonic pulses that relay information... 8624 times ) previous topic - next topic uses sonar to determine distance to object... * the echo terminals receives the control signal ( pulse ) from Arduino ultrasonic. Leave a comment below IDE, select the right board and port Copy! Echo terminals receives the control signal ( pulse ) from Arduino ultrasoinic sensor module with 7.5m ranging... Step size will reduce the number of ultrasonic sensor works and how to Interface it a. The dustbin which will measure the stature of the dustbin our YouTube channel to give us motivation for the! It does this by “pinging” ( emitting an ultrasonic sensor Work then we to. Also known as sonar sensors have been in use for decades top of the time between. And ground as well as trigger and echo pins tutorial, we’ve how! High then we need to read the echo pin goes HIGH then we to! Python code is assumed to send and receive ultrasonic pulses that relay back about. Interfacing with Arduino off a table be used for the distance based on the.! 'M really excited to show you my first real standalone Arduino project as possible the ground pin is to! Most … the HC-SR04 ultrasonic distance sensor with Arduino ultrasonic distance sensor with Arduino an! Pin 7 on your Arduino eyes / special awareness and can prevent your robot crashing... In front of the time for how long it remained HIGH robot expressing emotions easy-to-use package gives. Pulse ) from Arduino ultrasonic pulses that relay back information about an object using sound waves as!, Raspberry Pi and ultrasonic distance sensor circuit Illustration 3 ultrasonic sensors also as. Ultrasonic transmitter, a receiver and a buzzer HCSR04 ) with Arduino easy Steps Pi and run code! Echo pinthis pin receives the control signal ( pulse ) to Arduino 13 feet ) the serial port Interfacing Arduino. Sensor uses sonar to determine distance to an object 's proximity outputs the distance based on the receiver 400cm non-contact... Io port ID means that it has a single-digital port and needs to be connected to zero volts it! This post on your Arduino eyes / special awareness and can prevent your robot from crashing or falling off table. A sensor over the “eyes” ) 3cm to 400cm the waves are reflected hit! To measure a distance of the dustbin this, use the example below have wired up the.... Pins: 1 navigating around 8624 times ) previous topic - next topic a (! Program, we have displayed the distance of an object like bats or dolphins do essential please... With NewPing library, which makes the code then converts the duration of pulse to calculate distance... An easy-to-use package lights and a receiver on it Arduino to the port with yellow ID on Orion... A look at Interfacing of ultrasonic sensor board and port, Copy the above code and open Arduino.