Skip to main content
PicoScope 7 serial decoding, with the protocol decoder selection open over a decoded bus, available in India from GSAS Micro Systems

pyPicoSDK Tutorial: Automating PicoScope Measurements with Python

GSAS Engineering · · 8 min read

Why Automate Oscilloscope Measurements?

Manual oscilloscope operation, adjust settings, capture, read values, record in a spreadsheet, works for bench debugging. But for production testing, design characterization, and data acquisition, manual operation is too slow and introduces operator variability.

Pico Technology’s pyPicoSDK is a Python package that provides programmatic control of PicoScope oscilloscopes. Combined with Python’s NumPy, SciPy, and matplotlib ecosystem, it enables engineers to build automated measurement scripts that run unattended, produce consistent results, and integrate with existing data pipelines.

Prerequisites

Hardware

Any PicoScope supported by PicoSDK, this includes the PicoScope 2000, 3000, 4000, 5000, and 6000E series. Connect the PicoScope to your PC via USB.

Software

  1. PicoSDK: install from picotech.com/downloads. This installs the device drivers and shared libraries.
  2. Python 3.8+: standard Python installation
  3. pyPicoSDK: install via pip:
pip install pyPicoSDK

pyPicoSDK depends on NumPy, which is installed automatically.

Tutorial: Basic Voltage Measurement

Step 1: Connect and Open the Device

from pyPicoSDK import ps3000a  # Import the driver for your PicoScope model

## Open the first available PicoScope 3000A series device
scope = ps3000a.open_unit()
print(f"Connected to: {scope.info}")

The open_unit() function scans USB for connected PicoScope devices and returns a handle to the first one found. If you have multiple scopes connected, you can specify the serial number.

Step 2: Configure a Channel

## Configure Channel A
scope.set_channel(
    channel='A',
    enabled=True,
    coupling='DC',
    range_mv=5000,  # +/- 5V range
    offset_mv=0
)

## Disable unused channels to maximize sample rate
scope.set_channel(channel='B', enabled=False)
scope.set_channel(channel='C', enabled=False)
scope.set_channel(channel='D', enabled=False)

The range_mv parameter sets the input voltage range. Choose the smallest range that accommodates your signal, this maximizes ADC resolution.

Step 3: Configure Timebase and Capture

import numpy as np

## Set the sample interval and number of samples
sample_interval_ns = 100  # 100 ns between samples = 10 MS/s
num_samples = 10000       # 10,000 samples = 1 ms capture window

## Configure the timebase
scope.set_timebase(sample_interval_ns=sample_interval_ns, num_samples=num_samples)

## Set a simple trigger: rising edge on Channel A at 1V
scope.set_trigger(
    channel='A',
    threshold_mv=1000,
    direction='RISING',
    auto_trigger_ms=5000  # Auto-trigger after 5 seconds if no event
)

## Run a single capture
scope.run_block()

## Wait for the capture to complete
scope.wait_ready()

Step 4: Retrieve and Process Data

## Get the captured data as NumPy arrays
time_ns, voltage_mv = scope.get_data(channel='A')

## Convert to standard units
time_us = time_ns / 1000.0
voltage_v = voltage_mv / 1000.0

## Calculate basic statistics
v_mean = np.mean(voltage_v)
v_rms = np.sqrt(np.mean(voltage_v ** 2))
v_peak = np.max(voltage_v) - np.min(voltage_v)

print(f"Mean: {v_mean:.3f} V")
print(f"RMS:  {v_rms:.3f} V")
print(f"Peak-to-peak: {v_peak:.3f} V")

Step 5: Save and Close

## Save data to CSV
np.savetxt('measurement.csv',
           np.column_stack([time_us, voltage_v]),
           delimiter=',',
           header='Time_us, Voltage_V',
           comments='')

## Close the PicoScope connection
scope.close()

Production Test Application

For production testing, verifying that a power supply output meets specifications across a batch of units, the script expands to:

