IJ
Ivan Jovanovski
HomeProjectsLabResumeNowFuture Ideas
IJ
Ivan Jovanovski

Electrical Engineer building practical solutions in energy systems, automotive electronics, and embedded systems.

Navigation

  • Aerospace
  • Projects
  • Lab

Focus Areas

  • Energy Systems
  • Automotive Electronics

Connect

© 2025 Ivan Jovanovski. All rights reserved.

Voice-Controlled Robot Car with Macedonian ASR

STM32Voice ControlEmbedded Systems
General
Voice-Controlled Robot Car with Macedonian ASR

Project Overview

This project describes the design and implementation of a robot that uses the STM32F303 Discovery board to control hardware and a Python server application with OpenAI GPT API to process audio signals and generate commands. The main goal is to create an autonomous system that can process audio commands using artificial intelligence and convert them into appropriate signals for motor control. This system enables integration of embedded systems with modern natural language processing, using a server application for communication between user commands and the robot's motor control.

Version:v1.0
Time:~16.0 hours
Cost:$150
Status:complete

Materials

  • STM32F303 Discovery Board × 1
  • L298N Motor Driver × 1
  • 12V DC Motors with 50:1 Gearbox × 2
  • ESP-01 Wi-Fi Module × 1
  • Bidirectional Logic Level Converter × 1
  • 12V 1.5Ah Drill Battery × 1
  • 5V 5000mAh Powerbank × 1
  • TowerPro SG90 Servo × 1
  • 3D Printed Parts × 10

Tools

  • STM32CubeIDE
  • Python 3.8+
  • OpenAI API
  • 3D Printer

Build Steps

1. System Overview and Architecture

⏱️ ~2.0h
Step 1 image 1Step 1 image 2

Introduction

This project describes the design and implementation of a robot that uses the STM32F303 Discovery board to control hardware and a Python server application with OpenAI GPT API to process audio signals and generate commands. The main goal of the project is to create an autonomous system that can process audio commands using artificial intelligence and convert them into appropriate signals for motor control.

This system enables integration of embedded systems with modern natural language processing, using a server application for communication between user commands and the robot's motor control. The robot represents a practical application of combining low-level embedded programming with high-level AI-powered speech recognition, demonstrating how modern technologies can work together to create intelligent robotic systems.

System Overview

The robot consists of several key components that together provide complete functionality. Each component plays a crucial role in the overall system architecture, from power delivery to motor control to wireless communication. The integration of these components required careful consideration of voltage levels, communication protocols, and mechanical design.

Core Components:

STM32F303 Discovery Board serves as the main system controller. This development board is based on the STM32F303VCT6 microcontroller which features a 32-bit ARM Cortex-M4 processor. The board is ideal for developing embedded systems due to its rich peripheral equipment and support for various communication protocols. It provides 256 KB of Flash memory and 48 KB of SRAM, which is more than sufficient for the control algorithms and communication handling required by this project. The board also includes a built-in ST-LINK/V2 for debugging and programming, making development and troubleshooting significantly easier.

L298N Motor Driver is a dual-channel H-bridge motor driver that enables independent control of two DC motors. This component is essential for controlling the robot's movement, as it can handle voltages up to 46V and currents up to 2A per channel, making it suitable for various applications. The driver receives PWM signals for speed control and digital signals for direction control from the STM32, translating these into the high-current signals needed to drive the motors.

12V DC Brushed Motors with 50:1 Metal Gearbox are used for the rear wheels. The robot uses two of these motors, which are ideal for applications requiring high torque and precise movement at low speeds. The 50:1 gear ratio means that for every 50 rotations of the motor shaft, the output shaft rotates once, providing significant torque multiplication. This high torque is essential for moving the robot's weight and overcoming friction, especially when starting from a standstill or climbing slight inclines.

ESP-01 Wi-Fi Module is a compact Wi-Fi module based on the ESP8266 chip. It enables wireless communication via Wi-Fi networks and is ideal for IoT applications. The module communicates with the STM32 via UART interface and can operate as either a station (connecting to existing Wi-Fi) or as an Access Point. In this project, it operates in station mode, connecting to a local Wi-Fi network to communicate with the Python server.

Bidirectional Logic Level Converter is necessary because the L298N driver operates on 5V logic while the PWM generator from the STM32F303 operates on 3.3V. This converter ensures safe voltage level matching and protects components from potential damage due to voltage mismatch. It's important to note that all elements should be connected to a common ground (GND) for better protection and signal integrity.

Power System consists of two separate power sources to meet the different requirements of the system. A 12V drill battery (1.5 Ah, 16.64 Wh) powers the motor driver and motors, providing the high current needed for motor operation. A 5V Powerbank (5000 mAh, 2.1A) powers the STM32 microcontroller and logic components, ensuring clean, stable power for the sensitive digital electronics.

Mechanical Construction

The robot chassis is 3D printed and designed as a cart-style platform. This construction allows easy mounting of components and provides stability during movement. The cart design was chosen for its simplicity and effectiveness - it provides a large, flat surface for mounting electronics while maintaining a low center of gravity for stability.

The chassis consists of several 3D printed parts, all designed to work together as a cohesive mechanical system. The main chassis base serves as the foundation, with mounting points for motors, electronics, and wheels carefully positioned to ensure proper weight distribution and mechanical advantage.

2. Hardware Components Deep Dive

⏱️ ~3.0h
Step 2 image 1Step 2 image 2Step 2 image 3

STM32F303 Discovery Board

The STM32F303 Discovery board is based on the STM32F303VCT6 microcontroller which has a 32-bit ARM Cortex-M4 processor. The board is ideal for developing embedded systems due to its rich peripheral equipment and support for various communication protocols.

