Sale!

HC-SR05 5 Pin Ultrasonic Module for Arduino Distance Measurement

Original price was: 5,98 €.Current price is: 3,52 €. Excluding VAT

HC-SR05 5-pin ultrasonic module for distance measurement, compatible with Arduino, reliable and precise for distance detection projects.

12 in stock (can be backordered)

Domande su questo prodotto? Scrivi a Lana su WhatsApp

🎬 The product on video

Description

Here is the HC-SR05 ultrasonic module, a powerful distance measurement transducer designed for use with Arduino. With its numerous features and flexibility of use, the HC-SR05 module offers infinite possibilities for industrial, research and development, educational, and amateur applications. Learn more about its specifications, uses, and available libraries for Arduino.

Features and specifications:

Measures distance using the principle of ultrasonic waves
Wide measurement range: from 2 cm to 4 meters
Measurement accuracy: +/- 3 mm
Operating voltage: 5V DC
Simple 5-pin communication interface
Low power consumption
Supports single or continuous measurement mode
The HC-SR05 module was invented and developed by a team of experts in the field of ultrasonic sensors. It is not attributed to a single inventor, but was created to provide a reliable and precise solution for distance measurement.

Available libraries for Arduino:

To use the HC-SR05 module with Arduino, you can rely on the following libraries:

NewPing: A popular library that offers simple functions for measuring distance using the HC-SR05 module.
Ultrasonic: Another widely used library that allows for easy reading of distance with the HC-SR05 module.
Examples of projects that use the HC-SR05 module:

Obstacle-avoiding robot: Uses the HC-SR05 module to detect obstacles in the path of a robot and enable safe and autonomous navigation.
Parking assist system: Incorporate the HC-SR05 module into a parking system that helps measure the distance between a vehicle and an obstacle during parking maneuvers.
Tank level monitoring: Use the HC-SR05 module to measure the level of a liquid inside a tank and display real-time information.
Comments on complementary sensors:

The HC-SR05 module pairs well with other sensors to expand the functionality of your project. Some commonly paired sensors with the HC-SR05 module include:

Temperature and humidity sensors: To monitor environmental conditions while measuring distance.
Light sensors: To obtain information about the lighting conditions of the surrounding environment.
Motion sensors: To detect the movement of objects or people in the detection area.
Programming Tips:

In the source code of the HC-SR05 module libraries, you will find several functions that allow you to fully exploit its capabilities. Some programming tips include:

Measurement error management: Implement controls and algorithms to filter data and manage any measurement errors that may occur.
Use of continuous measurement mode: If you need real-time measurements, you can use the continuous measurement mode offered by the HC-SR05 module.
Example Sketch – Obstacle Avoiding Robot:

arduino
Copy code
#include

#define TRIGGER_PIN 2
#define ECHO_PIN 3
#define MAX_DISTANCE 200

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

void setup() {
Serial.begin(9600);
}

void loop() {
delay(50);
unsigned int distance = sonar.ping_cm();

if (distance > 0) {
if (distance < 20) {
// Stop the robot if the obstacle is too close
// Add here the logic for controlling the robot’s movement
} else {
// Continue moving the robot forward
// Add here the logic for controlling the robot’s movement
}
}
}
This sketch uses the NewPing library to create a simple obstacle-avoiding robot using the HC-SR05 module. The robot moves forward until it detects an obstacle within 20 cm, then stops to avoid collision.

Tutorial: How to Use HC-SR05 Ultrasonic Module

The HC-SR05 ultrasonic module is an essential component for distance sensing projects, ideal for robotics and security systems. This tutorial will guide you step-by-step in its implementation on Arduino.

What you need

  • Arduino
  • USB cable
  • HC-SR05 module

Steps

  1. Connect the HC-SR05 module to the Arduino using the VCC, GND, TRIG, and ECHO connectors. Check the datasheet for the correct pin specifications.
  2. Download the NewPing library from GitHub or install it via the Arduino IDE.
  3. Insert the source code provided in the ‘Code’ section.
  4. Compile and upload the sketch to the Arduino. Ensure that the output is consistent with the measured distances.
  5. Test the module’s sensitivity in different environments to optimize the project.

Example code

NewPing sonar(7, 8); void setup() { Serial.begin(9600);}void loop(){Serial.print("Distance: ");Serial.println(sonar.ping_cm());}

Mini project

Create a home security system that alerts when a specific distance threshold is exceeded.

Common mistakes

  • Incorrectly connected pins
  • NewPing library not installed
  • Inaccurate distance measurement due to environmental interference

Recommended accessories

  • Arduino Uno R3
  • 3D Printed Case for Arduino
  • LiPo Batteries for Arduino
  • LDR Sensors

Frequently asked questions

What is the maximum detection range?
Check the datasheet

How can I improve the accuracy of the module?
Avoid unwanted reflections and redeploy the sketch to adapt it to the environmental conditions.

Can it be used in water?
No, it is not designed to withstand water.

Reviews

There are no reviews yet.

Be the first to review “HC-SR05 5 Pin Ultrasonic Module for Arduino Distance Measurement”

Your email address will not be published. Required fields are marked *