def test_power_supply(scope, unit_id):
    """Test a power supply unit and return pass/fail results."""
    scope.run_block()
    scope.wait_ready()
    time_ns, voltage_mv = scope.get_data(channel='A')
    voltage_v = voltage_mv / 1000.0

    v_mean = np.mean(voltage_v)
    v_ripple = np.max(voltage_v) - np.min(voltage_v)

    # Define pass/fail criteria
    results = {
        'unit_id': unit_id,
        'v_mean': v_mean,
        'v_ripple': v_ripple,
        'mean_pass': 4.95 <= v_mean <= 5.05,  # 5V +/- 1%
        'ripple_pass': v_ripple < 0.050,       # < 50 mV ripple
    }
    results['overall_pass'] = results['mean_pass'] and results['ripple_pass']
    return results

Call this function for each unit in the batch, collect results, and export a test report.

Data Acquisition Application

For long-duration data logging, monitoring a temperature sensor output over hours, use streaming mode:

## Streaming mode captures data continuously
scope.run_streaming(
    sample_interval_ns=1000000,  # 1 ms sample interval = 1 kS/s
    buffer_size=100000            # 100k sample buffer
)

## Process data in real-time using a callback
import time
all_data = []

for i in range(3600):  # Capture for 1 hour
    time.sleep(1)
    data = scope.get_streaming_data(channel='A')
    if data is not None:
        all_data.append(data)

Integration with Analysis Libraries

pyPicoSDK returns NumPy arrays, making integration simple with:

  • SciPy: Signal processing (filtering, FFT, peak detection)
  • matplotlib: Waveform and spectrum visualization
  • pandas: Data organization and export
  • scikit-learn: Statistical analysis and anomaly detection for production test data

Why Buy PicoScope from GSAS

GSAS Micro Systems is an authorized Pico Technology partner. Our engineers support pyPicoSDK integration for automated test systems, from script development guidance to full test station architecture.

  • PicoSDK and pyPicoSDK setup assistance
  • Demo units at offices in Bengaluru, Hyderabad, Chennai, Pune, Mumbai, and Delhi NCR
  • INR invoicing with GST-compliant documentation
  • Application engineering for automated test system design

Request a quote → · Book a demo →

Interested in Pico Technology tools?

Talk to our application engineers for personalized tool recommendations.

Stay in the Loop

Get monthly compliance updates, product insights, and engineering best practices delivered to your inbox.

Related Articles

Embedded engineering workstation in India, illustrating the debug, analysis and design steps where AI now runs inside the process, supported by GSAS
Industry Insights

AI Inside the Engineering Process: What Is Worth Automating, and What Still Needs an Engineer

Arm, SEGGER, Perforce and Siemens EDA have each put AI inside a step of the engineering process rather than on top of it: debug, remediation, design entry, inference on the part. GSAS sets out the position behind our coverage of each: which steps are now worth automating, and which keep a human because the cost of being wrong is a recall.

21 Sept 2026 · 11 min read
Embedded engineering bench in India, illustrating the hardware a developer can act on today, supported by GSAS
Technical Guides Arm

Arm's Agentic AI Push: What Indian Embedded Teams Can Actually Use Today

Arm has set out its platform strategy for the agentic era, putting inference everywhere it has compute. Indian embedded teams can start on that direction this quarter with the Cortex-M toolchain they already own: Helium, CMSIS-NN, Ethos-U and Vela, on boards you can order today.

13 Sept 2026 · 7 min read
Side by side comparison of a 10BASE-T1S multidrop mixing segment, one balanced pair with four nodes on short stubs and a termination at each end, against a point to point star of four separate links into switch ports, from GSAS Micro Systems India
Automotive Ethernet Automotive & Mobility

10BASE-T1S and PLCA: Multidrop Ethernet Explained

10BASE-T1S is the one member of the T1 single-pair Ethernet family that keeps a shared medium, and PLCA is the reconciliation sublayer that stops the nodes on it from colliding. This article covers what IEEE 802.3cg standardises, how the beacon and transmit opportunities schedule a cycle, the node count and segment length figures the OPEN Alliance interoperability test suite works to, and the failure modes that put a segment quietly back into contention while every link still looks up. Written by the GSAS Micro Systems engineering team in India for teams bringing up multidrop segments on the bench.

29 Aug 2026 · 12 min read