Embedded instrumentation

STM32 E-Scooter Instrumentation

Encoder, ADC and PWM measurement chain on STM32F1 with PI/PID control and UART diagnostics.

IoT & EmbeddedR&D & Prototyping
STM32 E-Scooter Instrumentation: Embedded instrumentation

Overview

Measurement and control firmware for an e-scooter drive. It reads the quadrature encoder with interrupts, samples setpoint, current and voltage through the ADC, closes a PI/PID loop to a PWM motor command and streams diagnostics over UART. An Arduino version is included for comparison.

The challenge

Speed, current and voltage must be measured accurately enough to close a control loop and diagnose faults, using only the resources of an STM32F1.

Key capabilities

  • Interrupt-driven quadrature encoder reading
  • Speed from pulse count and timing
  • ADC setpoint, current and voltage sampling
  • PI/PID loop to PWM motor command
  • UART diagnostics and an Arduino reference build

Inside the project

STM32 E-Scooter Instrumentation: Hardware illustration: components and signal chain
Hardware illustration: components and signal chain
STM32 E-Scooter Instrumentation: System architecture
System architecture

Outcomes

  • Complete sensing-to-actuation chain on one microcontroller
  • Live diagnostics stream for tuning and fault finding

Technology

STM32F1Embedded CSTM32 HALADCPWMUART

Related projects

Industrial Pulse

Industrial IoT condition monitoring

From sensor to screen: equipment telemetry over MQTT, stored in PostgreSQL and monitored live on a bilingual dashboard.

IoT & EmbeddedData & DashboardsWeb Applications

Not sure where your project fits?

Tell us where you are starting. We reply with the simplest sensible scope.

Start a project