Skip to content

0xcloudzy/esp32-oscilloscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

ESP32 Oscilloscope

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.


Features

  • Real-time ADC voltage sampling
  • Serial communication over USB
  • Live oscilloscope-style waveform display
  • Supports input range of 0–3.3V

Hardware Requirements

  • ESP32 development board
  • USB cable
  • Analog signal source (sensor / potentiometer)

Software Requirements

ESP32

  • MicroPython firmware

Laptop

  • Python 3.x
  • Required libraries:
    pip install pyserial matplotlib
    

Project Structure

ESP32-Oscilloscope/ ├── main.py # ESP32 ADC reading & serial output ├── run_on_laptop.py # Live waveform plotting └── README.md


Working Principle

  • 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.

How to Run

  1. Flash MicroPython firmware onto the ESP32.
  2. Upload the main.py file to the ESP32 using Thonny or any MicroPython-compatible tool.
  3. Connect the ESP32 to the laptop via USB.
  4. Edit the serial port name in run_on_laptop.py (e.g., COM7 or /dev/ttyUSB0).
  5. Run the plotting script:
    python run_on_laptop.py
  6. Apply an analog signal (0–3.3V) to GPIO 34 to observe the waveform.

Limitations

  • 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.

Future Scope

  • 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.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages