The goal of this project was to transform an affordable and and simple single board computer, the pocket beagle, into a sophisticated, dedicated audio capture and analysis tool that would mimic the functionality of a digital stethoscope. Traditional stethoscopes are simple acoustic devices, but a digital solution would allow users to process, visualize, and log signals; therefore opening the doors for basic bioacoustics and environmental monitoring.
We needed a system that was portable, responsive, and self-contained. The solution combines a USB microphone (acting as the sound sensor), a simple push button for user interaction, and a compact OLED screen for real-time feedback.
How it works
The core of the project is a python script (OLED.py) that use the sounddevice library for non-blocking audio streaming. When the user presses and holds the physical button:
1. The BeagleBone GPIO pin detects the falling edge (button press).
2. An asynchronous audio stream starts, collecting raw sound data in chunks.
3. When the user releases the button (rising edge), the stream stops.
4. The captured audio data is processed by numpy, plotted using a non-GUI version of matplotlib (matplotlib.use('Agg')), and saved as a PNG image (waveform.png)
5. Finally the script uses the PIL/Pillow library to load, resize, and convert the PNG into 1-bit image, displaying the resulting waveform directly on the small SSD1306 OLED screen for immediate visual inspection.
This step creates a fully functional, easy-to-use device capable of instantly showing the "shape" of a captured sound.
Link to Github: https://github.com/dag18-pixel/EDES301/tree/main/project_01










Comments