Skip to main content

Python interface library for Undalogic miniSMU devices

Project description

miniSMU Python Interface

Python interface library for Undalogic miniSMU devices. Supports both USB and network connections for controlling and measuring with miniSMU devices.

Installation

pip install minismu_py

Quick Start

from smu_interface import SMU, ConnectionType

# Connect to SMU via USB
smu = SMU(ConnectionType.USB, port="/dev/ttyACM0")

# Basic device operations
print(smu.get_identity())

# Configure channel 1
channel = 1
smu.set_mode(channel, "FVMI")  # Set to FVMI (Force Voltage, Measure Current) mode
smu.enable_channel(channel)
smu.set_voltage(channel, 3.3)  # Set to 3.3V

# Take measurements
voltage, current = smu.measure_voltage_and_current(channel) 
print(f"Voltage: {voltage}V, Current: {current}A")

# Close connection
smu.close()

Examples

The library includes several example scripts demonstrating different use cases:

Basic Usage (examples/basic_usage.py)

  • Basic device connection and configuration
  • Simple voltage and current measurements
  • Temperature monitoring
  • Channel enable/disable operations

USB IV Sweep (examples/usb_iv_sweep.py)

  • Performs a voltage sweep from -1V to 0.7V
  • Measures current at each voltage point
  • Saves results to CSV file
  • Includes progress bar for monitoring
  • Proper error handling and cleanup

WiFi IV Sweep (examples/wifi_iv_sweep.py)

  • Similar functionality to USB IV sweep but over network connection
  • Demonstrates network-based device control
  • Includes connection management and error handling

Streaming Example (examples/streaming_example.py)

  • Demonstrates high-speed data streaming capabilities
  • Configurable sample rate and duration
  • Real-time progress monitoring with voltage and current display
  • Automatic data collection and CSV export
  • Statistical analysis of collected data
  • Device time synchronization for accurate timestamps
  • Proper resource cleanup and error handling

Available Functions

Connection Management

  • SMU(connection_type, port, host, tcp_port) - Initialize SMU connection
  • close() - Close the connection
  • get_identity() - Get device identification
  • reset() - Reset the device

Source and Measurement

  • set_voltage(channel, voltage) - Set voltage for specified channel
  • set_current(channel, current) - Set current for specified channel
  • measure_voltage(channel) - Measure voltage on specified channel
  • measure_current(channel) - Measure current on specified channel
  • measure_voltage_and_current(channel) - Measure both voltage and current

Channel Configuration

  • enable_channel(channel) - Enable specified channel
  • disable_channel(channel) - Disable specified channel
  • set_voltage_range(channel, range_type) - Set voltage range (AUTO/LOW/HIGH)
  • set_mode(channel, mode) - Set channel mode (FIMV/FVMI)

Data Streaming

  • start_streaming(channel) - Start data streaming
  • stop_streaming(channel) - Stop data streaming
  • set_sample_rate(channel, rate) - Set sample rate in Hz
  • read_streaming_data() - Read streaming data packet (channel, timestamp, voltage, current)

System Configuration

  • set_led_brightness(brightness) - Set LED brightness (0-100)
  • get_led_brightness() - Get current LED brightness
  • get_temperatures() - Get system temperatures (ADC, Channel 1, Channel 2)
  • set_time(timestamp) - Set device's internal clock (Unix timestamp in milliseconds)

WiFi Configuration

  • wifi_scan() - Scan for available WiFi networks
  • get_wifi_status() - Get current WiFi status
  • set_wifi_credentials(ssid, password) - Set WiFi credentials
  • enable_wifi() - Enable WiFi
  • disable_wifi() - Disable WiFi

Features

  • USB and network connection support
  • Comprehensive measurement and source control
  • Data streaming capabilities with synchronized timestamps
  • System configuration
  • Temperature monitoring
  • WiFi configuration and management
  • Context manager support for proper resource cleanup
  • Progress tracking for long operations
  • CSV export for measurement data

Error Handling

The library includes proper error handling through the SMUException class. All operations that communicate with the device may raise this exception if there are connection or communication issues.

Requirements

  • Python 3.6 or higher
  • pyserial for USB connections
  • tqdm for progress bars (optional, used in examples)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minismu_py-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minismu_py-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file minismu_py-0.1.0.tar.gz.

File metadata

  • Download URL: minismu_py-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for minismu_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 176daddacac100295439fc913db46f08c0c5df35e02629fdff0fa18953889bcc
MD5 4216c43442d1c4fe321340ecef586d7e
BLAKE2b-256 ffe4a51e2b958203155748836851d5bf6bc73fda951fa7c84073d1610a9866ab

See more details on using hashes here.

File details

Details for the file minismu_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: minismu_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for minismu_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a79dff06ee09ec69e58a950a7d626537b2602603a8822339c764904043009064
MD5 5843f9d8957ac1cb4c2488cbb9e00752
BLAKE2b-256 bef9a2e32ee73b1ea88665dbb36ad4b1b066bc6a9873911483a3b1cb5b299c05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page