An open-source autonomous vehicle platform featuring sensor fusion (LiDAR + Ultrasonic), real-time navigation, and collision avoidance - all powered by ESP32!
- Hybrid Sensor Fusion: Combines TF-Luna LiDAR (8m range) with ultrasonic sensors for redundant obstacle detection
- Real-Time Navigation: FreeRTOS-powered ESP32 processes sensor data at 100Hz
- Collision Avoidance: Emergency braking system triggered at 20cm proximity
- ROS 2 Ready: Migration path for advanced navigation with Nav2
- Open Hardware: 3D printable parts and accessible components under $100
| Component | Quantity | Source |
|---|---|---|
| ESP32 Dev Board | 1 | AliExpress |
| TF-Luna LiDAR | 1 | SparkFun |
| HC-SR04 Ultrasonic Sensors | 3 | Adafruit |
| L298N Motor Driver | 1 | Amazon |
| TT Gear Motors | 2 | DFRobot |
| 18650 Batteries | 2 | 18650BatteryStore |
Full BOM with links: Hardware/Bill_of_Materials.md
- PlatformIO (VSCode extension)
- Arduino IDE (for initial flashing)
- 3D printer (for custom parts)
# Clone repository
git clone https://github.com/Customize5773/DIY-Self-Driving-Car.git
cd DIY-LiDAR-Car
# Install dependencies
pio pkg install
# Build and upload to ESP32
pio run -t upload
# Monitor serial output
pio device monitor# Run calibration script
python3 scripts/sensor_calibration.py
# Follow on-screen instructions
Place calibration target at 50cm distance
Press ENTER to record measurement...Our decision-making system prioritizes safety while enabling efficient navigation:
graph TD
A[Start] --> B[Read Sensors]
B --> C{Ultrasonic < 20cm?}
C -->|Yes| D[EMERGENCY STOP]
C -->|No| E{LiDAR < 50cm?}
E -->|Yes| F[Adjust Path]
E -->|No| G[Full Speed]
D --> H[Continue]
F --> H
G --> H
H --> B
Image flowchart: Documentation/Autonomous_Logic_Flowchart.png
- Print 3D models
- Mount motors and wheels to chassis
- Install LiDAR at 15cm height with 30° forward tilt
- Position ultrasonic sensors: front (0°), left (+45°), right (-45°)
# Typical connections:
LiDAR SDA → ESP32 GPIO21
LiDAR SCL → ESP32 GPIO22
Ultrasonic TRIG → ESP32 GPIO16
Ultrasonic ECHO → ESP32 GPIO17
Motor ENA → ESP32 GPIO25- Install PlatformIO in VSCode
- Open
Firmware/PlatformIO_Projectfolder - Configure
platformio.inifor your ESP32 variant - Flash using PlatformIO task runner
| Symptom | Solution |
|---|---|
| LiDAR not detected | Check I²C address (default 0x10), ensure 5V power |
| False ultrasonic readings | Add foam ring around sensor, avoid reflective surfaces |
| Motor jitter | Add 100µF capacitor across motor terminals |
| ESP32 overheating | Enable deep sleep between navigation cycles |
- ROS 2 integration (see roadmap)
- IMU-based dead reckoning
- Camera integration for object recognition
- Swarm coordination protocol
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a pull request
Distributed under the MIT License. See LICENSE for more information.