Key Characteristics:

  • 256 KB Flash memory and 48 KB SRAM: This provides ample space for program code and runtime data. The Flash memory stores the firmware permanently, while SRAM is used for variables, stack, and heap during program execution.

  • Support for UART, SPI, I2C, PWM, and ADC: These peripherals enable the microcontroller to communicate with external devices and control various outputs. UART is used for ESP-01 communication, PWM for motor speed control, and GPIO for motor direction control.

  • Built-in ST-LINK/V2 for debugging and programming: This eliminates the need for external programming hardware and provides powerful debugging capabilities including breakpoints, variable watching, and memory inspection.

Motors

The robot uses two 12V DC brushed motors with a metal gearbox with a 50:1 ratio for the rear wheels. These motors are ideal for applications requiring high torque and precise movement at low speeds.

Motor Specifications:

  • Voltage: 12V DC
  • Nominal current: < 2A
  • Type: Brushed DC motor
  • Gearbox: 50:1 metal gearbox
  • Maximum torque: High torque suitable for heavy tasks
  • Speed: At 50:1 ratio, motors provide low speed and high force

These motors are connected through the L298N motor driver, which provides bidirectional motion control and supports PWM for precise speed control. The brushed DC motor design is simple and reliable, with the brushes providing electrical contact to the rotating commutator. The metal gearbox is more durable than plastic alternatives and can handle higher torques without stripping gears.

The 50:1 gear ratio was specifically chosen to provide the right balance between speed and torque for this application. While it reduces the maximum speed of the robot, it significantly increases the available torque, making the robot capable of moving its own weight plus payload reliably and smoothly.

Motors with gearboxes enable the robot to have great force during movement, making it capable of moving through various terrains and performing heavy tasks without loss of stability. The high torque also means the robot can start moving smoothly from a standstill without jerking or stalling.

L298N Motor Driver

The L298N is a dual-channel H-bridge motor driver that enables independent control of two DC motors. It supports voltages up to 46V and currents up to 2A per channel, making it suitable for various applications.

Pin Functions:

  • ENA and ENB: Motor activation (PWM signal) - These pins control the speed of motors A and B respectively by accepting PWM signals
  • IN1, IN2, IN3, IN4: Motor direction control - These digital inputs determine the direction of rotation for each motor
  • VCC: Motor power supply - Connects to the 12V battery
  • 5V: Logic power supply (if not using external 5V) - Can provide 5V for logic circuits
  • GND: Ground - Must be common with all other system grounds

The H-bridge configuration allows the motor driver to reverse the polarity of the voltage applied to the motors, enabling bidirectional control. By controlling which transistors in the H-bridge are active, the driver can make the motor spin forward, backward, or brake.

ESP-01 Wi-Fi Module

The ESP-01 is a compact Wi-Fi module based on the ESP8266 chip. It enables wireless communication via Wi-Fi networks and is ideal for IoT applications.

Characteristics:

  • Support for Wi-Fi standards 802.11 b/g/n: Compatible with most modern Wi-Fi routers
  • UART interface for configuration and data: Communicates with STM32 using simple serial protocol
  • Ability to operate as station or Access Point: Flexible deployment options

The ESP-01 is configured using AT commands sent via UART. These commands allow setting up Wi-Fi connection parameters, establishing TCP connections, and transferring data. In this project, the module operates in transparent transmission mode, where data sent to the UART is automatically transmitted over the established TCP connection.

Bidirectional Logic Level Converter

Since the L298N driver operates on 5V logic and the PWM generator from STM32F303 operates on 3.3V, a bidirectional logic level converter is needed to match voltage levels and protect components.

The converter uses MOSFETs to safely translate signals between the two voltage domains. It's important that all elements are connected to common ground (GND) for better protection and proper signal referencing. Without this converter, the 3.3V signals from the STM32 might not reliably trigger the 5V logic inputs of the L298N, and 5V signals could potentially damage the 3.3V inputs of the STM32.

Gallery

Gallery 1Gallery 2Gallery 3Gallery 4Gallery 5Gallery 6Gallery 7

Discussion & Notes

Why use cloud processing instead of on-device ASR?

Limited Macedonian ASR resources and STM32 processing constraints made cloud-based Whisper API the most practical solution for accurate Macedonian speech recognition.

Why separate 5V and 12V power supplies?

The L298N and motors draw high current which would overload a single 5V regulator. Using dedicated supplies prevents voltage drops and ensures stable MCU operation.

Results

Successfully implemented real-time voice control in Macedonian language with stable cloud-based speech processing. The robot responds to voice commands with minimal latency and provides reliable motor control.

  • PWM Frequency: 100 Hz
  • UART Baud Rate: 9600 baud
  • System Clock: 48 MHz

Planned Upgrades (v2.0)

TowerPro SG90 Servo Integration

high

Although the robot currently moves left and right by controlling the two motors (one forward, one backward), the plan is to add support for the TowerPro SG 90 Micro Servo Motor. This servo motor is already part of the robot's mechanical construction, but electrical connections and code need to be updated to enable its integration for more flexible direction control.

Microphone via ADC2 Converter

high

The next step is adding a microphone connected to STM32 via ADC2 converter. The microphone to be used is already fabricated and based on a custom amplifier circuit design.

Battery Cart Completion

medium

Work is underway to complete the cart that will contain the batteries. This construction is already present in the real image but needs to be finalized for final stability.

Safety Notes

Ensure proper voltage regulation (5V for STM32, 12V for motors). Use common ground for all components. L298N has thermal protection but monitor for overheating. Use WPA2 encryption for Wi-Fi security.