

The JSN-SR20-Y1 is an ultrasonic distance sensor manufactured by JSN. It operates by emitting ultrasonic sound waves and measuring the time it takes for the sound waves to bounce back after hitting an object. This sensor is capable of measuring distances ranging from 20 cm to 600 cm with high accuracy, making it ideal for applications such as:
Its robust design and waterproof casing make it suitable for both indoor and outdoor environments.








| Parameter | Value |
|---|---|
| Operating Voltage | 5V DC |
| Operating Current | ≤ 8 mA |
| Measuring Range | 20 cm to 600 cm |
| Accuracy | ±1 cm |
| Operating Frequency | 40 kHz |
| Output Signal | Digital (High/Low) or PWM |
| Waterproof | Yes |
| Operating Temperature | -20°C to +70°C |
| Dimensions | 41 mm x 28.5 mm x 15 mm |
The JSN-SR20-Y1 has a 4-pin interface for easy integration into circuits. The pinout is as follows:
| Pin Name | Pin Number | Description |
|---|---|---|
| VCC | 1 | Power supply input (5V DC) |
| TRIG | 2 | Trigger pin: Sends an ultrasonic pulse |
| ECHO | 3 | Echo pin: Receives the reflected ultrasonic pulse |
| GND | 4 | Ground connection |
Below is an example of how to use the JSN-SR20-Y1 with an Arduino UNO:
// Define pins for the JSN-SR20-Y1 sensor
const int trigPin = 9; // TRIG pin connected to digital pin 9
const int echoPin = 10; // ECHO pin connected to digital pin 10
void setup() {
pinMode(trigPin, OUTPUT); // Set TRIG pin as output
pinMode(echoPin, INPUT); // Set ECHO pin as input
Serial.begin(9600); // Initialize serial communication
}
void loop() {
// Send a 10 µs HIGH pulse to the TRIG pin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Measure the duration of the HIGH signal on the ECHO pin
long duration = pulseIn(echoPin, HIGH);
// Calculate the distance in cm
float distance = (duration * 0.034) / 2;
// Print the distance to the Serial Monitor
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(500); // Wait for 500 ms before the next measurement
}
No Output or Incorrect Readings
Fluctuating Distance Measurements
Sensor Not Detecting Objects
Sensor Fails in Outdoor Conditions
Q1: Can the JSN-SR20-Y1 measure distances below 20 cm?
A1: No, the sensor's minimum range is 20 cm. Objects closer than this may result in inaccurate readings.
Q2: Is the sensor compatible with 3.3V microcontrollers?
A2: The JSN-SR20-Y1 requires a 5V power supply. However, logic level shifters can be used to interface it with 3.3V microcontrollers.
Q3: Can the sensor detect transparent objects?
A3: Ultrasonic sensors may struggle with transparent or very thin objects as they do not reflect sound waves effectively.
Q4: How can I improve measurement accuracy?
A4: Use the sensor in a stable environment, avoid obstacles in the ultrasonic path, and ensure proper alignment.
This concludes the documentation for the JSN-SR20-Y1 ultrasonic distance sensor.