Real-Time 1 MSPS PYNQ Oscilloscope
A high-performance, interactive, dark-mode real-time Oscilloscope software stack running natively on PYNQ Linux platforms.
Combines high-speed FPGA data acquisition (1 MSPS XADC streaming via AXI DMA) with an active analog wave generator (Digilent Analog Discovery 3 via pydwf) into an interactive Plotly + IPywidgets dashboard.
🏛 System Architecture
This software repository operates as a lightweight client. It automatically fetches its compiled hardware overlay binaries (pynq_z2.bit and pynq_z2.hwh) from the pinned release v1.0.2 of the hw-xadc-dma-overlays repository.
[ Analog Discovery 3 (W1) ] ──(Analog Jumper Wire)──> [ PYNQ-Z2 Header (A0) ]
│ │
(pydwf SDK) (AXI DMA 1 MSPS)
│ │
▼ ▼
[ AD3SignalGenerator ] <──(pynq_oscilloscope)──> [ StreamingXADC DMA Driver ]
│
▼
[ OscilloscopeDashboard ]
(Interactive Dark-Mode Plotly UI Canvas)
🔌 Hardware Setup & Prerequisites
Before running the application, make sure your hardware is connected according to these physical specifications:
- USB Port Connection:
- Plug the Analog Discovery 3 USB cable into the large rectangular USB HOST port on the PYNQ-Z2 board (next to the Ethernet port).
- USB Cable Quality:
- Use a high-quality Data + Power USB-C cable. Standard charging-only cables omit data lines.
- Power Supply:
- Power the AD3 with an external 5V auxiliary power supply to prevent board brownouts under load.
- Signal Wire:
- Connect a jumper wire from Wavegen 1 (W1) on the AD3 to Analog Input A0 on the PYNQ-Z2 shield header. Connect AD3 GND to PYNQ GND.
🚀 Quick Start & Installation
1. Install Package from PyPI
Connect to your PYNQ board via SSH or Jupyter Terminal and run:
pip install pynq-oscilloscope
2. Copy Example Notebooks to Jupyter Workspace
To copy this project's notebooks into a dedicated subfolder (/home/xilinx/jupyter_notebooks/pynq_oscilloscope/) without touching other installed PYNQ packages, run:
pynq-oscilloscope-get-notebooks
Alternatively, inside a Python or Jupyter session:
from pynq_oscilloscope import copy_notebooks
copy_notebooks()
3. Install Digilent AD3 Drivers
Run the automated environment checker inside Python or Jupyter:
from pynq_oscilloscope import install_ad3_drivers
# Automatically downloads Digilent Adept + WaveForms .deb packages and sets USB permissions
install_ad3_drivers()
🧪 Isolated Virtual Environment Setup Guide (Optional)
If you want to test or run pynq-oscilloscope inside an isolated Python virtual environment on your PYNQ board:
# 1. Create a virtual environment with system site-packages enabled
python3 -m venv --system-site-packages /home/xilinx/clean_test_env
source /home/xilinx/clean_test_env/bin/activate
# 2. Link PYNQ system driver site-packages
echo "/usr/local/share/pynq-venv/lib/python3.10/site-packages" > /home/xilinx/clean_test_env/lib/python3.10/site-packages/pynq_system.pth
# 3. Install pynq-oscilloscope from PyPI
pip install --no-deps -I pynq-oscilloscope
# 4. Copy notebooks & register Jupyter kernel
pynq-oscilloscope-get-notebooks
pip install ipykernel
python -m ipykernel install --user --name=clean_test_env --display-name "Python 3 (Clean Test Env)"
In Jupyter Notebook:
- Navigate to
pynq_oscilloscope/and open03_oscilloscope_dashboard.ipynb. - Click Kernel $\rightarrow$ Change kernel $\rightarrow$
Python 3 (Clean Test Env). - Run the cells!
📓 Notebook Suite
This repository includes three progressive interactive notebooks inside the notebooks/ directory:
| Notebook | Description | Key Modules Used |
|---|---|---|
01_ad3_getting_started.ipynb |
Verifies Digilent drivers and generates analog signals (Sine, Square, Triangle) in a background thread. | AD3SignalGenerator, check_usb_permissions |
02_xadc_getting_started.ipynb |
Automatically fetches v1.0.2 overlay and captures 1 MSPS analog streams direct to DDR memory. |
HardwareLoader, StreamingXADC |
03_oscilloscope_dashboard.ipynb |
Main Application: Deploys the complete interactive closed-loop Plotly Oscilloscope with triggers and auto-ranging. | OscilloscopeDashboard |
💻 Python Package Usage Example
You can deploy the complete Oscilloscope Dashboard in 3 lines of Python code:
from pynq_oscilloscope import HardwareLoader, OscilloscopeDashboard
# 1. Fetch board overlay (v1.0.2) from GitHub Releases
overlay = HardwareLoader.load_overlay()
# 2. Instantiate and render interactive Oscilloscope
app = OscilloscopeDashboard(overlay=overlay)
app.display()
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for pynq-oscilloscope 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pynq_oscilloscope-1.0.1.tar.gz | 17.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pynq_oscilloscope-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.0 kB
Release files / pynq_oscilloscope-1.0.1.tar.gz
| Download URL | pynq_oscilloscope-1.0.1.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d3f37be0954213010ab3e16ddf2215bc8217973e56ecb1e0f5f11b8a4339b46
|
|
BLAKE2b-256 checksum How to use checksums |
6b10cd8b217697ad8be5cc4fdcaa78c8eb150fc12725a482271598306cd09de5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / pynq_oscilloscope-1.0.1-py3-none-any.whl
| Download URL | pynq_oscilloscope-1.0.1-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f12fe709f85d6b732cff92e95a611f9a2e7bca732358b23b2abb85b55cbbfa1
|
|
BLAKE2b-256 checksum How to use checksums |
3cc6aca9b1d99e843f2f6c36a7f40c0fd82b25eb183811b0ca73dca83fe0d778
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|