 Hello everyone! In this video, we are going to learn all about Ultrasonic Sensor, how it works, how to interface it with prototyping boats, like if I Vinard Vino and how to program it in Pictor Blocks. Finally, we'll have a look at what wonders we can create using it. Let's begin! First, let's understand what an Ultrasonic Sensor is and how it works. An Ultrasonic Sensor is a device that detects the object and measures the distance to it. It measures the distance by emitting the ultrasound wave and receiving the wave that gets reflected from the object. By recording the time elapsed between emitting the wave and receiving the reflected wave, it calculates its distance from the object. Now that we know how the Ultrasonic Sensor works, let's have a look at how to interface it with evive and see it in action. The HC-SRO4 Ultrasonic module, the one we are going to use, has four pins, BCC, Ground, Trigger and Eco. The ground and the VCC pins of the module must be connected to the ground and the plus 5V pin on evive respectively. Connect the trigger pin to evive digital pin 2. Connect eco pins to evive digital pin 3. Now let's program the Ultrasonic Sensor and Pictor Blocks. It is a graphical programming software based on scratch blocks. If you want to download Pictor Blocks, you can download it from the link given in the description box. Before doing anything else, connect evive to your computer using a USB cable. Next, open Pictor Blocks. Then, click on the board button and select evive from the drop-down. Now, from the dialog box that appears, choose the appropriate serial port. Before writing the script, make sure that the firmware is uploaded. If not, upload it using the upload firmware button. Next, let's make a small script to make Toby to let us know the distance measured by the Ultrasonic Sensor and sound evives buzzer if the distance is less than 10 cm. First, drag and drop the same block from the looks palette. Now, using join operator block, we will make Toby see the distance obtained from the reading of the Ultrasonic Sensor. And if block and monitor the distance using getUltrasonicSensorDistanceBlock. If the distance is found to be less than 10 cm, make the buzzer play a tone. To run the script continuously, we'll use the forever block. Place a when flag clicked heart block above the forever block. It will ensure that the script runs when the flag is clicked. Check whether everything is working perfectly or not by running the script. Now that the script is working perfectly fine in real time, let's make a script to work with Ultrasonic Sensor without having evive connected to the computer. For that, we'll have to work in the upload mode. To work in the upload mode, click the toggle button. Now, let's make a small script to display the distance on evive's screen and also play a tone on evive's buzzer if it is less than 10 cm. Next, drag and drop a play tone block inside the space of the if block to make the buzzer play a tone whenever the distance is less than 10 cm. We'll write block to display the value obtained from the Ultrasonic Sensor on the screen. To write the distance on evive's display at a particular position, we need to first set the cursor at that position. Use a forever block to run the code continuously. Now, let's set the background color of the screen and the text color for better visibility. Place the when evive starts up head block to execute the program and upload the code using the upload button. To know how to work with the Ultrasonic Sensor, there are a number of projects you can make using it. Like the simple Angry Bird based Intuition Detection System, a color sorting robotic arm and much more. That's it for this video. If you liked it, give it a thumbs up and share it with your friends. For more such educational content, subscribe to STEMpedia and follow us on Facebook, Instagram and Twitter. Bye!