ESP32 to Motor Driver (L298N):
Motor A (Front Left & Rear Left Wheels) → L298N OUT1 & OUT2
Motor B (Front Right & Rear Right Wheels) → L298N OUT3 & OUT4
L298N IN1 & IN2 → GPIO Pins 16 & 17 (ESP32)
L298N IN3 & IN4 → GPIO Pins 18 & 19 (ESP32)
L298N VCC → 7-12V DC Battery
L298N GND → Common GND with ESP32
L298N 5V Output → 5V (ESP32)
Step 2: Upload the Code
Use the Arduino IDE to program the ESP32. Ensure you install the ESP32 board support package and the "BlynkESP32" library before uploading the code. The key components of the code include:
Defining motor control pins
Setting PWM frequency and channels
Handling Bluetooth commands from the Blynk app
Implementing functions like controlWithVoice() for voice recognition and rotateMotor() for movement control
Step 3: Setting Up the Blynk App
Download and install the Blynk app on Android/iOS.
Create a new project and select ESP32 as the board.
Add a Bluetooth Widget and connect it to the ESP32 (advertised as "My Voice Car").
Use the app’s voice control feature to send commands like:
"Forward"
"Backward"
"Left"
"Right"
"Stop"
"Speed [number]"
"Dance" (executes a pre-programmed movement sequence)
Step 4: Testing and Calibration
Ensure the car connects to Bluetooth before testing.
Adjust the motor speed and direction in the code if needed.
Verify the battery voltage for smooth operation.
Comments
Please log in or sign up to comment.