Skip to content

๐Ÿš— ESP32-based smart car with PWM speed control, Bluetooth command input, and ultrasonic obstacle detection. Built for learning and experimentation in embedded systems and robotics

Notifications You must be signed in to change notification settings

torikul007/Smart-Car-Controlled-by-ESP32-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš— ESP32 Smart Car with PWM Speed Control and Obstacle Detection

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]

๐Ÿ“‹ Features

  • ๐Ÿ” 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')

๐Ÿงฐ Hardware Used

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

๐Ÿง  How It Works

  1. Bluetooth commands (like 'F', 'B', 'L', 'R') are sent from a phone or PC.
  2. ESP32 reads the command through Serial2.
  3. For forward movements ('F', 'G', 'I'), the ultrasonic sensor checks if the path is clear.
  4. If no obstacle is detected, the car moves; else, it stops and alerts.
  5. PWM values control the motor speed via analogWrite(ENA/ENB, speedValue).

๐ŸŽฎ Command List

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)

๐Ÿ› ๏ธ How to Upload the Code

  1. Open Arduino IDE.
  2. Select ESP32 Dev Module as board.
  3. Connect your ESP32 via USB.
  4. Install required libraries (like ESP32Servo.h).
  5. Paste the code from main.ino and upload.

๐Ÿ“‚ File Structure

โœ๏ธ Author

[Md.Torikul Islam]
๐Ÿ”— [https://github.com/torikul007]

About

๐Ÿš— ESP32-based smart car with PWM speed control, Bluetooth command input, and ultrasonic obstacle detection. Built for learning and experimentation in embedded systems and robotics

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages