Product Description:
Product Specifications
Specification | Value |
---|---|
Measuring Range | 2cm - 400cm |
Accuracy | ±3mm |
Power Supply | 5V DC |
Operating Current | 15mA |
Output Signal | TTL level (0V/5V) |
Measurement Angle | <15 degrees |
Dimensions | 45mm x 20mm x 15mm (approx.) |
Weight | 2g (approx.) |
Features
- Non-contact measurement for safe and reliable operation
- High accuracy and precision |
- Wide measuring range
- Low power consumption
- Simple to use and integrate
- Compact and lightweight design
Applications
- Robotics and obstacle avoidance
- Automated guided vehicles (AGVs)
- Level measurement
- Parking assistance systems
- Presence detection
- DIY projects and experiments
Pinout and Usage
Pin | Function | Connection |
---|---|---|
VCC | Power Supply | Connect to +5V power source |
GND | Ground | Connect to ground |
Trig | Trigger | Connect to a digital output pin of your microcontroller (e.g., Arduino Digital Pin 13). A short pulse (10us) on this pin initiates the measurement. |
Echo | Echo | Connect to a digital input pin of your microcontroller (e.g., Arduino Digital Pin 12). This pin receives the echo pulse from the target object. |
How to Use the HC-SR04 Ultrasonic Distance Sensor Module
- Wiring: Connect the module to your microcontroller as per the pinout table.
- Triggering: Send a short pulse (10us) to the Trig pin to initiate the measurement.
- Echo Reception: Read the duration of the echo pulse on the Echo pin.
- Distance Calculation: Calculate the distance to the object using the formula: Distance = (Duration / 2) * Speed of Sound (Speed of Sound in air is approximately 343 m/s at 20°C).
Example (Arduino)
C++
const int trigPin = 13; // Trig pin connected to Arduino Digital Pin 13
const int echoPin = 12; // Echo pin connected to Arduino Digital Pin 12
// Speed of sound in cm/uS
const float speedOfSound = 0.0343;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
}
void loop() {
// Trigger the sensor
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read the duration of the echo pulse
long duration = pulseIn(echoPin, HIGH);
// Calculate the distance
float distance = duration * speedOfSound / 2;
// Print the distance to the serial monitor
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(100); // Wait for 100ms before the next measurement
}
Note:
- The specific library functions and usage will vary depending on the microcontroller and the library you are using.
- Refer to the library documentation and examples for detailed usage instructions.
Design features
Our design features offer a range of tools to create visually stunning websites. Utilize WYSIWYG editors, drag-and-drop building blocks, and Bootstrap-based templates for effortless customization. With professional themes and an intuitive system, you can design with ease and precision, ensuring a polished, responsive result.
Building blocks system
Create pages from scratch by dragging and dropping customizable building blocks. This system simplifies web design, making it accessible to all skill levels. Combine headers, images, and text sections to build cohesive layouts quickly and efficiently.
Bootstrap-Based Templates
Design Odoo templates easily with clean HTML and Bootstrap CSS. These templates offer a responsive, mobile-first design, making them simple to customize and perfect for any web project, from corporate sites to personal blogs.