Overview The HC-SR04 (often written HCSR04) is a widely used ultrasonic distance sensor module designed for quick, non-contact distance measurement in electronics and DIY automation projects. It works by emitting an ultrasonic burst through its transmitter transducer and listening for the reflected echo on the receiver transducer.
HC-SR04 ultrasonic distance sensor module x1
The HC-SR04 (often written HCSR04) is a widely used ultrasonic distance sensor module designed for quick, non-contact distance measurement in electronics and DIY automation projects. It works by emitting an ultrasonic burst through its transmitter transducer and listening for the reflected echo on the receiver transducer. By measuring the time-of-flight of the sound wave, your controller can estimate the distance to an object in front of the sensor. This makes the module a popular choice for entry-level robotics, obstacle avoidance, proximity sensing, and simple level/distance monitoring where optical sensors may struggle due to lighting conditions.
The module typically operates by sending a short trigger pulse to the TRIG pin. After receiving the trigger, the onboard controller drives the ultrasonic transmitter at approximately 40 kHz for a brief burst. The module then sets the ECHO pin high and keeps it high until the reflected signal is detected (or until an internal timeout occurs). Your microcontroller measures the width of the ECHO pulse; this pulse width corresponds to the round-trip travel time of the ultrasonic wave. Distance is then calculated using the speed of sound in air, which varies with temperature, humidity, and air pressure. For best accuracy, compensate for ambient temperature when possible, and ensure the target surface is reasonably reflective to ultrasound (flat, solid surfaces generally perform better than soft fabrics or angled surfaces that deflect sound away from the receiver).
Because the HC-SR04 is commonly powered from 5V, the ECHO output is typically a 5V logic-level pulse on many module revisions. When interfacing with 3.3V-only GPIO (for example, many Raspberry Pi and some microcontrollers), use a level shifter or a resistor divider on the ECHO line to protect the input pin. TRIG is an input and is often compatible with 3.3V drive in practice, but behavior can vary by module revision—verify with your specific board and follow the datasheet guidance.
HC-SR04 ultrasonic distance sensor module x1
No reviews for this component yet.