Waterproof Ultrasonic Module JSN-SR04T AJ-SR04M Distance Measuring Sensor for Arduino
In stock
Order before 12.00PM
Features:
- 23 to 600 cm (9″ to 20 feet) detection range
- 40 kHz operation
- ±37.5 degree field of view
- 2.5 meter (8′) transducer cable
- 3.3 & 5V operation and logic compatible (see notes below about 3.3V operation)
The JSN-SR04T is very similar to the standard ultrasonic modules like the HC-SR04 with the exception that it uses a single waterproof transducer instead of two and it also provides more methods for interfacing to a microcontroller.
Because the transducer is waterproof, it can be used for indoor or outdoor sensing such as providing a car parking sensor, security alarm, obstacle avoidance or monitoring the water level is water storage tanks.
Operating Modes:
The module can operate in 6 different modes of operation using either the Ping or Serial mode of operation. These are set by shorting the M1 or M2 pads or placing a resistor of a certain value across the MODE pads. The resistor value sets an analog voltage that is read by an ADC, so the exact value isn’t overly critical.
Mode 0 and Mode 2 are the most commonly used modes.
MODE 0: Ping Mode
Mode 0 is the default mode when there is no resistor on the MODE pads and neither M1 or M2 pads are shorted and is how the module is shipped.
In this mode, the module operates very similarly to the HC-SR04 and similar ultrasonic range finder modules and sample code for those modules can be used with this module with one exception. With the HC-SR04, the trigger pin is held high for 10uS. With the JSN-SR04T, the trigger pin must be held high longer – usually about 20uS for reliable operation. The first test program below uses this mode.
MODE 1 - Automatic Serial Mode: To enter Mode 1, the M1 pads are shorted OR a resistor value of 47K is placed across the MODE pads.
In this mode the module continuously takes measurements approximately every 100mS and outputs the distance on the TX pin at 9600 baud where it can be read using a serial RX pin on an MCU.
MODE 2 - MCU Controlled Serial Mode: To enter Mode 2, the M2 pads are shorted OR a resistor value of 120K is placed across the MODE pads.
This mode is the same as Mode 1 except that the module takes a measurement only when a trigger command of 0x55 is sent to the RX pin on the module. The module then takes a single measurement and outputs the distance on its TX pin.
The minimum trigger cycle time is 60mS
MODE 3 - Automatic Ping mode: To enter Mode 3, a resistor value of 200K is placed across the MODE pads.
Mode 3 is similar to Mode 0 (ping mode) except that it automatically generates the ping every 200mS and outputs a pulse width high level corresponding to the distance.
MODE 4 - Low power Ping mode : To enter Mode 4, a resistor value of 360K is placed across the MODE pads.
This mode is the same as Mode 0 except that the module is set to low power in between Pings with a stated current consumption of < 70uA.
MODE 5 - Threshold Switch Output: To enter Mode 5, a resistor value of 470K is placed across the MODE pads.
In this mode, the module automatically takes a reading every 200mS and checks the measurement against a factory default threshold setting of 1.5 meters. If the detected distance is less than 1.5 meters, the Echo pin is set to HIGH. If the detected distance is greater than 1.5m, the Echo pin is set to LOW. This can be handy for using the output to directly control something like a relay or LED.
Module Wring:
There is a 4-pin header on the assembly.
- 5V: Connect to 5V
- RX / TRIG: Connect to any digital output pin on MCU. A 20uSec or wider pulse starts a measurement cycle in Ping mode of operation. Alternatively it serves as the serial RX (receive) pin.
- TX / ECHO: Connect to any digital input pin on MCU. This pin is held high for the duration of the the measurement cycle. Alternatively it serves as the serial TX (transmit) pin.
- GND
Package Includes:
- JSN-SR04T V3.0 Electronic Control Module
- Waterproof Transducer with 2.5 Meter Cable
How to interface with an Arduino?
To interface the Waterproof Ultrasonic Module JSN-SR04T (or AJ-SR04M) with an Arduino UNO, you'll need to connect the sensor to the Arduino and write a sketch (code) to read the distance measurements. Here's a step-by-step guide:
Wiring the Sensor
-
Connect the VCC Pin:
- JSN-SR04T: Connect the VCC pin to the 5V pin on the Arduino.
- AJ-SR04M: Connect the VCC pin to the 5V pin on the Arduino.
-
Connect the GND Pin:
- Connect the GND pin to the GND pin on the Arduino.
-
Connect the Trigger Pin:
- JSN-SR04T: Connect the Trigger pin to a digital pin on the Arduino (e.g., pin 9).
- AJ-SR04M: Connect the Trigger pin to a digital pin on the Arduino (e.g., pin 9).
-
Connect the Echo Pin:
- JSN-SR04T: Connect the Echo pin to a digital pin on the Arduino (e.g., pin 10).
- AJ-SR04M: Connect the Echo pin to a digital pin on the Arduino (e.g., pin 10).
Example Arduino Sketch
Here's a basic example of an Arduino sketch to measure distance using the JSN-SR04T or AJ-SR04M sensor:
// Define pins const int triggerPin = 9; const int echoPin = 10; // Define variables long duration; int distance; void setup() { // Start the serial communication Serial.begin(9600); // Set the trigger pin as an output pinMode(triggerPin, OUTPUT); // Set the echo pin as an input pinMode(echoPin, INPUT); } void loop() { // Send a 10 microsecond pulse to trigger the sensor digitalWrite(triggerPin, LOW); delayMicroseconds(2); digitalWrite(triggerPin, HIGH); delayMicroseconds(10); digitalWrite(triggerPin, LOW); // Read the duration of the pulse from the echo pin duration = pulseIn(echoPin, HIGH); // Calculate the distance in cm distance = duration * 0.0344 / 2; // Print the distance to the Serial Monitor Serial.print("Distance: "); Serial.print(distance); Serial.println(" cm"); // Wait for a short time before measuring again delay(500); }
Key Points:
- Trigger Pin: Sends a pulse to start the measurement.
- Echo Pin: Receives the pulse that bounces back from the object.
Make sure to adjust the pin numbers if you use different pins on your Arduino. Also, ensure that your sensor is compatible with the voltage levels of the Arduino to avoid any damage.
Request Stock
Recently viewed products
You might also be interested in...
Customers who bought this also bought...
General Questions
-
What is the latest price of the Waterproof Ultrasonic Module JSN-SR04T AJ-SR04M Distance Measuring Sensor for Arduino in Bangladesh?
The latest price of Waterproof Ultrasonic Module JSN-SR04T AJ-SR04M Distance Measuring Sensor for Arduino in Bangladesh is BDT 597.00 . You can buy the Waterproof Ultrasonic Module JSN-SR04T AJ-SR04M Distance Measuring Sensor for Arduino at the best price on BDTronics.com or contact us via phone.
-
Where to buy Waterproof Ultrasonic Module JSN-SR04T AJ-SR04M Distance Measuring Sensor for Arduino in Bangladesh?
You can buy Waterproof Ultrasonic Module JSN-SR04T AJ-SR04M Distance Measuring Sensor for Arduino online by ordering on BDTronics.com or directly collect by visiting our store in person. BDTronics is a trusted provider of high-quality electronics, 3D printers, solar systems, and robotics parts. We offer fast shipping across the country via courier service.
-
What are the delivery options of Waterproof Ultrasonic Module JSN-SR04T AJ-SR04M Distance Measuring Sensor for Arduino in Bangladesh?
We provide home delivery service all over Bangladesh. We support cash on delivery, bKash and Credit Card (Visa/ MasterCard/ Amex) payment solutions. The delivery time usually takes 1-2 days inside Dhaka and 2-3 days outside Dhaka.