Skip to the content
2 layersFinalCircuit Design, the printed circuit board in 3D

This repository contains all the work that I did for my final year project for the award of my Degree certificate. Contains all hardware designs, software designs and the system analysis

Copper layers
2
Thickness
1.6 mm
Parts
15
Nets
45
Pads
103
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 7 (file 20221018)
Created
4 Nov 2024
Updated
27 Jan 2026

Overview

FinalCircuit Design is an open-source printed circuit board by MURERWADANIEL1, from the MURERWADANIEL1/Final_Year_Project repository on GitHub. It is a 2-layer board with 15 parts on 45 nets.

It is built around the ESP32-WROOM-32, LM2596S-3.3 and MCP602-I/P. Its parts include 6 resistors, 4 capacitors and 3 ICs. It belongs with the ESP32 boards of this library.

Main components

3

README

README.md

Respiratory Sound Classification with ESP32 and Deep Learning

This repository contains the complete codebase for a final year project (2024/2025) focused on classifying respiratory diseases from audio sounds. The system uses an ESP32 microcontroller for data acquisition and a Convolutional Neural Network (CNN) for classification.

Overview

The project's goal is to create a non-invasive diagnostic aid by analyzing respiratory sounds (like coughs or breathing). An ESP32-based hardware device captures audio, streams it wirelessly via Bluetooth Low Energy (BLE) to a computer, where a Python application processes the sound and predicts a potential respiratory condition.

Key Features

  • Wireless Data Acquisition: An ESP32 microcontroller captures audio and streams it in real-time over BLE.
  • Signal Processing: Raw audio is converted into mel spectrograms, which are visual representations of the sound spectrum, suitable for image-based deep learning models.
  • Deep Learning Classification: A pre-trained TensorFlow/Keras CNN model classifies the spectrogram to identify conditions such as COPD, Pneumonia, Bronchiectasis, and more.
  • Instant Feedback: The system provides an immediate prediction with a confidence score.
  • Visualization: Generates and displays plots of the audio spectrogram and the model's prediction probabilities for clear interpretation.

Project Structure

This section details the role of each folder in the repository.

  • ./ (Root Directory)

    • The main project folder containing this README.md, .gitignore, and other top-level configuration files.
  • Project/

    • The primary container for all functional source code, organized into subdirectories for Python application logic, the ML model, and the C++ firmware.
  • Project/PythonCode/

    • Contains the Python scripts that form the core of the desktop application.
    • RecordingFile.py: Manages the asynchronous Bluetooth Low Energy (BLE) connection to the ESP32 using the bleak and asyncio libraries. It discovers the device, connects to the correct service, and streams audio data, saving it as a .wav file into the recordings/ directory.
    • Processing_Prediction.py: Handles the machine learning pipeline. It loads an audio file, preprocesses it into a mel spectrogram, feeds it to the trained model for inference, and visualizes the prediction results.
  • Project/Model/

    • Houses the machine learning model assets.
    • respiratory_cnn_model.h5: The final, trained Keras model file. This portable format contains the model's architecture, weights, and training configuration.
    • ModelNotebooks/: Contains Jupyter Notebooks (.ipynb files) used for the development and experimentation phase of the model. This is where data exploration, feature engineering, model architecture design, training, and evaluation take place.
  • Project/Cpp-Code/

    • Contains the firmware for the ESP32 microcontroller. This C++/Arduino code is responsible for initializing the microphone, sampling audio at the required rate, and transmitting the data wirelessly over BLE.
  • recordings/

    • The default output directory for audio files. When RecordingFile.py is run, the captured .wav audio clip is saved here, ready for processing.
  • Predicted_Spectrograms/

    • The default output directory for prediction artifacts. When Processing_Prediction.py runs, it saves the generated mel spectrogram image used for the prediction into this folder. This is useful for debugging, analysis, and record-keeping.
  • Circuit-Design/

    • Contains all hardware design files. This includes circuit schematics, PCB layouts, and simulation files created in software like Multisim, Proteus, or KiCad.

System Workflow

  1. Capture: The ESP32 device, equipped with a microphone, records respiratory sounds.
  2. Transmit: The RecordingFile.py script connects to the ESP32 (ESP32_ML_PROJECT) and receives the audio stream over BLE, saving it as a .wav file in the recordings/ directory.
  3. Process & Predict: The Processing_Prediction.py script automatically loads the latest recording.
  4. Feature Extraction: It converts the audio into a mel spectrogram.
  5. Inference: The spectrogram is fed into the trained CNN model, which outputs a prediction (e.g., "Healthy", "COPD") and a confidence score.
  6. Visualize: The results, including the spectrogram and class probabilities, are displayed in a plot. The predicted spectrogram is also saved for review.

