It’s possible to build a simple oscilloscope with an Arduino Uno, its standard serial port and the serial plotter. I wanted to see if I could take things to the next level and incorporate (the beginnings) of data capture and analysis, and be faster, too.
For this project you’re going to need a Raspberry Pi and an STM32 microcontroller. The Pi does the logging, and the STM32 acts as an ADC (Analogue to Digital Converter). You could use an off-the-shelf ADC module, but I happened to have an STM32 Blue Pill (STM32F103C8T6). You’ll also need the Arduino IDE with the stm32duino libraries installed.
Another good candidate would be an ESP32-WROOM in place of the STM32, but I have only provided code for the latter chip, not the former. You could also use an Arduino Uno/Nano, or some other flavour, but remember that these operate at 5V, and are therefore incompatible with the Pi unless you use logic level shifters, or maybe voltage dividers.
We use the SPI protocol to communicate, with the Pi acting as master, and the STM32 acting as slave. We can also use the Pi to generate tones to feed into the “capture card” (i.e the STM32).