The Waterproof Integrated Ultrasonic Sensor is a robust and reliable device designed to measure distances or detect objects using ultrasonic waves. Its waterproof design makes it ideal for use in harsh environments, such as outdoor installations, industrial applications, and underwater systems. This sensor emits ultrasonic waves and calculates the time it takes for the waves to return after hitting an object, providing accurate distance measurements.
The following table outlines the key technical details of the Waterproof Integrated Ultrasonic Sensor:
Parameter | Specification |
---|---|
Operating Voltage | 3.3V to 5V |
Operating Current | ≤ 15mA |
Detection Range | 20mm to 4500mm (2cm to 4.5m) |
Accuracy | ±1% |
Waterproof Rating | IP67 |
Operating Frequency | 40kHz |
Operating Temperature | -20°C to 70°C |
Output Signal | Digital (High/Low) or PWM |
The sensor typically has four pins, as described in the table below:
Pin Name | Description |
---|---|
VCC | Power supply pin (3.3V to 5V) |
GND | Ground pin |
TRIG | Trigger pin: Sends an ultrasonic pulse when set HIGH for 10 microseconds |
ECHO | Echo pin: Outputs a pulse width proportional to the distance of the object |
The following code demonstrates how to use the Waterproof Integrated Ultrasonic Sensor with an Arduino UNO:
// Define pin connections
const int trigPin = 9; // TRIG pin connected to digital pin 9
const int echoPin = 10; // ECHO pin connected to digital pin 10
void setup() {
pinMode(trigPin, OUTPUT); // Set TRIG pin as output
pinMode(echoPin, INPUT); // Set ECHO pin as input
Serial.begin(9600); // Initialize serial communication
}
void loop() {
// Send a 10µs pulse to the TRIG pin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Measure the duration of the pulse on the ECHO pin
long duration = pulseIn(echoPin, HIGH);
// Calculate the distance in cm
float distance = (duration * 0.034) / 2;
// Print the distance to the Serial Monitor
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(500); // Wait for 500ms before the next reading
}
No Output or Incorrect Readings:
Unstable or Fluctuating Readings:
Sensor Not Detecting Objects:
Q: Can this sensor be used underwater?
A: Yes, the sensor is waterproof (IP67 rated) and can be used in underwater applications.
Q: What is the maximum detection range?
A: The sensor can detect objects up to 4.5 meters away.
Q: Can I use this sensor with a 3.3V microcontroller?
A: Yes, the sensor operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V microcontrollers.
Q: How do I improve accuracy in outdoor environments?
A: Minimize environmental noise, avoid direct sunlight on the sensor, and ensure the sensor is clean and unobstructed.