Prerequisites

  • Python 3.8+
  • A computer with Bluetooth support.
  • The custom ESP32 device, programmed with the corresponding firmware and powered on.
  • Note on asyncio: This project uses asyncio for handling BLE communication. It is part of Python's standard library since version 3.4 and does not require a separate installation.
  • Required Python packages. Install them via pip:
    bash
    pip install tensorflow numpy librosa opencv-python matplotlib scikit-learn soundfile bleak jupyter

How to Use

  1. Clone the repository:
    bash
    git clone https://github.com/MURERWADANIEL1/Final_Year_Project 
    cd Final_Year_Project
  2. Record Audio: Power on the ESP32 device. Run the recording script to capture a 15-second audio clip.
    bash
    python Project/PythonCode/RecordingFile.py
  3. Run Prediction: Once the recording is saved, run the prediction script. It will automatically find and process the latest audio file.
    bash
    python Project/PythonCode/Processing_Prediction.py
    A window will pop up displaying the diagnostic results and visualizations.

Parts

15
QtyValueFootprintReferences
21kResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P2.54mm_VerticalR3, R6
21uCapacitor_THT:C_Disc_D3.0mm_W2.0mm_P2.50mmC1, C3
110kResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P2.54mm_VerticalR4
120kResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P2.54mm_VerticalR5
12uCapacitor_THT:C_Disc_D3.0mm_W2.0mm_P2.50mmC4
13.3kResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P25.40mm_HorizontalR1
13.3kResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P2.54mm_VerticalR2
18.2nCapacitor_THT:C_Disc_D3.0mm_W2.0mm_P2.50mmC2
1Battery_CellConnector_JST:JST_JWPF_B02B-JWPF-SK-R_1x02_P2.00mm_Vertical3,7
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U1
1LM2596S-3.3Package_TO_SOT_SMD:TO-263-5_TabPin3U3
1MCP602Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU2
1Microphone_CondenserSensor_Audio:CUI_CMC-4013-SMTMK1

Similar boards

  • 4 layers147.8 × 65 mmPrius gen2, the printed circuit board in 3D

    Prius gen2

    ksmola/PriusG2

    Inverter control board for Toyota Prius Gen 2 (XW20) inverter. Some of the schematics are based on Johannes Huebner's work found here. Running openinverter firmware.

    149 parts3
  • 2 layers54 × 48 mmAccess controller, the printed circuit board in 3D

    Access controller

    kallel-amina/IOT-access-control

    IoT-based access control system using ESP32, NFC/RFID, MQTT, backend services, web dashboard, and custom PCB.

    18 parts
  • 2 layers47.5 × 51 mmLinefollower pcb, the printed circuit board in 3D

    Linefollower pcb

    Krzysiek-Mistrz/electronics_robotics_designs

    elektronika

    27 parts
  • 2 layers101.8 × 52.5 mmMax2-dac, the printed circuit board in 3D

    Max2-dac

    dilshan/max2-audio-dac

    24-bit Stereo Audio DAC for Raspberry Pi

    158 parts61MIT
  • 2 layers308.7 × 241.8 mmOTTOtact, the printed circuit board in 3D

    OTTOtact

    cester-ino/OTTO-hardware

    those specs refer to the tactile buttons version, but a led backlight button version is in the works too.

    229 parts49GPL-3.0
  • 2 layers89.3 × 55 mmAmpcontrol f103, the printed circuit board in 3D

    Ampcontrol f103

    WiseLord/ampcontrol-f103

    Ampcontrol port on STM32F103CBT6

    71 parts40
  • 4 layers71.1 × 94 mmIpotcas, the printed circuit board in 3D

    Ipotcas

    SuperTails/ipotcas

    IP over Tin Can and String - Connecting to the internet over two tin cans and a piece of string

    75 parts12

Questions

What parts does the FinalCircuit Design use?

15 parts, built around the ESP32-WROOM-32, LM2596S-3.3 and MCP602-I/P. 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 FinalCircuit Design KiCad files?

From the MURERWADANIEL1/Final_Year_Project repository on GitHub, at the commit this page was made from: the board is Project/FinalCircuit Design/FinalCircuit Design.kicad_pcb and its schematic Project/FinalCircuit Design/FinalCircuit Design.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the FinalCircuit Design design in my own project?

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