Skip to the content
2 layers88 × 60 mmDSO Final, the printed circuit board in 3D

A custom Digital Storage Oscilloscope (DSO) built with an STM32F401 Black Pill and a custom PCB. Features a 1.47" SPI display, an analog front-end with hardware over-voltage protection, and real-time DSP for waveform analysis and measurements.

Size
88 × 60 mm
Copper layers
2
Thickness
1.6 mm
Parts
25
Nets
42
Pads
101
Tracks, vias
196, 16
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
3 Jun 2026
Updated
7 Jun 2026

Overview

DSO Final is an open-source printed circuit board by ahmedkamel382, from the ahmedkamel382/STM32-Oscilloscope repository on GitHub. It is a 2-layer board of 88 × 60 mm with 25 parts on 42 nets, routed with 196 tracks and 16 vias.

Its parts include 5 capacitors, 5 resistors, 4 connectors, 4 switches and 2 transistors. It belongs with the sensors and measurement boards and the STM32 boards of this library.

README

README.md

⚡ Digital Storage Oscilloscope (STM32F401)

STM32 Python Machine Learning Academic

A high-performance, low-cost Digital Storage Oscilloscope (DSO) engineered from the component level up. Built around the STM32F401 "Black Pill", this project bridges embedded hardware and modern data science by combining a custom Analog Front-End (AFE), deterministic DMA-paced sampling, high-speed USB-CDC telemetry, and an offline Machine Learning waveform classifier.

This project was developed for the Embedded Systems (ECE5206) course at the Arab Academy for Science, Technology and Maritime Transport (AASTMT), supervised by Dr. Amr Fahmy.


🚀 Key Features

  • Bipolar Signal Acquisition: A custom analog conditioning circuit featuring a 1.65V virtual ground allows the single-supply microcontroller ADC to safely read alternating current (AC) waveforms.
  • Active Hardware Protection: Bipolar Junction Transistor (BJT) clamping arrays (2N3904 / 2N3906) actively protect the STM32 silicon from over-voltage and negative voltage spikes.
  • Deterministic Firmware Architecture: Hardware Timer 2 (TIM2) strictly paces ADC conversions, completely bypassing software polling delays.
  • Zero-Loss Data Capture: Direct Memory Access (DMA) utilizing a Ping-Pong (Half/Full) buffering strategy ensures continuous, uninterrupted sampling while the CPU processes data.
  • High-Speed USB Streaming: A custom USB-CDC pipeline streams raw binary data (736-byte packets) to the host PC, vastly outperforming standard UART communication.
  • Edge AI Classification: A fully offline scikit-learn Random Forest machine learning model analyzes live mathematical features to automatically classify incoming signals (Sine, Square, Triangle, Noise, or DC).
  • Zero-Lag Desktop UI: A multi-threaded Python companion application built with PyQtGraph delivers 60-FPS real-time rendering alongside an embedded SQLite database for waveform logging.

🧰 Technology Stack

Hardware

  • Microcontroller: STM32F401CCU6 (84 MHz Core, 48 MHz USB)
  • Local Display: 240×240 ST7789 TFT Display (SPI)
  • Analog Front-End: Precision 33kΩ / 10kΩ attenuation networks with 2N3904/06 hardware clamps
  • PCB Design: Custom single-sided PCB routed in KiCad with dedicated power-rail decoupling

Software & Firmware

  • Embedded Development: C/C++, STM32CubeIDE (HAL & LL Drivers)
  • Desktop Application: Python 3, PyQtGraph, PyQt5, SQLite3
  • Machine Learning: scikit-learn, numpy, joblib

The AI classifier was trained on approximately 6,000 synthesized waveforms.


📊 Hardware Specifications & Limits

SpecificationValueNotes
Max Input Voltage~ -5.44V to +8.74VScaled via a 0.1315 attenuation factor
Max Sampling Rate~ 1.56 MspsADCCLK pushed to 42 MHz (DIV2)
Practical Bandwidth~ 150 kHzBased on requiring 10 data points per wave cycle
Hardware FilterRC Low-PassV1.0 uses a 33pF capacitor (102 MHz cutoff). V2.0 recommends a 4.7nF capacitor to align the anti-alias cutoff to approximately 720 kHz.

⚙️ Getting Started

1. Hardware Setup

  1. Assemble the Analog Front-End using the provided KiCad schematics located in:
text
/Hardware Design
  1. Ensure proper grounding between the device under test (for example, an ICL8038 signal generator) and the STM32.

  2. Connect the STM32 board to your PC using a USB Type-C cable.


