Gorillacell Module 026: Ultrasonic Sensor
Table of Contents

The Ultrasonic Sensor measures distance using high-frequency sound waves.
The Gorillacell ESP32 Development Kit includes an Ultrasonic Sensor module, driven by the HC-SR04 driver chip, which handles generating and receiving the sound waves. The sensor has two “eyes”: one acts as a transmitter that emits sound waves, and the other serves as a receiver that detects the waves reflected back from an object.
The distance between the sensor and an object can be calculated using the formula:
distance = time × Speed of Sound / 2
Speed of Sound is approximately 340 m/s (or 29.412 µs/cm).
The division by 2 accounts for the fact that the sound wave travels to the object and back.
In operation, the sensor sends a sound pulse, which bounces off the object and returns to the sensor. The time it takes for this round trip is used to calculate the distance accurately.
BASIC INFORMATION
Device | Category | Interface | Chipset | Description |
---|---|---|---|---|
Input | Sensor Cell | Digital | HC-SR04 | - |
PINOUT
It has 4 pins which are
- GND - for the ground pin,
- VCC - for the supply voltage,
- TRIG - for initiating the transmit of sound signal, and
- ECHO - for receiving the reflected sound signal.