Measure distances using the ESP32, combined with both ultrasonic and Lidar sensors, and display the results on a screen.
- Heltec ESP32
- HC-SR04 Ultrasonic Sensor

- TFLuna Lidar Sensor


Ensure you have the following packages installed in your Arduino IDE:
Ensure to make the following connections between the ESP32 and the respective sensors. Refer to the ESP32 Pins for the detailed pinout diagram.
| HC-SR04 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
| 1 | GND | Ground | Ground |
| 2 | 5V (VCC) | Power | Power supply |
| 12 | Trigger | GPIO17 | Trigger Signal |
| 13 | Echo | GPIO15 | Echo Signal |
| TFLuna Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
| 1 | 5V | Power | Power Supply |
| 2 | SDA | GPIO4 | Data Line |
| 3 | SCL | GPIO15 | Clock Line |
| 4 | GND | Ground | Ground |