A simple ESP32-based oscilloscope that reads analog voltage using the ESP32’s ADC and visualizes it in real time on a laptop using Python and Matplotlib.
- Real-time ADC voltage sampling
- Serial communication over USB
- Live oscilloscope-style waveform display
- Supports input range of 0–3.3V
- ESP32 development board
- USB cable
- Analog signal source (sensor / potentiometer)
- MicroPython firmware
- Python 3.x
- Required libraries:
pip install pyserial matplotlib
ESP32-Oscilloscope/ ├── main.py # ESP32 ADC reading & serial output ├── run_on_laptop.py # Live waveform plotting └── README.md
- The ESP32 uses its internal 12-bit ADC to sample an analog voltage signal from GPIO 34.
- The raw ADC value (0–4095) is converted into a voltage (0–3.3V).
- These voltage readings are continuously transmitted to a laptop over serial communication.
- A Python script on the laptop reads the serial data and plots voltage vs time in real time, functioning as a basic oscilloscope.
- Flash MicroPython firmware onto the ESP32.
- Upload the
main.pyfile to the ESP32 using Thonny or any MicroPython-compatible tool. - Connect the ESP32 to the laptop via USB.
- Edit the serial port name in
run_on_laptop.py(e.g.,COM7or/dev/ttyUSB0). - Run the plotting script:
python run_on_laptop.py
- Apply an analog signal (0–3.3V) to GPIO 34 to observe the waveform.
- Low sampling rate due to serial communication and Python-based plotting.
- Absence of trigger functionality for stable waveform capture.
- No frequency-domain analysis (FFT).
- Not suitable for high-frequency signal measurement.
- Input voltage limited to the ESP32 ADC range (~0–3.3V).
- Accuracy affected by ADC noise and limited resolution.
- Improve sampling rate using buffering and optimized data transfer.
- Implement trigger modes for consistent waveform display.
- Add FFT for frequency-domain signal analysis.
- Develop a GUI or web-based interface for better user interaction.
- Enable waveform data logging and export functionality.
- Support external ADCs for higher resolution and accuracy.