Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

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

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

Introduction

The JSN-SR04T Ultrasonic Sensor is a versatile and waterproof distance measuring module that utilizes ultrasonic waves to determine the distance to an object. It is widely used in various applications such as robotics, automation, vehicle parking sensors, obstacle avoidance systems, and IoT projects. The sensor is designed to be robust and reliable, making it suitable for outdoor environments and harsh conditions.

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 Arduino UNO Based Ultrasonic Distance Measurement with TM1637 Display: 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.

Open Project in Cirkit Designer
Image of Arduino Nano and NRF24L01 Based Ultrasonic Distance Measurement System: 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.

Open Project in Cirkit Designer

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 VCC Power supply (5V DC)
2 Trig Trigger input (TTL pulse)
3 Echo Echo output (TTL level signal)
4 GND Ground

Usage Instructions

Connecting to a Circuit

  1. Connect the VCC pin to the 5V output on the Arduino UNO.
  2. Connect the GND pin to one of the GND pins on the Arduino UNO.
  3. Connect the Trig pin to a digital I/O pin on the Arduino UNO.
  4. Connect the Echo pin to another digital I/O pin on the Arduino UNO.

Important Considerations and Best Practices

Sample Arduino Code

#include <NewPing.h>

#define TRIGGER_PIN  12  // Arduino pin tied to trigger pin on the sensor.
#define ECHO_PIN     11  // Arduino pin tied to echo pin on the sensor.
#define MAX_DISTANCE 450 // Maximum distance we want to ping for (in centimeters).

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

void setup() {
  Serial.begin(9600); // Open serial monitor at 9600 baud to see ping results.
}

void loop() {
  delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).
  Serial.print("Ping: ");
  Serial.print(uS / US_ROUNDTRIP_CM); // Convert time into distance and print result (in cm).
  Serial.println("cm");
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: Can the JSN-SR04T sensor be used underwater? A: No, the JSN-SR04T is waterproof but not designed for underwater use.

Q: What is the maximum reliable range of the sensor? A: The maximum reliable range is up to 4.5 meters, but optimal performance is achieved within 25cm to 4m.

Q: How can I extend the sensor's wires? A: You can extend the wires using shielded cables to minimize interference. Keep the extension as short as possible to maintain signal integrity.