Sale!

HC-SR04 Ultrasonic Sensor – Precision Distance Measuring for Arduino Projects Best Price Lahore, Pakistan

Original price was: ₨230.Current price is: ₨200.

you can payment online thorugh Easypaisa, jazzcash, Raast 

Cash on Delivery All over Pakistan

Direct Bank Transfer Payments 

Category:
Quantity
Wishlist

🚚 Delivery: Rs 350 all over Pakistan — 3 to 4 working days. Cash on Delivery available. Order on WhatsApp: +92-302-8577025 / +92-336-4459320

About this item
  • Accurate Distance Measurement: Ideal for student robotics projects.
  • Wide Range: Measures 2 cm to 400 cm with 3mm accuracy.
  • Arduino Integration: Perfect for final-year engineering projects.
  • Low Power: Consumes less than 15 mA for energy-efficient designs.

What is the HC-SR04 Ultrasonic Sensor?

The HC-SR04 is the most popular distance-measuring sensor for Arduino projects in Pakistan. It works like a bat: it sends out a short burst of ultrasonic sound (which humans cannot hear), the sound bounces off an object, and the sensor measures how long the echo takes to come back. From that time it calculates the distance. No touch, no light — just sound.

It is the standard sensor for robot obstacle avoidance, water-level measurement, parking systems and distance alarms, and it appears in almost every Arduino robot car and final-year project.

Key Specifications

SpecificationValue
Operating frequency40 kHz
Measuring range2 cm to 400 cm
Accuracy±3 mm
Measuring angle15 degrees
Operating voltage5V DC
Operating current15 mA
Pins4 — VCC, TRIG, ECHO, GND
Size45 × 20 × 15 mm

Wiring with Arduino UNO

HC-SR04 PinArduino UNO Pin
VCC5V
TRIGD9
ECHOD10
GNDGND

That is the whole wiring — four wires, no resistor needed. The TRIG pin sends the sound pulse and the ECHO pin receives it back.

How It Works

The Arduino sends a 10-microsecond pulse to TRIG. The sensor replies with eight 40 kHz sound pulses. When the echo returns, the ECHO pin goes HIGH for exactly as long as the sound took to travel out and back. Distance in centimetres = (echo time in microseconds × 0.0343) ÷ 2. Sound travels at about 343 metres per second, and the ÷ 2 is because the sound makes a return journey.

Arduino Code — Distance Measurement

// HC-SR04 distance measurement — TRIG D9, ECHO D10
const int trigPin = 9;
const int echoPin = 10;

void setup() {
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  Serial.begin(9600);
}

void loop() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  long duration = pulseIn(echoPin, HIGH);
  float distance = duration * 0.0343 / 2;

  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");
  delay(500);
}

Upload it, open the Serial Monitor at 9600 baud, and move your hand in front of the sensor — the distance prints live. For a full step-by-step build, see our Arduino ultrasonic sensor project guide and our HC-SR04 complete guide.

Where to Use It

  • Robot obstacle avoidance: the sensor on every Arduino robot car — see our obstacle avoidance robot car guide.
  • Water-level measurement: mount it above a tank and read the water level without touching the water.
  • Parking assistance: beep faster as the car gets closer to the wall.
  • Distance alarms and counting: detect a person or object passing a point.

Unlike an IR sensor, the HC-SR04 does not care about sunlight or the colour of the object — sound reflects off black surfaces just as well as white ones. That is why robots use it outdoors and in bright rooms where IR sensors fail. For the full comparison, see our ultrasonic vs PIR sensor guide.

What You Get

1 × HC-SR04 ultrasonic sensor module, tested before dispatch. Jumper wires are not included — add them below if you need them.

Frequently Asked Questions

Q1: Why does my sensor always read 0 cm or no distance?
Check the wiring first — TRIG to D9, ECHO to D10, VCC to 5V (not 3.3V), GND to GND. Then check that the code’s pin numbers match your wiring. A loose Dupont wire is the most common cause.

Q2: Does it work in sunlight?
Yes. Sunlight is light — the HC-SR04 uses sound, so bright light and sunshine do not affect it at all. This is its big advantage over IR obstacle sensors.

Q3: Can it detect a black object?
Yes. Sound reflects off dark surfaces just like light ones, so a black box is detected at the same range as a white one — unlike an IR sensor, which struggles with black.

Q4: What is the minimum distance it can measure?
About 2 cm. Closer than that, the echo returns before the sensor is ready to listen. For very close detection, an IR obstacle module is the better choice.

Complete Your Project

Delivery across Pakistan — flat Rs 350, 3–4 working days, Cash on Delivery available. Questions? Message us on WhatsApp at +92-302-8577025.

Customer Reviews

Reviews

There are no reviews yet.

Be the first to review “HC-SR04 Ultrasonic Sensor – Precision Distance Measuring for Arduino Projects Best Price Lahore, Pakistan”

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

Looking for specific info?