From a3bc2be730d2d5cb09956f96ab2bf5d799779208 Mon Sep 17 00:00:00 2001 From: grecubog2001 Date: Wed, 29 Apr 2026 11:33:27 +0100 Subject: [PATCH 1/3] Create index.md --- .../project/2026/bogdan.grecu2604/index.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md diff --git a/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md b/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md new file mode 100644 index 00000000000..30d9cf28eeb --- /dev/null +++ b/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md @@ -0,0 +1,66 @@ +# Acoustic Material Sorter +A smart environmental sorting device that classifies materials (glass, plastic, metal) by analyzing the acoustic signature of their impact using digital signal processing and machine learning. + +:::info + +**Author**: Bogdan Octavian Grecu \ +**GitHub Project Link**: [https://github.com/UPB-PMRust-Students/acs-project-2026-grecubog2001](https://github.com/UPB-PMRust-Students/acs-project-2026-grecubog2001) + +::: +## Description + +The Acoustic Material Sorter is a smart classification system that differentiates objects based on the sound they make when dropped. Items slide down a custom-built ramp and hit a hard impact plate. A piezoelectric contact microphone taped beneath the plate captures the raw audio waveform of the impact. The system rapidly processes this audio burst, extracting frequency data to feed into a machine-learning model that predicts whether the material is Glass, Plastic, or Metal. + +The predicted material and the model's confidence percentage are displayed on a 1602 I2C LCD screen. If the confidence threshold is met, an SG90 micro servo automatically rotates a funnel to guide the item into the correct bin. If the confidence is too low, the system pauses and asks a human to manually classify the item by pressing one of four buttons (Glass, Plastic, Metal, or Disposal). + +## Motivation + +Traditional optical sorting machines used in recycling facilities are expensive, highly complex, and often struggle with transparent materials (like clear glass vs. clear plastic) or dirty surfaces. I chose this project to explore a cost-effective, robust alternative: acoustic sorting. + +Every material has a unique resonant frequency and acoustic "fingerprint." By relying on sound rather than sight, we bypass the limitations of optical sensors. Additionally, this project serves as an excellent sandbox for learning about edge computing, as it perfectly blends hardware actuation, digital signal processing (DSP), and embedded machine learning all in one integrated Rust-based environment. + +## Architecture + +- Acoustic Acquisition Subsystem: A piezoelectric disc acts as a contact microphone, triggering an ADC capture on the microcontroller the exact moment an impact occurs, recording a rapid, 1-second burst of raw audio data. + +- Signal Processing Engine: The raw time-domain audio data is transformed into the frequency domain (a spectrogram representation) using the rustfft library, extracting the distinct acoustic features of the drop. + +- Classification Engine: The extracted frequency features are fed into a trained machine learning model (powered by the smartcore library) which outputs a prediction and a confidence score. + +- Human-in-the-loop Override: A state machine checks the confidence score. If it falls below the required threshold, automation halts, and the system waits for manual input from a 4-button array to categorize or dispose of the tricky item. + +- Display System: A 1602 I2C character LCD provides real-time feedback, showing the active prediction (e.g., "Metal - 94%") and prompting the user when manual intervention is required. + +- Actuation System: A PWM-driven SG90 micro servo is attached to a guiding funnel. It physically rotates to the appropriate angle to drop the item into the Glass, Plastic, or Metal bin. + +## Log + +## Hardware + +The project utilizes a Raspberry Pi Pico 2 as the main microcontroller, leveraging its powerful RP2350 architecture to handle digital signal processing and machine learning inference at the edge. A piezoelectric disc is taped to the impact plate and connected to one of the Pico's ADC pins to measure the vibration and sound of the falling object. A 1602 character LCD module, connected via the I2C interface, serves as the user interface to display the classification results and confidence levels. An SG90 micro servo, controlled via a PWM pin, mechanically routes the objects into their respective physical bins. Four momentary push buttons are connected to digital GPIO pins with internal pull-up resistors to facilitate manual human-in-the-loop overrides. All electronic components are interfaced using a breadboard and standard jumper wires, while the mechanical ramp and sorting bins are constructed from 3D-printed and cardboard materials. + +### Schematics + + + +### Bill of Materials +| Device | Usage | Price | +|--------|--------|-------| +|Raspberry Pi Pico 2|"Main microcontroller board handling DSP, ML, and hardware control"| - +|1602 I2C LCD|Displays the predicted material type and ML confidence score|- +|Piezoelectric Disc|Contact microphone used to capture the impact sound|- +|SG90 Micro Servo|Actuator that rotates the funnel to sort items into bins|- +|Push Buttons (x4)|Input for manual material classification and disposal|- +|Breadboard & Wires|Prototyping connections|- +|Ramp & Impact Plate|Physical structure for dropping and funneling items|- + +## Software + +| Library / Interface | Description | Usage | +|---------------------|-------------|-------| +|rustfft|High-performance Fast Fourier Transform library|Used to convert the raw time-domain audio from the piezo sensor into frequency-domain data for feature extraction. +|smartcore|Machine learning library for Rust|"Used to train and run the classification model (e.g., Random Forest) that predicts the material type based on the acoustic signature." + + + +[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/yNS7YZsE) From 0c66b4e97af6690a82c51a16b435494a2f911e5c Mon Sep 17 00:00:00 2001 From: grecubog2001 Date: Sun, 24 May 2026 16:00:52 +0100 Subject: [PATCH 2/3] Enhance project documentation with new features and details Added details about data acquisition and inference phases, updated hardware and software sections, and improved clarity on the actuation system. --- .../project/2026/bogdan.grecu2604/index.md | 56 +++++++++++++------ 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md b/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md index 30d9cf28eeb..b200f6e1dd5 100644 --- a/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md +++ b/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md @@ -11,7 +11,15 @@ A smart environmental sorting device that classifies materials (glass, plastic, The Acoustic Material Sorter is a smart classification system that differentiates objects based on the sound they make when dropped. Items slide down a custom-built ramp and hit a hard impact plate. A piezoelectric contact microphone taped beneath the plate captures the raw audio waveform of the impact. The system rapidly processes this audio burst, extracting frequency data to feed into a machine-learning model that predicts whether the material is Glass, Plastic, or Metal. -The predicted material and the model's confidence percentage are displayed on a 1602 I2C LCD screen. If the confidence threshold is met, an SG90 micro servo automatically rotates a funnel to guide the item into the correct bin. If the confidence is too low, the system pauses and asks a human to manually classify the item by pressing one of four buttons (Glass, Plastic, Metal, or Disposal). +A master switch determines whether we are in the data aquisition phase or the inference phase. + +If we are in the data aquisition phase, we collect impact data from our materials. In order to manually label the material, we use a 4x4 keypad. + +If we are in the inference phase, the system checks whether a model exists in our root folder. + +If it doesn't, then it trains the model from scratch using our recorded data. The display shows the iteration number and the loss. + +If it does, or after it trains the model, it waits for impact data, then, using the model, it classifies the material. The predicted material is displayed on the screen. Several SG90 micro servo automatically move a sequence of gates to guide the item into the correct bin. ## Motivation @@ -27,39 +35,55 @@ Every material has a unique resonant frequency and acoustic "fingerprint." By re - Classification Engine: The extracted frequency features are fed into a trained machine learning model (powered by the smartcore library) which outputs a prediction and a confidence score. -- Human-in-the-loop Override: A state machine checks the confidence score. If it falls below the required threshold, automation halts, and the system waits for manual input from a 4-button array to categorize or dispose of the tricky item. +- Display System: A 1602 I2C character LCD provides real-time feedback, showing the active prediction (e.g., "Metal"). -- Display System: A 1602 I2C character LCD provides real-time feedback, showing the active prediction (e.g., "Metal - 94%") and prompting the user when manual intervention is required. - -- Actuation System: A PWM-driven SG90 micro servo is attached to a guiding funnel. It physically rotates to the appropriate angle to drop the item into the Glass, Plastic, or Metal bin. +- Actuation System: Several SG90 micro servos are attached to a sequence of gates. This physically directs the material to the corresponding collection bin (Glass, Plastic, or Metal). ## Log ## Hardware -The project utilizes a Raspberry Pi Pico 2 as the main microcontroller, leveraging its powerful RP2350 architecture to handle digital signal processing and machine learning inference at the edge. A piezoelectric disc is taped to the impact plate and connected to one of the Pico's ADC pins to measure the vibration and sound of the falling object. A 1602 character LCD module, connected via the I2C interface, serves as the user interface to display the classification results and confidence levels. An SG90 micro servo, controlled via a PWM pin, mechanically routes the objects into their respective physical bins. Four momentary push buttons are connected to digital GPIO pins with internal pull-up resistors to facilitate manual human-in-the-loop overrides. All electronic components are interfaced using a breadboard and standard jumper wires, while the mechanical ramp and sorting bins are constructed from 3D-printed and cardboard materials. +The project utilizes a Raspberry Pi Pico 2 as the main microcontroller, leveraging its powerful RP2350 architecture to handle digital signal processing and machine learning inference at the edge. A piezoelectric disc is taped to the impact plate and connected to one of the Pico's ADC pins to measure the vibration and sound of the falling object. A 1602 character LCD module, connected via the I2C interface, serves as the user interface to display the classification results and confidence levels. 4 SG90 micro servos, each controlled via a PWM pin, mechanically routes the objects into their respective bins. A 4x4 numpad facilitate manual data labelling. All electronic components are interfaced using a breadboard and standard jumper wires. + +image +image +image + ### Schematics +Screenshot 2026-05-24 151729 ### Bill of Materials | Device | Usage | Price | |--------|--------|-------| -|Raspberry Pi Pico 2|"Main microcontroller board handling DSP, ML, and hardware control"| - -|1602 I2C LCD|Displays the predicted material type and ML confidence score|- -|Piezoelectric Disc|Contact microphone used to capture the impact sound|- -|SG90 Micro Servo|Actuator that rotates the funnel to sort items into bins|- -|Push Buttons (x4)|Input for manual material classification and disposal|- -|Breadboard & Wires|Prototyping connections|- -|Ramp & Impact Plate|Physical structure for dropping and funneling items|- +|Raspberry Pi Pico 2|"Main microcontroller board handling DSP, ML, and hardware control"| 270 ron (kit) +|1602 I2C LCD|Displays the predicted material type and ML confidence score| included in kit +|Piezoelectric Disc|Contact microphone used to capture the impact sound| 25 ron +|4x SG90 Micro Servo|Actuator that rotates the funnel to sort items into bins| 35 ron +|4x4 keypad|Input for manual material classification and disposal| included in kit +|Breadboard & Wires|Prototyping connections| included in kit +|Ramp & Impact Plate|Physical structure for dropping and funneling items| 100 ron ## Software | Library / Interface | Description | Usage | -|---------------------|-------------|-------| -|rustfft|High-performance Fast Fourier Transform library|Used to convert the raw time-domain audio from the piezo sensor into frequency-domain data for feature extraction. -|smartcore|Machine learning library for Rust|"Used to train and run the classification model (e.g., Random Forest) that predicts the material type based on the acoustic signature." +| --- | --- | --- | +| `cortex-m` | ARM Cortex-M support library for low-level processor access. | Access core peripherals and use `Peripherals::take()` in `src/main.rs`. | +| `cortex-m-rt` | Runtime support crate for Cortex-M microcontrollers. | Provides the entry point and startup/runtime support for the embedded firmware. | +| `embedded-hal` | Hardware abstraction traits for embedded devices. | Provides `InputPin` and `OutputPin` traits used by keypad, LED, and GPIO logic. | +| `embedded-hal-0-2` | Compatibility adapter for older embedded-hal v0.2 traits. | Provides `PwmPin` and `adc::OneShot` traits used by servo and ADC code. | +| `defmt` | Efficient logging framework for `no_std` embedded Rust. | Used for debug logging in firmware and tests. | +| `defmt-rtt` | RTT transport layer for `defmt` logging. | Enables runtime debug output over RTT during development. | +| `usb-device` | USB device stack for embedded targets. | Handles USB polling and device management for serial communication. | +| `usbd-serial` | USB CDC serial implementation. | Provides the virtual serial port used to send and receive waveform and control messages. | +| `heapless` | Fixed-capacity data structures for `no_std` environments. | Uses `heapless::String` for LCD text formatting and serial line buffering. | +| `lcd-lcm1602-i2c` | I2C driver for 16x2 LCD modules. | Drives the display used for mode prompts, instructions, and inference results. | +| `micromath` | Math helpers for `no_std` floating-point computation. | Provides `F32Ext` for CNN inference and training math operations. | +| `panic-probe` | Panic handler that reports panic information via probe. | Used on ARM targets to surface panic messages during development. | +| `rp235x-hal` | HAL for RP2350-based Raspberry Pi Pico 2 boards. | Provides GPIO, ADC, PWM, I2C, timer, and USB support for the RP2350 target. | + From dcbb9047fca9c963b3f4772798aa1febdc851077 Mon Sep 17 00:00:00 2001 From: grecubog2001 Date: Sun, 24 May 2026 19:49:33 +0100 Subject: [PATCH 3/3] Clean up index.md by removing extra lines Removed unnecessary blank lines and a review assignment button. --- .../version-acs_cc/project/2026/bogdan.grecu2604/index.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md b/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md index b200f6e1dd5..ecf2e74be93 100644 --- a/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md +++ b/website/versioned_docs/version-acs_cc/project/2026/bogdan.grecu2604/index.md @@ -84,7 +84,3 @@ The project utilizes a Raspberry Pi Pico 2 as the main microcontroller, leveragi | `panic-probe` | Panic handler that reports panic information via probe. | Used on ARM targets to surface panic messages during development. | | `rp235x-hal` | HAL for RP2350-based Raspberry Pi Pico 2 boards. | Provides GPIO, ADC, PWM, I2C, timer, and USB support for the RP2350 target. | - - - -[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/yNS7YZsE)