Find Pressure Measurement, Level Measurement, Temp&Humidity Instruments on Industry Directory, Reliable Manufacturer/Supplier/Factory from China.

Inquiry Basket (0)
Home > Industry Information > Ultrasonic distance measuring module working principle _HC-SR04 module explain

Ultrasonic distance measuring module working principle _HC-SR04 module explain

2021-05-02

There are many types of ultrasonic ranging module. At present, URM37 ultrasonic sensor is the most commonly used 232 interface, which can be adjusted to TTL interface. The URM05 high-power ultrasonic sensor can reach a distance of 10 meters, which is currently a relatively long test distance. In addition, there are several more commonly used foreign SRF series ultrasonic modules, the current ultrasonic module accuracy can reach 1cm. This article mainly explains the working principle of the HC-SR04 module guitar. First of all, it introduces the advantages and applications of the HC-SR04 module. Secondly, it describes the working principle and circuit diagram of the ultrasonic ranging module. Finally, it introduces the electrical parameters, ultrasonic timing diagram, operation and Programs, follow the small series specifically to find out.

HC-SR04 module advantages and applications

HC-SR04 module advantages

This module has stable performance, accurate measurement distance, high module accuracy, and small blind area.

Product application areas:

1, robot obstacle avoidance

2, object distance measurement

3, liquid level detection

4, public security

5, parking lot testing

Ultrasonic distance measuring module working principle _HC-SR04 module explain

Ultrasonic distance measuring module working principle

(1) Use the IO port TRIG to trigger distance measurement and give a high level signal for at least 10us;

(2) The module automatically sends 8 square waves of 40khz to automatically detect whether there is a signal return;

(3) There is a signal return, through the IO port ECHO output a high level, the duration of the high level is the time from the ultrasonic to the return. Test distance = (high time * speed of sound (340M/S))/2;

(4) This module is simple to use, a control port sends a high level of more than 10US, you can wait for a high output at the receiving port. Once the output is on, the timer can be started. When this port goes low, the value of the timer can be read. At this time, the time of this distance measurement can be calculated. With this constant cycle measurement, you can reach the value of your moving measurement.

Ultrasonic distance measuring module circuit diagram

Ultrasonic distance measuring module working principle _HC-SR04 module explain

Electrical parameters

1

Ultrasonic distance measuring module working principle _HC-SR04 module explain

Ultrasonic timing chart

Ultrasonic distance measuring module working principle _HC-SR04 module explain

operating

During initialization, both the trig and echo ports are set low. First, send a high pulse of at least 10 us to the trig (the module automatically sends eight 40-k square waves outward), then wait, capture the rising edge of the echo output, and capture At the same time as the rising edge, turn on the timer and start counting again. Wait for the falling edge of echo again. When the falling edge is captured, read the timer's time. This is the time that the ultrasonic wave runs in the air, according to the test distance = (high level Time*sound speed (340M/S))/2 can calculate the distance from the ultrasonic wave to the obstacle.

The following is a program for Freescale XS128 microcontroller ranging:

While(1)

{

PT1AD0_PT1AD00 = 1; // Input high pulse to ultrasonic module

PITINTE_PINTE1=1; //Open the PIT1 timer

While(!(counter0=4)); //wait 20us

PITINTE_PINTE1=0;counter0 = 0; //Turn off the timer and clear the count

PT1AD0_PT1AD00 = 0; //trig pin pulls low

PORTB_PB0 = 0; // indicator 0

While(!(PT1AD0_PT1AD01 == 1)); //waits for echo output rising edge

PORTB_PB1 = 0; // indicator 1

PITINTE_PINTE0=1; //Open the PIT0 timer

While(!(PT1AD0_PT1AD01 == 0)); //wait for falling edge

Distance = counter*17/20; //Calculate distance, unit CM

PITINTE_PINTE0=0; //Close the timer

PORTB_PB2 = 0; // LED 2

PITINTE_PINTE0=1; //Open timer 500ms, digital display

While(!(counter)=10000))

{

Showing(distance); //display distance, precise 1cm

}

PITINTE_PINTE0=0;counter=0; //turn off the timer and clear it

}


JRT produced the high resolution optical distance measurement sensor for 16 years with lower cost. Our distance measuring sensor have small size, high accuracy.
The laser range finder components is characterized by an above-average measured value output frequency, up to 8hz. The miniature laser distance module is also suitable for monitoring defined distance and height during transport.  

Distance Measuring Sensor, Accurate Laser Measuring Sensor, High Accuracy Distance Sensor, Optical Distance Sensors
Pressure Measurement,Level Measurement Co., Ltd. http://www.infrareddistancesensor.com