Principle of Work
- The K02 waterproof ultrasonic distance measuring module works on the principle of ultrasonic ranging. It emits a high-frequency sound wave (40kHz) and then listens for the echo that bounces back off an object in front of it. The time it takes for the sound wave to travel to the object and back is measured, and this time is used to calculate the distance between the sensor and the object.
- The module has two main components, a trigger pin (IOTRIG) and an echo pin (IOECHO). When a high-level signal (at least 10μs) is sent to the trigger pin, the module automatically sends out a 40kHz square wave and waits for a signal to return.
- If a signal is detected, the echo pin outputs a high signal for a duration corresponding to the time it takes for the sound wave to travel to the object and back. This duration can be measured using a timer, then converted to distance using the formula:
distance = (time × speed of sound (340 m/s)) / 2
.
- By continuously triggering the module and measuring the echo time, the K02 module provides real-time distance measurements, suitable for applications like water level measurement, object detection, and obstacle avoidance.

Features
- Small size, easy to use
- Low voltage, low power consumption
- High measurement accuracy
- Strong anti-interference capability
- Integrated closed waterproof probe for wet and harsh environments
Specification
- Operating Voltage: 5V
- Maximum Current: 30mA @ 5V
- Standby Current: < 5mA @ 5V
- Low Power Consumption: < 20μA
- Detection Range: 20 cm to 600 cm
- Accuracy: ± 1 cm
- Resolution: 1 mm
- Measuring Angle: 75°
- Size: 42 × 29 × 12 mm (L × W × H)
- Operating Temperature: -20 to +70 °C

Applications
- Water level measurement in tanks, reservoirs, and wells
- Object detection for robotics, automated manufacturing, and security
- Parking sensors for vehicle safety
- Obstacle avoidance in robotics
- Distance measuring for surveying, construction, and engineering
- Smart agriculture for plant distance and harvest timing
Pin Connections
Pin |
Description |
VCC |
Power supply pin, typically connected to +5V |
GND |
Ground pin, typically connected to GND |
IOTRIG |
Trigger pin for sending ultrasonic signal, connected to a digital I/O pin |
IOECHO |
Echo pin for receiving reflected signal, connected to a digital I/O pin |

Sample Project
Circuit (JSN-SR04T & Arduino)
JSN-SR04T Pin |
Arduino Pin |
5V |
5V |
Trig |
Pin 2 |
Echo |
Pin 3 |
GND |
GND |
Code
// Define Trig and Echo pin:
#define trigPin 2
#define echoPin 3
// Define variables:
long duration;
int distance;
void setup() {
// Define inputs and outputs
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
// Begin Serial communication at 9600 baud rate
Serial.begin(9600);
}
void loop() {
// Clear the trigPin by setting it LOW:
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
// Trigger the sensor by setting the trigPin high for 10 microseconds:
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read the echoPin. pulseIn() returns the duration (length of the pulse) in microseconds:
duration = pulseIn(echoPin, HIGH);
// Calculate the distance:
distance = duration * 0.034 / 2;
// Print the distance on the Serial Monitor (Ctrl+Shift+M):
Serial.print("Distance = ");
Serial.print(distance);
Serial.println(" cm");
}
Notes
- This sensor only uses a single transducer.
Principle of Work
- The K02 waterproof ultrasonic distance measuring module works on the principle of ultrasonic ranging. It emits a high-frequency sound wave (40kHz) and then listens for the echo that bounces back off an object in front of it. The time it takes for the sound wave to travel to the object and back is measured, and this time is used to calculate the distance between the sensor and the object.
- The module has two main components, a trigger pin (IOTRIG) and an echo pin (IOECHO). When a high-level signal (at least 10μs) is sent to the trigger pin, the module automatically sends out a 40kHz square wave and waits for a signal to return.
- If a signal is detected, the echo pin outputs a high signal for a duration corresponding to the time it takes for the sound wave to travel to the object and back. This duration can be measured using a timer, then converted to distance using the formula:
distance = (time × speed of sound (340 m/s)) / 2
.
- By continuously triggering the module and measuring the echo time, the K02 module provides real-time distance measurements, suitable for applications like water level measurement, object detection, and obstacle avoidance.

Features
- Small size, easy to use
- Low voltage, low power consumption
- High measurement accuracy
- Strong anti-interference capability
- Integrated closed waterproof probe for wet and harsh environments
Specification
- Operating Voltage: 5V
- Maximum Current: 30mA @ 5V
- Standby Current: < 5mA @ 5V
- Low Power Consumption: < 20μA
- Detection Range: 20 cm to 600 cm
- Accuracy: ± 1 cm
- Resolution: 1 mm
- Measuring Angle: 75°
- Size: 42 × 29 × 12 mm (L × W × H)
- Operating Temperature: -20 to +70 °C

Applications
- Water level measurement in tanks, reservoirs, and wells
- Object detection for robotics, automated manufacturing, and security
- Parking sensors for vehicle safety
- Obstacle avoidance in robotics
- Distance measuring for surveying, construction, and engineering
- Smart agriculture for plant distance and harvest timing
Pin Connections
Pin |
Description |
VCC |
Power supply pin, typically connected to +5V |
GND |
Ground pin, typically connected to GND |
IOTRIG |
Trigger pin for sending ultrasonic signal, connected to a digital I/O pin |
IOECHO |
Echo pin for receiving reflected signal, connected to a digital I/O pin |

Sample Project
Circuit (JSN-SR04T & Arduino)
JSN-SR04T Pin |
Arduino Pin |
5V |
5V |
Trig |
Pin 2 |
Echo |
Pin 3 |
GND |
GND |
Code
// Define Trig and Echo pin:
#define trigPin 2
#define echoPin 3
// Define variables:
long duration;
int distance;
void setup() {
// Define inputs and outputs
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
// Begin Serial communication at 9600 baud rate
Serial.begin(9600);
}
void loop() {
// Clear the trigPin by setting it LOW:
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
// Trigger the sensor by setting the trigPin high for 10 microseconds:
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read the echoPin. pulseIn() returns the duration (length of the pulse) in microseconds:
duration = pulseIn(echoPin, HIGH);
// Calculate the distance:
distance = duration * 0.034 / 2;
// Print the distance on the Serial Monitor (Ctrl+Shift+M):
Serial.print("Distance = ");
Serial.print(distance);
Serial.println(" cm");
}
Notes
- This sensor only uses a single transducer.