Skip to the content
2 layers45.4 × 36 mmSTM32 Vibrations Monitor, the printed circuit board in 3D

STM32 Vibrations Monitor

AnooshZ/VibrationMonitor-MPU60502

Arduino + MPU6050 vibration monitoring system with threshold detection, Python live plotting, and KiCad PCB design.

Size
45.4 × 36 mm
Copper layers
2
Thickness
1.6 mm
Parts
44
Nets
66
Pads
181
Tracks, vias
351, 36
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
30 Sep 2025
Updated
20 Oct 2026

Overview

STM32 Vibrations Monitor is an open-source printed circuit board by AnooshZ, from the AnooshZ/VibrationMonitor-MPU6050 repository on GitHub, published under the MIT licence. It is a 2-layer board of 45.4 × 36 mm with 44 parts on 66 nets, routed with 351 tracks and 36 vias.

It is built around the MPU-6050, TPS7A2033PDBVR-TP and USBLC6-2SC6. Its parts include 17 capacitors, 9 resistors, 4 ICs, 4 connectors and 2 diodes. It belongs with the STM32 boards of this library.

Main components

3

README

README.md

📈 Vibration Monitoring System | Arduino → STM32 Custom PCB

A real-time vibration monitoring system built around the MPU6050 accelerometer, originally developed using an Arduino UNO and Python, and subsequently redesigned around an STM32F103 microcontroller on a custom-designed PCB.

The project explores embedded systems, sensor interfacing, digital signal processing, PCB design, and hardware debugging.

The original Arduino prototype successfully demonstrated vibration detection, signal filtering, threshold-based LED indication, and real-time Python visualization. The STM32 redesign aims to improve sampling consistency, timing control, and overall system flexibility while providing practical experience developing and validating custom embedded hardware.

Current Status: Custom PCB manufactured, assembled, powered, and successfully programmed. Hardware bring-up completed; STM32 firmware development in progress.


🎯 Project Overview

The project began as an experiment in vibration analysis using an Arduino UNO and MPU6050 accelerometer.

The initial implementation acquired accelerometer measurements, processed vibration data, applied filtering, and communicated results to a Python application for real-time visualization and data logging.

Although the prototype worked, I encountered limitations involving sampling consistency, timing accuracy, and flexibility in controlling the underlying hardware.

To address these limitations, I redesigned the system around an STM32F103C8T6 microcontroller and developed my first custom PCB using KiCad.

A major objective throughout this redesign was to learn directly from technical documentation rather than relying heavily on tutorials. This involved studying component datasheets, application notes, and the STM32 reference manual to understand peripheral configuration, clock circuitry, power distribution, communication interfaces, and PCB layout.


🚀 Project Development Status

StageStatus
Arduino + MPU6050 prototype✅ Complete
Vibration detection and filtering✅ Complete on Arduino
Python visualization and CSV logging✅ Complete on Arduino
STM32 schematic design✅ Complete
Custom PCB layout and design-rule verification✅ Complete
PCB manufacturing and assembly✅ Complete
Power rail verification✅ Complete
SWD communication and MCU identification✅ Complete
STM32 programming and debugging✅ Complete
Bare-metal GPIO configuration and LED blinking✅ Complete
External MPU6050 integration🔄 Upcoming
STM32 I²C firmware🔄 Upcoming
STM32 vibration acquisition and processing🔄 Planned
STM32-to-Python communication🔄 Planned
Physical board demonstration videos🔄 Coming soon

🧠 Original Arduino Prototype

The first version of the system was developed using an Arduino UNO, MPU6050 sensor module, and Python.

Features

  • Real-time vibration measurements using the MPU6050 three-axis accelerometer
  • High-pass filtering to reduce unwanted low-frequency components
  • RMS smoothing for more stable vibration measurements
  • Threshold-based LED indication
  • Serial communication between Arduino and Python
  • Real-time plotting of vibration magnitude and RMS values
  • Timestamped CSV logging for further analysis
  • Initial experimentation with FFT-based vibration analysis

Hardware

  • Arduino UNO
  • MPU6050 accelerometer module
  • Breadboard and jumper wires
  • LED with current-limiting resistor
  • USB connection for serial communication

Arduino Connections

Arduino PinConnection
5VMPU6050 module VCC
GNDMPU6050 GND
A4MPU6050 SDA
A5MPU6050 SCL
D8LED output

Software

Arduino: Acquires acceleration measurements, performs vibration-related calculations, applies filtering, and activates the LED when the configured vibration threshold is exceeded.

Python: Receives serial measurements, plots vibration magnitude and RMS values in real time, and saves measurement data for later analysis.