2. Firmware Flashing

  1. Open the project using STM32CubeIDE.
  2. Build the firmware.
  3. Flash the firmware to the STM32F401 using an ST-Link V2 programmer.

3. Running the Desktop Application

Ensure Python 3 is installed on your system.

Navigate to the desktop application directory and install the dependencies:

bash
cd dso_pc
pip install -r requirements.txt

Launch the desktop UI:

bash
python dso_app.py

The AI classifier (dso_model.joblib) is pre-trained.

If you wish to retrain the model using different parameters, execute:

bash
python train_model.py

before launching the application.


👨‍💻 Project Team

Ahmed Khalid Mohamed

  • Lead Analog HW & USB Architect
  • 1.65V Virtual Ground & Attenuation Mathematics
  • High-Speed USB-CDC Binary Pipeline
  • Python Packet Decoding (dso_protocol.py)

Adel Alaa

  • Lead Display Driver & AI Engineer
  • ST7789 High-Speed Column-Redraw Renderer
  • KiCad PCB Routing & Hardware Decoupling
  • Live Machine Learning UI Integration

Bassel Adel

  • Lead ADC Firmware & PC UI Engineer
  • TIM2-Paced Hardware ADC Triggering
  • DMA Ping-Pong Buffering Architecture
  • Multithreaded PyQtGraph Desktop UI

Omar Abdel Nasser Omar

  • Lead DSP Firmware & Database Engineer
  • Peak-Hold & Interpolation DSP Algorithms
  • SQLite Waveform Database Logging
  • Random Forest AI Model Training

📝 License & Academic Disclaimer

This repository contains academic coursework and is provided as-is for educational purposes. Do not connect this device directly to mains AC voltage or high-voltage circuits without proper industrial isolation and safety equipment.

Parts

25
QtyValueFootprintReferences
4MountingHole_3.2mm_M3MountingHole:MountingHole_3.2mm_M3M1, M2, M3, M4
4SW_PushButton_Switch_THT:SW_PUSH_6mmSW1, SW2, SW3, SW4
310kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2, R4, R5
2100nFCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mmC3, C4
210uFCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC2, C5
2Conn_01x20Connector_PinHeader_2.54mm:PinHeader_1x20_P2.54mm_VerticalJ4, J5
12N3904Package_TO_SOT_THT:TO-92_Inline_WideQ2
12N3906Package_TO_SOT_THT:TO-92_Inline_WideQ1
133kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1
133pFCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mmC1
147RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR3
1Conn_01x08Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalJ2
1Conn_CoaxialConnector_Coaxial:BNC_TEConnectivity_1478035_HorizontalJ1
1NetTie_2NetTie:NetTie-2_SMD_Pad0.5mmNT1

Similar boards

  • 2 layers159.5 × 30 mmType f, the printed circuit board in 3D

    Type f

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    25 parts3kApache-2.0
  • 2 layers113.5 × 95.1 mmSweep high, the printed circuit board in 3D

    Sweep high

    davidphilipbarr/Sweep

    Sweep - a small promicro based keyboard inspired by the Ferris.

    25 parts2.1k
  • 2 layers58.4 × 114.3 mmPicoPedal, the printed circuit board in 3D

    PicoPedal

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    25 parts915
  • 2 layers54 × 15 mmXyp gpib, the printed circuit board in 3D

    Xyp gpib

    xyphro/UsbGpib

    Versatile, cheap and portable USB to GPIB converter (USBTMC class based)

    25 parts690MIT
  • 2 layers50 × 76 mmVoron 0, the printed circuit board in 3D

    Voron 0

    dennisss/dacha

    Monorepo for awesome tools/projects/libraries

    25 parts397Apache-2.0
  • 2 layers237.5 × 102.9 mmStorage, the printed circuit board in 3D

    Storage

    jes/scamp-cpu

    A homebrew 16-bit CPU with a homebrew Unix-like-ish operating system.

    25 parts301Unlicense
  • 2 layers43.3 × 21 mmNanoS3 Carrier, the printed circuit board in 3D

    NanoS3 Carrier

    UnexpectedMaker/esp32s3

    Assorted files for my ESP32-S3 development boards

    25 parts296

Questions

How big is the DSO Final PCB?

It measures 88 × 60 mm and has 2 copper layers, 1.6 mm thick.

What parts does the DSO Final use?

25 parts. 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 DSO Final KiCad files?

From the ahmedkamel382/STM32-Oscilloscope repository on GitHub, at the commit this page was made from: the board is Hardware Design/DSO_Final.kicad_pcb and its schematic Hardware Design/DSO_Final.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the DSO Final design in my own project?

Its repository states no licence, so its author keeps all rights: ask ahmedkamel382 before reusing the design.