JSN-SR04T waterproof ultrasonic distance measuring module
Features:
- Working voltage: DC 3.0-5.5V
- Working current: <8mA
- Accuracy: ±1cm
- Acoustic emission frequency: 40khz
- Angle: less than 75 degrees
- Working temperature: -20 ~ 70 ℃
There are three working modes for this module to choose from, and customers can switch or experiment according to their actual needs. As shown below
Mode 1: R27=open means no welding is required. The mode is explained as follows
1. Basic working principle:
(1) Use IO port TRIG to trigger distance measurement, giving a high level signal of less than 10us.
(2) The module automatically sends 8 40khz square waves, and automatically detects whether there is a signal return;
(3) There is a signal return, and a high level is output through the IO port ECHO. The duration of the high level is the time from the ultrasonic wave to the return. Test distance = (high level time * speed of sound (340M/S))/2;
( 4) After the module is triggered for ranging, if the echo cannot be received (because it exceeds the measured range or the probe is not directly facing the measured object), the ECHO port will automatically change to low level after 60MS, marking this time The measurement ends, regardless of success or failure.
( 5) Description of LED indicator, LED is not a power indicator, it will light up after the module receives the trigger signal, and the module is in working state at this time.
2. Ultrasonic timing chart:
Figure 2. Ultrasonic timing diagram
Ø Model II: R27 = 47K 47K i.e. resistance welding. The mode is explained as follows
The output format of the serial port is TTL level , which means: the module automatically outputs the value of the distance with a period of 100MS, in mm. Serial port baud rate: 9600, n, 8, 1.
After the module is powered on and recognized , it directly enters the working mode. The module carries out distance measurement every 100ms, and outputs a frame from the pin TX, including 4 8-bit data. The frame format is: 0XFF+H_DATA+L_DATA+SUM
1.0XFF : It is the start data of a frame, used for judgment;
2.H_DATA: the upper 8 bits of the
distance data ; 3.L_DATA: the lower 8 bits of the distance data;
4.SUM: the sum of the data, used for validation. Its 0XFF+H_DATA+L_DATA =SUM (lower 8 bits only)
Note : H_DATA and L_DATA combine 16-bit data, that is, the distance value in millimeters
E.g:
Product response FF 07 A1 A7
The check code SUM=A7=(0x07+0xA1+0Xff)&0x00ff
0x07 is the high data of the distance;
0xA1 is the low data of the distance;
The distance value is 0x07A1; converted to decimal is 1953; the unit is: mm
Note: The module outputs a short distance value in the blind zone. If the module cannot measure the data or exceeds the distance range, the output will not be measured.
LED indicator description, LED is not a power indicator, it will flash after the module is powered on, and the module is in working state at this time.
ØMode 3: R27=120K means welding 120K resistance. In this serial mode
After the module is powered on and recognized , the module enters the standby state, the serial port output format is TTL level, and the serial port baud rate: 9600, n, 8, 1. When the RX port receives the 0X55 command, the module starts a ranging , and outputs a frame from the pin TX, which contains 4 8-bit data. The frame format is: 0XFF+H_DATA+L_DATA+SUM
1.0XFF: the start of a frame Data, used for judgment;
2. H_DATA: the high 8 bits of the
distance data ; 3. L_DATA: the low 8 bits of the distance data;
4. SUM: the sum of the data, used for validation. Its 0XFF+H_DATA+L_DATA=SUM (only low 8 bits)
Note : H_DATA and L_DATA combine 16-bit data, that is, the distance value in millimeters
Note: The module outputs a short distance value in the blind zone. If the module cannot measure the data or exceeds the distance range, the output will not be measured.
LED indicator description, LED is not a power indicator, it will light up after the module receives a 0X55 trigger signal, and the module is in working state