A web-based voice control system for servo motors using ESP32, Arduino, and speech recognition. Control servos with voice commands "Forward" and "Backward".

- Browser-based speech recognition using Web Speech API
- Real-time servo control via WiFi
- MySQL database for command persistence
- Responsive web interface with dark theme
- Single servo control optimized for voice commands
Voice Input → Web Browser → PHP API → MySQL Database → ESP32 → Arduino → Servo Motor
- ESP32 Development Board
- Arduino Uno/Nano
- Servo Motor
- Jumper wires
- Web server with PHP support
- MySQL database
- Arduino IDE
- Modern web browser (Chrome, Edge, Safari)
ESP32 Pin 25 (TX) → Arduino Pin 2 (RX) ESP32 Pin 27 (RX) → Arduino Pin 3 (TX) Arduino Pin 13 → Servo Signal Pin GND connections between all components
CREATE DATABASE servo_control;
USE servo_control;
CREATE TABLE directions (
id INT AUTO_INCREMENT PRIMARY KEY,
direction ENUM('forward', 'backward') NOT NULL,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
- Edit
db_config.php
with your MySQL credentials - Update WiFi credentials in
ESP32.ino
- Set server IP address in
ESP32.ino
- Upload Arduino and ESP32 code
- Deploy web files to your server
- Open web interface in browser
- Click microphone button
- Say "Forward" or "Backward"
- Servo moves to corresponding position (Forward=180°, Backward=0°)
index.html
- Main web interfacestyle.css
- Interface stylingsave_direction.php
- Command storage APIdirection.php
- Command retrieval APIdb_config.php
- Database configurationArduino.ino
- Servo control codeESP32.ino
- WiFi communication code
POST /save_direction.php
Body: direction=forward|backward
Response: {"success": true, "direction": "forward"}
GET /direction.php
Response: {"success": true, "direction": "forward", "angle": 180}