Concept
For my final project, I am building a Voice-Controlled Car.
The main idea is to create a small robotic vehicle that moves based on simple spoken commands such as “forward,” “left,” “right,” “backward,” and “stop.”
Instead of using a remote controller, buttons, or joysticks, the user interacts with the car entirely through speech. The goal is to make the interaction feel natural and intuitive, almost like the car is “listening” and responding in real time.
The project uses bi-directional communication between Arduino and p5.js:
-
p5.js listens to the user’s voice, recognizes the command, and sends it to the Arduino.
-
Arduino moves the motors and sends back status messages to p5.js.
This creates a complete loop where the user, p5.js, and the car are constantly communicating.
Arduino and P5 Communication
These are the main components I’m using in the project:
-
Arduino Uno
-
Adafruit Motor/Stepper/Servo Shield
-
4 DC motors + wheels
-
Wooden board chassis
-
Battery pack (to power the motors)
-
USB cable or Bluetooth module (Adafruit Bluefruit EZ-Link)
-
Optional: LEDs or buzzer for feedback
Here is how the system is organized:
-
Microphone is connected to p5.js to detect speech.
-
p5.js sends simple movement commands to the Arduino.
-
The Arduino controls the motors through the motor shield.
-
Arduino also sends responses back to p5.js to display status.
This makes the communication two-way, not just one-directional.
Arduino → P5 Communication
Every time the Arduino receives a command and performs the movement, it sends back a message so p5.js can update the interface.
For example: car_forward, car_left, car_right, car_backward, car_stopped
These messages allow the p5.js program to show real-time feedback about what the car is doing.
This also helps with testing and makes the experience feel more responsive.
Later on, this system can be expanded to include things like speed
P5 → Arduino Communication
The p5.js sketch uses the p5.SpeechRec() library to listen for specific keywords.
When a valid direction is heard, p5.js sends a short command to the Arduino through serial.
| Spoken Word | Code Sent to Arduino |
|---|---|
| forward | F |
| left | L |
| right | R |
| backward | B |
| stop | S |
Using one-letter codes keeps communication fast and reduces errors.
Arduino then reads the code and moves the motors accordingly using the Adafruit motor shield
Project Progress So Far
I began by building the physical structure of the car before working on the code.
What I have completed:
-
Attached four DC motors to the corners of my wooden chassis
-
Mounted the Adafruit Motor Shield onto the Arduino Uno
-
Fitted the wheels onto the motors
-
Tested spacing and placement for the battery pack
-
Ensured that the chassis is stable and balanced
-
Confirmed that all electronic components fit properly