QB042/QB093 Ultrasonic Sensor

1.Product Introduction

../../_images/Ultrasonic-1.png

Ultrasonic sensor is a sensor used to measure distance, can be used to help the car to avoid obstacles or other related distance obstacle avoidance projects.

The ultrasonic transmitter emits ultrasonic waves in a certain direction, at the same time the timer starts timing, ultrasonic waves spread in the air, on the way to encounter obstacles will immediately return, ultrasonic receiver received reflected waves immediately stop timing. The propagation speed of sound wave in the air is 340m/s. According to the time t recorded by the timer, the distance s between the launching point and the obstacle can be calculated, that is, s=340*t/2.

Application reference: obstacle avoidance car, handheld range finder, water level monitoring, ultrasonic counter, etc.

2.Parameter Specification

Parameter Value//Description
Operating voltage 3.3V~5V
Operating temperature -40°C~+85°C
Range of distance measurement 3cm~500cm
Detection accuracy 0.1cm
Blind area of measurement <3cm
Frequency of emission 40KHz
Size 4.9cm*2.2cm
../../_images/Ultrasonic-5.jpg

3.Wiring Diagram

../../_images/Ultrasonic-2.png
Ultrasonic Sensor UNO
VCC 5V
GND GND
Echo Digital Pin 11
Trig Digital Pin 12

4.Sample Code

 1//www.acebott.com
 2#include "SR04.h"
 3#define TRIG_PIN 12
 4#define ECHO_PIN 11 
 5SR04 sr04 = SR04(ECHO_PIN,TRIG_PIN);//Initializing the ultrasonic sensor
 6long a;//Create a long integer variable to store the distance detected by the ultrasound
 7
 8void setup() {
 9   Serial.begin(9600);//Initialization of Serial Port
10   delay(1000);
11}
12void loop() {
13   a=sr04.Distance();//Obtain the ultrasonic sensor detection value
14   Serial.print(a);//The value of the ultrasonic sensor is displayed on the serial port
15   Serial.println("cm");
16   delay(1000);
17}

5.Test Result

After uploading the code to the controller board, open the serial port monitor of the Arduino IDE and set the baud rate to 9600.

Move your hand or object in front of the sensor and you can see their distance value.

../../_images/Ultrasonic-3.png
../../_images/Ultrasonic-4.png

6.Related Resources

PDF and Code

7.Get One Now

B2B Business: info@acebott.com

Related posts

Leave the first comment

Apply for a Free Trial

This product trial is prioritized for educators and academic institutions.

By filling out and submitting this form, you agree to the
Acebott Product Trial Terms and Conditions.

Unlock Your Exclusive Education Discount Today

Fill out this form to apply for special discounts tailored for educators and institutions. Enjoy at least 5% off on our STEM kits—because education deserves a reward!

Please fill out the form above, and our team will get in touch with you promptly!
😊🚀

Get A Free Quote! 🎉

Can’t find the perfect STEM kit ? Want the best wholesale prices ?
Interested in becoming a distributor ?

Just fill out the form above, and we’ll get back to you ASAP with all the info you need! 😊🚀

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.