Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use JSN-SR04T Ultrasonic Sensor: Examples, Pinouts, and Specs

Image of JSN-SR04T Ultrasonic Sensor
Cirkit Designer LogoDesign with JSN-SR04T Ultrasonic Sensor in Cirkit Designer

Introduction

The JSN-SR04T is an ultrasonic distance sensor that uses sound waves to measure the distance to an object. It features a waterproof design, making it suitable for outdoor applications. This sensor is capable of providing accurate distance measurements in a range of 20 cm to 6 meters. Its robust design and reliable performance make it ideal for applications such as obstacle detection, liquid level measurement, and outdoor robotics.

Explore Projects Built with JSN-SR04T Ultrasonic Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO Based Ultrasonic Distance Measurement with TM1637 Display
Image of UNDERWATER SENSOR: A project utilizing JSN-SR04T Ultrasonic Sensor in a practical application
This circuit is designed to measure distance using the JSN-SR04T ultrasonic sensor and display the measured value on a TM1637 4-digit 7-segment display. The Arduino UNO serves as the central controller, running code to operate the sensor, calculate the distance, and update the display. The sensor's TRIG and ECHO pins are connected to digital pins D12 and D11 of the Arduino, respectively, while the display's CLK and DIO pins are connected to digital pins D3 and D4, with both the sensor and display sharing power and ground connections with the Arduino.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B and JSN-SR04T Ultrasonic Sensor Distance Measurement System
Image of sub sistem embeded: A project utilizing JSN-SR04T Ultrasonic Sensor in a practical application
This circuit connects a JSN-SR04T Ultrasonic Sensor to a Raspberry Pi 4B, enabling the Raspberry Pi to measure distance by sending and receiving ultrasonic pulses. The sensor's power and ground pins are connected to the Raspberry Pi's 5V and GND pins, while the Trig and Echo pins are connected to GPIO10 and GPIO11, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Ultrasonic Distance Sensor with OLED Display and SIM900A Communication
Image of SENSOR: A project utilizing JSN-SR04T Ultrasonic Sensor in a practical application
This circuit is a distance measurement and communication system using an Arduino UNO, an ultrasonic sensor, an OLED display, and a SIM900A module. The ultrasonic sensor measures the distance to an object, which is then displayed on the OLED screen and transmitted via the SIM900A module. The system is powered by a 18650 Li-ion battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano and NRF24L01 Based Ultrasonic Distance Measurement System
Image of transmitter_circuit: A project utilizing JSN-SR04T Ultrasonic Sensor in a practical application
This circuit is designed to measure distances using an HC-SR04 Ultrasonic Sensor and transmit the measured data wirelessly via an NRF24L01 module. An Arduino Nano serves as the central controller, interfacing with the ultrasonic sensor to trigger distance measurements and with the NRF24L01 to send the results to a remote receiver. The code provided for the Arduino Nano manages the measurement process, calculates the distance, and handles the wireless communication.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with JSN-SR04T Ultrasonic Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of UNDERWATER SENSOR: A project utilizing JSN-SR04T Ultrasonic Sensor in a practical application
Arduino UNO Based Ultrasonic Distance Measurement with TM1637 Display
This circuit is designed to measure distance using the JSN-SR04T ultrasonic sensor and display the measured value on a TM1637 4-digit 7-segment display. The Arduino UNO serves as the central controller, running code to operate the sensor, calculate the distance, and update the display. The sensor's TRIG and ECHO pins are connected to digital pins D12 and D11 of the Arduino, respectively, while the display's CLK and DIO pins are connected to digital pins D3 and D4, with both the sensor and display sharing power and ground connections with the Arduino.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of sub sistem embeded: A project utilizing JSN-SR04T Ultrasonic Sensor in a practical application
Raspberry Pi 4B and JSN-SR04T Ultrasonic Sensor Distance Measurement System
This circuit connects a JSN-SR04T Ultrasonic Sensor to a Raspberry Pi 4B, enabling the Raspberry Pi to measure distance by sending and receiving ultrasonic pulses. The sensor's power and ground pins are connected to the Raspberry Pi's 5V and GND pins, while the Trig and Echo pins are connected to GPIO10 and GPIO11, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SENSOR: A project utilizing JSN-SR04T Ultrasonic Sensor in a practical application
Arduino UNO-Based Ultrasonic Distance Sensor with OLED Display and SIM900A Communication
This circuit is a distance measurement and communication system using an Arduino UNO, an ultrasonic sensor, an OLED display, and a SIM900A module. The ultrasonic sensor measures the distance to an object, which is then displayed on the OLED screen and transmitted via the SIM900A module. The system is powered by a 18650 Li-ion battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of transmitter_circuit: A project utilizing JSN-SR04T Ultrasonic Sensor in a practical application
Arduino Nano and NRF24L01 Based Ultrasonic Distance Measurement System
This circuit is designed to measure distances using an HC-SR04 Ultrasonic Sensor and transmit the measured data wirelessly via an NRF24L01 module. An Arduino Nano serves as the central controller, interfacing with the ultrasonic sensor to trigger distance measurements and with the NRF24L01 to send the results to a remote receiver. The code provided for the Arduino Nano manages the measurement process, calculates the distance, and handles the wireless communication.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Obstacle detection in robotics
  • Liquid level monitoring in tanks
  • Parking assistance systems
  • Outdoor distance measurement
  • Smart irrigation systems

