AJ-SR04M is a waterproof ultrasonic ranging module designed with an integrated transceiver. It offers reliable distance measurement for various applications. It's compatible with HC-SR04 software.
Features
- 3-5V Power Supply
- Waterproof, suitable for harsh environments
- Ultra-low standby current
- 5 output modes
- 20cm minimum blind zone
- 20cm-450cm wide measurement range (flat surface)
- High resolution
- Operating temperature: -20°C - 80°C
Applications
- Smart car obstacle avoidance
- Object distance measurement, human height measurement
- Quadcopter altitude hold and obstacle avoidance
- Intelligent traffic control, parking space display
Performance Parameters
Parameter Name | Remark | Minimum Value | Typical Value | Maximum Value | Unit |
---|---|---|---|---|---|
Operating Voltage | 3 | 5 | 5.5 | V | |
Operating Current | During Detection | 20 | 30 | mA | |
Standby Current | 7 | 10 | uA | ||
Max. Detection Range | Flat surface, normal probe | 300 | 450 | 600 | cm |
Max. Detection Range* | Super low residue probe | 600 | 700 | 800 | cm |
Operating Frequency | 40 | KHz | |||
Blind Zone | 20 | cm | |||
Detection Accuracy | ±2 | % | |||
Resolution | 1 | mm | |||
Detection Angle | Max directional angle | ±30 | degree | ||
Measurement Cycle Time | 50 | mS | |||
Output Port Mode | GPIO/Serial | ||||
Operating Temperature | -20 | 80 | °C |
Interface Definition
No. | Interface Definition | Description |
---|---|---|
1 | 5V | 3-5V power supply |
2 | Trig/Rx | GPIO mode for Trig, trigger signal. Serial mode receive: Rx. |
3 | Echo/Tx | GPIO mode for Echo, feedback signal. Serial mode transmit: Tx. |
4 | Gnd | Ground |
Mode Selection
- Mode 1: Normal pulse waveform, minimum consumption 5mA
- Mode 2: Low power pulse waveform, minimum consumption 10uA
- Mode 3: Automatic serial port, minimum consumption 6.5mA
- Mode 4: Serial port trigger, minimum consumption 7uA
- Mode 5: ASCII code output, minimum consumption 7uA
Mode | R19 Resistance Value | Description |
---|---|---|
1 | NC | Open circuit, default |
2 | 300K | |
3 | 120K | |
4 | 47K | |
5 | 0K | Short circuit |
Extended Range 6-7M Adjustment:
- Replace with low residual vibration probe
- Modify the following image to increase the gain resistance 124 -> 224
Measurement Operation:
(See images for Mode 1, Mode 2, Mode 3, Mode 4 and Mode 5 timing diagrams and explanations)
Mode 1 Timing
-
Working Principle:
Compatible with HC-SR04. Give the Trig pin a >10us high-level trigger signal, and the module will work once. The corresponding Echo pin will output a high level, and the duration of the high level is the distance from the module to the obstacle. Distance = high level time * sound speed / 2;
Mode 2 Timing
-
Working Principle:
Give the Trig pin a >100us high-level trigger signal, and the module will work once. The corresponding Echo pin will output a high level, and the duration of the high level is the distance from the module to the obstacle. Distance = high level time * sound speed / 2;
Mode 3 Timing
-
Working Principle:
The module automatically outputs a frame every 100ms, containing 4 8-bit data. The frame format is: 0XFF+H_DATA+L_DATA+SUM (Baud rate is set to 9600, none, 8bit, 1stop)
- 0XFF: Start of frame, used for judgment.
- H_DATA: High 8 bits of distance data
- L_DATA: Low 8 bits of distance data
- SUM: Data sum, used for verification. H_DATA+L_DATA=SUM (only low 8 bits).
- H_DATA and L_DATA constitute 16-bit data, which is the distance value in millimeters.
Example Product Response: FF 07 A1 A7
Checksum SUM=A8=(0x07+0xA1)&0x00ff
0x07 is the high bit of the distance: 0xA1 is the low bit of the distance
Distance value 0x07A1: Convert to decimal to get 1953: Unit is millimeters
Mode 4 Timing
-
Working Principle:
Send one of 11 data to the RX pin or set the RX pin low once, and the module will measure after triggering. It will output a frame of data, containing 4 8-bit data. The frame format is: 0XFF+H_DATA+L_DATA+SUM. Baud rate setting 9600, none, 8bit, 1stop
- 0XFF: Start of a frame of data, used to determine.
- H_DATA: The high 8 bits of the distance data.
- L_DATA: The low 8 bits of the distance data.
- SUM: Data and, for verification, H_DATA+L_DATA=SUM (only low 8 bits).
- H_DATA and L_DATA constitute 16-bit data, which is the distance value in millimeters.
Example Product Response: FF 07 A1 A7
Checksum SUM=A8=(0x07+0xA1)&0x00ff
0x07 is the high bit of the distance data
0xA1 is the low bit of distance data
The distance value is 0x07A1: convert to decimal to 1953: unit is millimeters
Mode 5 Timing
-
Working Principle:
Mode 5 is the same as Mode 4, except that the output format of Mode 5 is ASCII code. The distance value can be directly displayed in the serial port software.
Module Workflow Diagram
(See image "68bfde39c9115f823c5d9c85" for module workflow)
- Module Power On
- Module Self-Check
- Check R27 Resistance Value to Determine Startup Mode
- R27=open: Pulse Width Output Mode
- R27=47K: Automatic Serial Port Mode
- R27=120K: Trigger Serial Port Mode