RCWL-1655 (JSN-SR04T) เซนเซอร์วัดระยะทาง Ultrasonic Waterproof Ranging Sensor
RCWL-1655 โมดูล Ultrasonic ที่ป้องกันความชื้นและละอองน้ำได้ โดยสามารถตรวจจับวัตถุและหาระยะห่างระหว่างตัว Sensor และวัตถุได้ในระยะ 25 cm ถึง 4.5 m รองรับโค้ตเดียวกับ JSN-SR04T
Waterproof ultrasonic sensor RCWL-1655 operating in the range from 20 cm to 600 cm. Powered by 3 to 5V. The output is a signal whose duration is proportional to the measured distance. The sensor is compatible with the popular HC-SR04 sensor, which means that the sample programs and libraries will work correctly for both sensors.
The module dimensions and software are fully compatible with the older version of the JSN-SR04T; they can be switched seamlessly.
RCWL-1655 (JSN-SR04T) Product Features:
- Wide voltage operation: 3V-5.5V
- Fully compatible with JSN-SR04T software and hardware dimensions
- Detection distance:
- @5V: 20cm - 600cm
- @3.3V: 20cm - 400cm
- communication protocols supported: GPIO, UART, I2C and 1-Wire
In short, to get the result in cm you can use the formula:
distance [cm] = (high level time [us] * 34 ) / 1000 / 2
ข้อมูลจำเพาะ RCWL-1655 (JSN-SR04T) Technical data:
- Pulse width output: serial port output
- Working voltage: DC: 3.0-5.5v
- Working current: less than 8mA
- Probe frequency: 40KHz
- Max range: 600cm
- Min range: 20cm
- Long range accuracy: ± 1cm
- Resolution: 1 mm
- Measuring angle: 75 degrees
- Input trigger signal: 1, more than 10us TTL pulse, 2, serial port send command 0x55
- Output echo signal: output pulse width level signal, or TTL
- Wiring mode: 3-5.5v (positive pole of power supply). Trig Rx. Echo TX. GND (negative pole of power supply)
- Product size: l42 * W29 * H12 mm
- Working temperature: - 20 ℃ - + 70 ℃
Operating Mode:
- After connecting the ultrasonic ranging module with 3-5.5V power supply, the module has five working
- modes:
- Mode 1: Common Pulse Width Square Wave (Minimum Power Consumption 2.5mA)
- Mode 2: Low Power Pulse Width Square Wave (Minimum Power Consumption 40uA)
- Mode 3: Automatic Serial Port (Minimum Power Consumption 2.5mA)
- Mode 4: Serial Port Trigger (Minimum Power Consumption 20uA)
- Mode 5: ASCII Code output (Minimum Power Consumption 20uA)
JSN-SR04T Manualhttps://drive.google.com/file/d/1tvyZo2N4DVxy9ckCrHL4-umhSjtOwdZv/view?usp=sharing
JSN-SR04T Ultrasonic Module -> Arduino
- Vcc -> 5v
- Gnd -> Gnd
- Trig -> 13
- Echo -> 12
ตัวอย่าง Code
const int pingPin = 13;
int inPin = 12;
void setup() {
Serial.begin(9600);
}
void loop()
{
long duration, cm;
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);
pinMode(inPin, INPUT);
duration = pulseIn(inPin, HIGH);
cm = microsecondsToCentimeters(duration);
Serial.print(cm);
Serial.print("cm");
Serial.println();
delay(100);
}
long microsecondsToCentimeters(long microseconds)
{
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;
}