Original Prototype Demonstration

Watch the Arduino vibration monitoring demo

The demonstration uses a massage gun to introduce controlled vibrations at different intensity levels.

At lower vibration levels, the LED remains off. At higher vibration levels, the measured vibration exceeds the threshold and activates the LED.

The Python visualization displays the corresponding changes in vibration magnitude and RMS measurements.


🔧 STM32 Custom PCB Redesign

The second iteration replaces the Arduino development board with a custom PCB designed around the STM32F103C8T6 ARM Cortex-M3 microcontroller.

This redesign provides greater control over the hardware and creates a foundation for implementing more consistent sampling, hardware timers, sensor communication, and embedded signal processing.

Hardware Features

Component / InterfacePurpose
STM32F103C8T6Main ARM Cortex-M3 microcontroller
TPS7A2033 LDORegulated 3.3V power supply
8 MHz external crystalExternal clock source
USB Micro-B connectorUSB connectivity and power input
USB ESD protectionProtection for USB data lines
SWD headerProgramming and hardware debugging
UART headerSerial communication and debugging
I²C headerExternal MPU6050 sensor connection
Analog supply filteringFiltering for the MCU analog power domain
BOOT0 selection switchBoot mode configuration
Reset circuitryMCU reset control
Status LEDsPower indication and firmware-controlled output

Power Distribution

The PCB uses a dedicated 3.3V low-dropout regulator to supply the STM32 and associated circuitry.

The design includes local decoupling capacitors near the microcontroller power pins, bulk capacitance for supply stability, and filtering for the analog supply domain.

Clock Circuitry

An 8 MHz external crystal and its supporting capacitors are included to provide an external clock option.

The STM32 can also operate using its internal oscillator, allowing firmware development and initial bring-up without requiring the external crystal to be configured.

Programming and Debugging

A dedicated SWD header exposes the STM32 programming and debugging signals.

Using an ST-Link programmer and STM32CubeIDE, the microcontroller can be programmed, halted, inspected, and debugged directly on the custom PCB.

Sensor Interface

The PCB includes an I²C header for connecting an external MPU6050 module.

This allows the sensor interface to be developed and tested independently before integrating vibration processing into the STM32 firmware.


🛠️ PCB Design and Manufacturing

The schematic and PCB layout were developed in KiCad.

The design process involved:

  • Studying STM32 datasheets and reference documentation
  • Selecting components and verifying footprints
  • Designing the power distribution and decoupling networks
  • Implementing clock, reset, boot, USB, and debugging circuitry
  • Routing a two-layer PCB
  • Considering return paths, trace routing, and placement of decoupling components
  • Running electrical rule checks (ERC) and design rule checks (DRC)
  • Preparing manufacturing files and a bill of materials
  • Ordering and assembling the physical PCB

The boards were manufactured through JLCPCB, with additional manual soldering and hardware bring-up performed after delivery.

PCB Design Files

The KiCad project files are available in the KiCad/ directory.

These include:

  • .kicad_pro — KiCad project configuration
  • .kicad_sch — Complete electrical schematic
  • .kicad_pcb — PCB layout and routing

The directory also contains PCB renders and schematic images for convenient viewing without KiCad.


⚡ Hardware Bring-Up and Validation

After receiving the manufactured PCB, I began testing the board before developing the full application firmware.

Power Verification

Using a digital multimeter, I verified the board's power connections and regulated 3.3V supply.

The onboard power indicator LED also confirmed the presence of the regulated supply.

SWD and Microcontroller Verification

Using an ST-Link programmer and STM32CubeProgrammer, I successfully established communication with the STM32F103.

The debugger identified the target microcontroller and was able to access its internal flash memory.

This confirmed that the microcontroller was powered, responsive, and accessible through the custom SWD interface.

Hardware Debugging

During initial bring-up, the debugger could not establish communication with the microcontroller.

Investigation of the reset circuitry revealed an issue with the physical reset pushbutton footprint and its pin mapping, which caused the NRST signal to remain asserted.

After identifying and removing the problematic switch, SWD communication was successfully restored.

This was a valuable practical lesson in component footprint verification, PCB assembly, and systematic hardware fault isolation.

The board can currently be reset through the debugging interface or by power cycling.

First Successful Firmware Test

After confirming SWD communication, I created a bare-metal STM32 project in STM32CubeIDE.

Rather than relying on automatically generated GPIO initialization code, I configured the necessary registers directly using the STM32 reference manual.

