Loading store…

by Generic
SKU: PSA-CMP-HCSR04
No reviews yetTypical India street price
₹35–₹80
Measures distance with a 40 kHz sound pulse — classic obstacle / tank-level lab.
Interface: GPIO (TRIG/ECHO)
Wire TRIG/ECHO to the kit ultrasonic pins, then use the distance sense block in Blockly.
TRIG → D7 (GPIO13), ECHO → D0 (GPIO16). Level-shift ECHO on 3.3 V boards.
Blockly: sense_ultrasonic_distance
Open PSA LabGet notified if we start selling this part
HC-SR04 is a classroom sonar: it clicks ultrasonic sound and times the echo to estimate distance to a hard surface.
Sound in dry air is about 343 m/s at 20 °C (roughly 0.034 cm/µs). Distance one-way (cm) ≈ (echo_high_time_µs × 0.034) / 2 — divide by two because the pulse travels to the target and back. Typical useful range is 2–400 cm; soft fabric, foam, and sharp angles absorb or deflect the beam (~15° cone). Temperature changes speed of sound slightly; advanced labs can compensate. In the classroom, treat HC-SR04 Ultrasonic Distance Sensor as a beginner part using GPIO (TRIG/ECHO). Typical India street price is about ₹35–₹80. Always verify voltage and pin labels on your exact module — silk screens vary across clones. Start with a datasheet or trusted learn guide, power the part correctly, share GND with the MCU, and test with a simple blink/read sketch before building the full project. Measure voltages with a multimeter when something fails, and keep actuator current off the MCU regulator.
Pulse TRIG high for ≥10 µs. The module emits eight 40 kHz cycles. ECHO stays high for the round-trip time — measure with pulseIn() or an interrupt. On 3.3 V MCUs (ESP8266/ESP32/Pico), level-shift ECHO (divider) because ECHO can swing to 5 V.
| Range | 2–400 cm |
| Frequency | 40 kHz |
| Accuracy | ±3 mm typical |
| Angle | ~15° |
| Category | Sensors |
| Difficulty | Beginner |
| Voltage | 5V |
| Interface | GPIO (TRIG/ECHO) |
VCC 5V | TRIG | ECHO | GND