Raspberry Pi4 Distance Sensor using the JSN-SR04T

In this Raspberry Pi4 distance sensor tutorial, we will be Using the JSN-SR04T Ultrasonic Transducer Waterproof Distance Measuring Sensor Module with our Raspberry Pi4.

I have attached a few steps here. I believe that if anyone follows these steps, he can create a complete this project

Equipment List

  1. Raspberry Pi 4
  2. Micro SD Card
  3. Power Supply
  4. JSN-SR04T Ultrasonic Transducer Waterproof Distance Measuring Sensor Module
  5. Breadboard

First, you need to know what this the JSN-SR04T sensor is and how it works then we need to know about this.

What is JSN-SR04T Ultrasonic Transducer Waterproof Distance Measuring Sensor :
If we want to know about any sensor, we must first read the datasheet of that sensor Datasheet Hear 
20-600 cm Ultrasonic Waterproof Range Finder
JSN-SR0T4-2.0 ultrasonic distance measurement module can provide a 20cm-600cm non-contact distance
sensing function, ranging accuracy up to 2mm; module includes the transceiver of an integrated ultrasonic
sensor and control circuit. Mode one usage and the Division’s JSN-SR04T-2.0 module.
This product adopts industrial-grade integrated ultrasonic probe design, waterproof type, stable
performance, all the MCU on the market. 1, the module performance is stable, the measurement distance
is accurate. And foreign SRF05, SRF02, and other ultrasonic rangefinder modules comparable. Module high
precision, blind (20cm), the stable range is the product successfully to the market a strong basis.


Sensor connection with raspberry pi4

JSN-SR04T sensor has four pinouts. The first pair is VCC and GND for the obvious purpose of connecting it to 5V power and grounding it. And the second pair is TRIGGER and ECHO that are connected to GPIO23 and GPIO24.

Now let’s create a file called distance.py and write the actual code:

My Previous Project

 88 total views,  1 views today