This involved:

  • Enabling the GPIOC peripheral clock through the RCC register
  • Configuring PC13 as a general-purpose output
  • Accessing memory-mapped peripheral registers using C pointers
  • Using bitwise operations to configure and control GPIO
  • Implementing a software delay loop
  • Flashing and executing the program through ST-Link

Result: The onboard LED successfully blinks under firmware control.

This verified the complete development path from writing and compiling firmware to programming and executing code on the custom STM32 PCB.


💻 STM32 Firmware Development

The STM32 firmware is currently under active development.

The initial milestone was establishing reliable programming and GPIO control, which has now been achieved.

The next stage is integrating the MPU6050 accelerometer through the external I²C header.

Planned Firmware Milestones

  1. Configure STM32 I²C communication.
  2. Detect and initialize the MPU6050.
  3. Read raw three-axis acceleration measurements.
  4. Implement consistent sensor sampling using hardware timers.
  5. Process acceleration measurements to calculate vibration magnitude and RMS values.
  6. Reimplement threshold-based vibration detection.
  7. Transmit measurements to a host computer for Python visualization.
  8. Investigate FFT-based frequency-domain vibration analysis.

The objective is to progressively replace the functionality of the original Arduino prototype with firmware developed specifically for the STM32 platform.

Development Approach

I am currently focusing on register-level programming to develop a deeper understanding of the STM32 peripherals, memory-mapped I/O, peripheral clock control, and embedded C.

This approach provides direct experience with the underlying microcontroller hardware before introducing higher-level abstraction libraries where appropriate.


📹 Physical PCB Demonstrations — Coming Soon

The custom PCB has completed its initial hardware bring-up, and the STM32 has been successfully programmed and tested with a blinking LED.

I am currently working on the firmware and preparing to integrate the external MPU6050 sensor.

Videos demonstrating the physical PCB, successful firmware execution, sensor communication, and eventually real-time vibration monitoring will be uploaded as development progresses.

These demonstrations will document the transition from the original Arduino prototype to the working custom STM32-based system.


📁 Repository Structure

text
VibrationMonitor-MPU6050/
│
├── Arduino/
│   └── Original Arduino prototype firmware
│
├── Python/
│   └── Real-time plotting and data logging
│
├── KiCad/
│   ├── STM32_Vibrations_Monitor.kicad_pro
│   ├── STM32_Vibrations_Monitor.kicad_sch
│   ├── STM32_Vibrations_Monitor.kicad_pcb
│   └── KiCad Images/
│       ├── PCB_3D_Top_View.jpeg
│       ├── PCB_3D_Bottom_View.jpeg
│       ├── PCB_Design.jpeg
│       └── Schematic.jpeg
│
├── Demo/
│   └── Original Arduino demonstration
│
├── LICENSE
└── README.md

STM32 firmware files and physical PCB demonstrations will be added as development continues.


🧰 Tools and Technologies

Hardware and PCB Design

  • KiCad
  • STM32F103C8T6
  • MPU6050 accelerometer
  • JLCPCB manufacturing and assembly
  • Digital multimeter and soldering equipment

Embedded Development

  • Embedded C
  • STM32CubeIDE
  • STM32CubeProgrammer
  • ST-Link / SWD
  • Register-level peripheral configuration
  • I²C, UART, and GPIO

Software and Data Processing

  • Arduino IDE
  • Python 3
  • Matplotlib
  • PySerial
  • Digital filtering and RMS calculations
  • FFT-based signal analysis

Documentation and Version Control

  • GitHub
  • STM32 reference manual and datasheets
  • Component datasheets and application notes

📚 Key Learning Outcomes

This project has provided practical experience across both hardware and firmware development.

Some of the most valuable learning experiences have included:

  • Designing a complete STM32-based embedded PCB from component documentation
  • Understanding microcontroller power, reset, clock, and boot requirements
  • Developing and verifying a PCB layout for manufacturing
  • Performing first-time hardware bring-up and electrical measurements
  • Diagnosing a physical PCB assembly and footprint issue
  • Establishing reliable SWD communication
  • Programming a custom STM32 board using ST-Link
  • Writing bare-metal C firmware using memory-mapped peripheral registers
  • Connecting hardware design decisions with actual firmware behavior

The next objective is to bring the complete vibration monitoring application onto the STM32 platform.


👨‍💻 Author

Anoosh Zaidi
Computer Engineering Student
Toronto Metropolitan University

This project is part of my ongoing exploration of embedded systems, PCB design, hardware debugging, and firmware development.


📜 License

This project is released under the MIT License. See LICENSE for details.

Parts

