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 connectionclose()- Close the connectionget_identity()- Get device identificationreset()- Reset the device
Source and Measurement
set_voltage(channel, voltage)- Set voltage for specified channelset_current(channel, current)- Set current for specified channelmeasure_voltage(channel)- Measure voltage on specified channelmeasure_current(channel)- Measure current on specified channelmeasure_voltage_and_current(channel)- Measure both voltage and current
Channel Configuration
enable_channel(channel)- Enable specified channeldisable_channel(channel)- Disable specified channelset_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 streamingstop_streaming(channel)- Stop data streamingset_sample_rate(channel, rate)- Set sample rate in Hzread_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 brightnessget_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 networksget_wifi_status()- Get current WiFi statusset_wifi_credentials(ssid, password)- Set WiFi credentialsenable_wifi()- Enable WiFidisable_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
pyserialfor USB connectionstqdmfor 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
176daddacac100295439fc913db46f08c0c5df35e02629fdff0fa18953889bcc
|
|
| MD5 |
4216c43442d1c4fe321340ecef586d7e
|
|
| BLAKE2b-256 |
ffe4a51e2b958203155748836851d5bf6bc73fda951fa7c84073d1610a9866ab
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a79dff06ee09ec69e58a950a7d626537b2602603a8822339c764904043009064
|
|
| MD5 |
5843f9d8957ac1cb4c2488cbb9e00752
|
|
| BLAKE2b-256 |
bef9a2e32ee73b1ea88665dbb36ad4b1b066bc6a9873911483a3b1cb5b299c05
|