Technical Specifications

The JSN-SR04T is designed to operate in a variety of environments, offering reliable performance even in challenging conditions. Below are its key technical details:

Parameter Value
Operating Voltage 5V DC
Operating Current ≤ 30 mA
Measuring Range 20 cm to 600 cm
Accuracy ±1 cm
Operating Frequency 40 kHz
Waterproof Yes
Output Signal High/Low TTL
Trigger Input Signal 10 µs TTL pulse
Echo Output Signal Pulse width proportional to distance
Operating Temperature -20°C to +70°C

Pin Configuration

The JSN-SR04T has a 4-pin interface for easy integration into circuits. Below is the pinout description:

Pin Name Description
1 VCC Power supply input (5V DC)
2 Trig Trigger pin: Sends a 10 µs pulse to initiate measurement
3 Echo Echo pin: Outputs a pulse width proportional to distance
4 GND Ground connection

Usage Instructions

How to Use the JSN-SR04T in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
  2. Trigger the Sensor: Send a 10 µs HIGH pulse to the Trig pin to initiate a measurement.
  3. Read the Echo: Measure the duration of the HIGH pulse on the Echo pin. The duration is proportional to the distance of the object.
  4. Calculate Distance: Use the formula below to calculate the distance: [ \text{Distance (cm)} = \frac{\text{Pulse Duration (µs)}}{58} ]

Important Considerations

  • Ensure the sensor is powered with a stable 5V DC supply.
  • Avoid placing the sensor near ultrasonic noise sources to prevent interference.
  • The sensor is waterproof, but the control board is not. Protect the control board from moisture.
  • The minimum measurable distance is 20 cm. Objects closer than this may not be detected accurately.

Example Code for Arduino UNO

Below is an example of how to use the JSN-SR04T with an Arduino UNO:

// Define pins for the JSN-SR04T sensor
const int trigPin = 9; // Trigger pin connected to digital pin 9
const int echoPin = 10; // Echo pin connected to digital pin 10

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Set pin modes
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
}

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 pulse on the Echo pin
  long duration = pulseIn(echoPin, HIGH);

  // Calculate the distance in cm
  float distance = duration / 58.0;

  // Print the distance to the Serial Monitor
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");

  // Wait before the next measurement
  delay(500);
}

Best Practices

  • Use a decoupling capacitor (e.g., 10 µF) across the VCC and GND pins to stabilize the power supply.
  • If using long wires, consider shielding them to reduce noise.
  • Mount the sensor securely to avoid vibrations that could affect measurements.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output from the Echo Pin:

    • Ensure the Trig pin is receiving a 10 µs HIGH pulse.
    • Verify that the sensor is powered with 5V DC.
    • Check the wiring connections for loose or incorrect connections.
  2. Inaccurate Distance Measurements:

    • Ensure there are no obstacles within 20 cm of the sensor.
    • Avoid using the sensor in environments with high ultrasonic noise.
    • Verify that the formula for distance calculation is implemented correctly.
  3. Sensor Not Responding:

    • Check if the control board is exposed to moisture. Protect it from water.
    • Test the sensor with a different microcontroller or power source.

FAQs

Q: Can the JSN-SR04T detect objects closer than 20 cm?
A: No, the minimum measurable distance is 20 cm. Objects closer than this may not be detected accurately.

Q: Is the sensor fully waterproof?
A: The ultrasonic transducer is waterproof, but the control board is not. Ensure the control board is protected from water.

Q: Can I use the JSN-SR04T with a 3.3V microcontroller?
A: The sensor requires a 5V power supply. If using a 3.3V microcontroller, you may need a level shifter for the Trig and Echo pins.

Q: How do I reduce noise in the measurements?
A: Use a decoupling capacitor across the power pins and shield long wires to minimize noise.

By following this documentation, you can effectively integrate the JSN-SR04T ultrasonic sensor into your projects and troubleshoot common issues.