44
QtyValueFootprintReferences
41.5kResistor_SMD:R_0603_1608MetricR2, R6, R7, R9
4100nFCapacitor_SMD:C_0603_1608MetricC1, C2, C3, C4
4MountingHoleMountingHole:MountingHole_2.2mm_M2H1, H2, H3, H4
30.1uFCapacitor_SMD:C_0603_1608MetricC9, C11, C13
3Conn_01x04Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ1, J3, J4
21.0uFCapacitor_SMD:C_0805_2012MetricC16, C17
210kResistor_SMD:R_0603_1608MetricR1, R8
210nFCapacitor_SMD:C_0603_1608MetricC7, C15
21uFCapacitor_SMD:C_0805_2012MetricC5, C8
222pFCapacitor_SMD:C_0603_1608MetricC10, C12
24.7KResistor_SMD:R_0603_1608MetricR3, R5
1120RInductor_SMD:L_0603_1608MetricFB1
12.2nFCapacitor_SMD:C_0603_1608MetricC14
1330Resistor_SMD:R_0603_1608MetricR4
14.7uFCapacitor_SMD:C_0805_2012MetricC6
1Crystal_GND24Crystal:Crystal_SMD_Abracon_ABM3B-4Pin_5.0x3.2mmY2
1LEDLED_SMD:LED_0603_1608MetricD1
1MPU-6050Sensor_Motion:InvenSense_QFN-24_4x4mm_P0.5mmU2
1REDLED_SMD:LED_0603_1608MetricD2
1STM32F103C8TxPackage_QFP:LQFP-48_7x7mm_P0.5mmU1
1SW_PushCustom_Switch:SMT_FSSW1
1SW_SPDTCustom_Slide_Switch:SWITCH_1SCQNSW2
1TPS7A2033PDBVRCustom_Power:DBV0005A-MFGU3
1USBLC6-2SC6Package_TO_SOT_SMD:SOT-23-6U4
1USB_B_MicroConnector_USB:USB_Micro-B_Molex-105017-0001J2

Similar boards

  • 4 layers144 × 127 mmFrothfet, the printed circuit board in 3D

    Frothfet

    hoeken/frothfet

    Yarrboard load controller board with current sense, volt sense, fuses, and sender support.

    394 parts14GPL-3.0
  • 4 layers51.4 × 31.4 mmRP2350, the printed circuit board in 3D

    RP2350

    engelberd/sensor-system

    Working notes for the first custom RP2350A board with ADXL355, USB-C development power/data, 12 V field input, RS485, and a power architecture biased toward a clean accelerometer supply.

    87 parts2
  • 4 layers160.7 × 51.7 mmSendit, the printed circuit board in 3D

    Sendit

    hoeken/sendit

    ESP32 based ADC Input Multitool

    228 parts2GPL-3.0
  • 4 layers100 × 100 mmPCAP04 Acquisition 3CH v1.5 100mm C496550, the printed circuit board in 3D

    PCAP04 Acquisition 3CH v1.5 100mm C496550

    NautyXie/pcap04-capacitance-readout

    KiCad 7 project for the PCAP04 3-channel capacitance readout board. 100 × 100 mm, 4 layers, SMA edge connectors.

    69 parts2
  • 4 layers61.3 × 61.3 mmCyton Mod, the printed circuit board in 3D

    Cyton Mod

    flosimn/Cyton-Mod

    135 parts1
  • 4 layers40 × 40 mmTouchpadAdapter, the printed circuit board in 3D

    TouchpadAdapter

    Michael-Lloyd/fw13-touchpad-bridge

    Framework 13 Touchpad to USB bridge

    74 parts1
  • 4 layers49.6 × 40 mmFsoc rx, the printed circuit board in 3D

    Fsoc rx

    SharbelMarshi/txrx-optical-communication-kicad

    A Free-Space Optical Communication link KiCad project

    62 parts1
  • 4 layers36 × 36 mmWisp, the printed circuit board in 3D

    Wisp

    2shaurya4/wisp-daughter-board

    37 parts

Questions

How big is the STM32 Vibrations Monitor PCB?

It measures 45.4 × 36 mm and has 2 copper layers, 1.6 mm thick.

What parts does the STM32 Vibrations Monitor use?

44 parts, built around the MPU-6050, TPS7A2033PDBVR-TP and USBLC6-2SC6. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the STM32 Vibrations Monitor KiCad files?

From the AnooshZ/VibrationMonitor-MPU6050 repository on GitHub, at the commit this page was made from: the board is KiCad/STM32_Vibrations_Monitor.kicad_pcb and its schematic KiCad/STM32_Vibrations_Monitor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the STM32 Vibrations Monitor design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).