This is a smart car project built using the ESP32 microcontroller. The car is remotely controlled via Bluetooth and uses PWM to control motor speed. It also features an ultrasonic sensor to detect obstacles and stop automatically when something is too close.
[Md.Torikul Islam]
๐ [https://github.com/torikul007]
- ๐ PWM Motor Speed Control via ENA/ENB pins (0โ255)
- ๐ก Bluetooth Control using HC-05 module (or use built-in ESP32 Bluetooth)
- ๐ง Obstacle Detection using Ultrasonic Sensor (HC-SR04)
- ๐จ Visual Alert via Buzzer or LED when obstacle detected
- ๐ Horn & Lights (optional extension)
- ๐ก Speed Control using number commands ('0'โ'9')
| Component | Description |
|---|---|
| ESP32 | Main microcontroller |
| L298N Motor Driver | Dual H-Bridge motor driver |
| 2 DC Motors | For driving the car |
| HC-05 Bluetooth | For wireless control via phone/PC |
| HC-SR04 Ultrasonic | For obstacle detection |
| Buzzer or LED | For visual/horn alert |
| 18650 Battery x2 | Power source |
| Chassis & Wheels | Smart car body |
| Jumper Wires | Wiring connections |
- Bluetooth commands (like
'F','B','L','R') are sent from a phone or PC. - ESP32 reads the command through
Serial2. - For forward movements (
'F','G','I'), the ultrasonic sensor checks if the path is clear. - If no obstacle is detected, the car moves; else, it stops and alerts.
- PWM values control the motor speed via
analogWrite(ENA/ENB, speedValue).
| Command | Action |
|---|---|
F |
Move Forward (safe) |
B |
Move Backward |
L |
Turn Left |
R |
Turn Right |
G |
Forward Left Turn |
I |
Forward Right Turn |
H |
Backward Left Turn |
J |
Backward Right Turn |
S |
Stop |
0โ9 |
Set Speed (lowโhigh) |
- Open Arduino IDE.
- Select ESP32 Dev Module as board.
- Connect your ESP32 via USB.
- Install required libraries (like
ESP32Servo.h). - Paste the code from
main.inoand upload.
[Md.Torikul Islam]
๐ [https://github.com/torikul007]