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.
- Raspberry Pi 4
- Micro SD Card
- Power Supply
- JSN-SR04T Ultrasonic Transducer Waterproof Distance Measuring Sensor Module
First, you need to know what this the JSN-SR04T sensor is and how it works then we need to know about this.
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:
903 total views, 13 views today