šŸŽ‰ Up to 70% Off Selected ItemsShop Sale
HomeStore

HC-SR04 Ultrasonic Distance Sensor Module

Product image 1
Product image 2
Product image 3

HC-SR04 Ultrasonic Distance Sensor Module

HC-SR04 Ultrasonic Distance Sensor Module

HC-SR04 Ultrasonic Distance Sensor Module

The HC-SR04 module determines the distance to an object by sending an ultrasonic pulse and receiving a delayed reflection. Based on this delay, the device determines the presence of objects and the distance to them. The ultrasonic emitter sends 8 signals at a frequency of 40kHz, which will be reflected by objects and recorded with a microphone in this sensor module.

It can measure from 2 cm to 400 cm with an accuracy of 2 mm. It is an ideal ultrasonic module for distance measurement, proximity sensors, and ultrasonic detectors.

Ā 

Technical Specification:

  • Operating Voltage: 5V DC.
  • Operating Current: Less than 15 mA.
  • Range: 2 cm to 400 cm (0.79 inches to 13 feet).
  • Accuracy: Around ±3 mm.
  • Frequency: 40 kHz.

Ā Pinouts:

Connection with Arduino:

Module

Arduino UNO

VCC

5V

Trig

Pin 9

Echo

Pin 10

GND

GND

Ā 

Sample Code:

const int trigPin = 9;

const int echoPin = 10;

long duration;

int distance;

Ā 

void setup() {

Ā  pinMode(trigPin, OUTPUT);

Ā  pinMode(echoPin, INPUT);

Ā  Serial.begin(9600);

}

Ā 

void loop() {

Ā  // Send a 10-microsecond pulse to the trigPin

Ā  digitalWrite(trigPin, LOW);

Ā  delayMicroseconds(2);

Ā  digitalWrite(trigPin, HIGH);

Ā  delayMicroseconds(10);

Ā  digitalWrite(trigPin, LOW);

Ā 

Ā  // Read the echoPin and calculate the distance

Ā  duration = pulseIn(echoPin, HIGH);

Ā  distance = duration * 0.0343 / 2;

Ā 

Ā  // Print the distance to the Serial Monitor

Ā  Serial.print("Distance: ");

Ā  Serial.print(distance);

Ā  Serial.println(" cm");

Ā 

Ā  delay(500);

}

$0.29

Original: $0.97

-70%
HC-SR04 Ultrasonic Distance Sensor Module—

$0.97

$0.29

Product Information

Shipping & Returns

Description

HC-SR04 Ultrasonic Distance Sensor Module

The HC-SR04 module determines the distance to an object by sending an ultrasonic pulse and receiving a delayed reflection. Based on this delay, the device determines the presence of objects and the distance to them. The ultrasonic emitter sends 8 signals at a frequency of 40kHz, which will be reflected by objects and recorded with a microphone in this sensor module.

It can measure from 2 cm to 400 cm with an accuracy of 2 mm. It is an ideal ultrasonic module for distance measurement, proximity sensors, and ultrasonic detectors.

Ā 

Technical Specification:

  • Operating Voltage: 5V DC.
  • Operating Current: Less than 15 mA.
  • Range: 2 cm to 400 cm (0.79 inches to 13 feet).
  • Accuracy: Around ±3 mm.
  • Frequency: 40 kHz.

Ā Pinouts:

Connection with Arduino:

Module

Arduino UNO

VCC

5V

Trig

Pin 9

Echo

Pin 10

GND

GND

Ā 

Sample Code:

const int trigPin = 9;

const int echoPin = 10;

long duration;

int distance;

Ā 

void setup() {

Ā  pinMode(trigPin, OUTPUT);

Ā  pinMode(echoPin, INPUT);

Ā  Serial.begin(9600);

}

Ā 

void loop() {

Ā  // Send a 10-microsecond pulse to the trigPin

Ā  digitalWrite(trigPin, LOW);

Ā  delayMicroseconds(2);

Ā  digitalWrite(trigPin, HIGH);

Ā  delayMicroseconds(10);

Ā  digitalWrite(trigPin, LOW);

Ā 

Ā  // Read the echoPin and calculate the distance

Ā  duration = pulseIn(echoPin, HIGH);

Ā  distance = duration * 0.0343 / 2;

Ā 

Ā  // Print the distance to the Serial Monitor

Ā  Serial.print("Distance: ");

Ā  Serial.print(distance);

Ā  Serial.println(" cm");

Ā 

Ā  delay(500);

}

HC-SR04 Ultrasonic Distance Sensor Module | Sensors & Modules