PICA: Python-based Instrument Control and Automation
PICA is a modular open-source software suite designed to automate advanced transport measurements. It supports resistance measurements covering 24 orders of magnitude (10-8 to 1016 Ω) and integrates with Keithley, Keysight, Lakeshore, and Quantum Design (PPMS) hardware using a multiprocessing, fault-tolerant architecture.
Preprint Status: Published on December 22, 2025.
🎉 v1.0.3 is now live!
The GUI has been refreshed with a new Latte theme — lighter, warmer, and easier on the eyes during long measurement sessions.
pip install --upgrade pica-suite
Demonstration: A screencast of the High Resistance IV module is available here .
Motivation & Key Features
Motivation
Researchers often face a binary choice: purchase expensive proprietary software or develop custom measurement scripts from scratch. PICA builds upon powerful libraries like PyVISA and PyMeasure to offer a turnkey application. It provides a ready-to-run graphical interface that abstracts the underlying control logic, allowing experimentalists to focus on data acquisition without extensive software development overhead.
Key Features
- Accessibility: A professional GUI dashboard (now with the Latte theme) for researchers without coding experience.
- Fault Tolerance: Control logic is isolated from the UI using multiprocessing to prevent crashes.
- Operational Transparency: Rejects the "black box" paradigm by exposing real-time, time-stamped command logs.
- Extensibility: Open-source framework for integrating new instrument drivers.
Design & Implementation
Hardware Abstraction
Utilizes PyVISA to abstract low-level communication (GPIB, USB, Ethernet). Implements strict initialization routines: connection verification via *IDN?, full instrument resets, and graceful shutdowns.
Process Isolation
Decouples the UI from instrumentation logic using Python's multiprocessing. This prevents UI freezes during long acquisitions and ensures hardware timeouts don't crash the main dashboard.
Data Integrity
A "write on acquisition" strategy ensures data is saved to CSV via pandas immediately after every point, preventing loss during power failures or system hangs.
PICA includes a testing suite using pytest and unittest.mock to simulate VISA resources, allowing logic verification without physical hardware.
🎨 What's New in v1.0.3: Latte Theme
The GUI has been redesigned with a lighter, warmer color palette to improve readability under typical laboratory lighting conditions and reduce eye strain during long measurement sessions.
Warm Palette
Lighter background and widget colors throughout.
High Contrast
Improved contrast for console log text and warnings.
Softer Plots
Optimized real-time plot backgrounds for scientific reporting.
Supported Hardware & Ranges
| Module | Instruments | Range |
|---|---|---|
| Ultra Low Resistance | K6221 + K2182 + LS350/340 | 10 nΩ - 100 MΩ |
| Standard Transport | K2400 + LS350/340 | 100 µΩ - 200 MΩ |
| High-Resistance | K6517B + LS350/340 | 1 Ω - 10 PΩ |
| Capacitance / LCR | Keysight E4980A + LS350/340 | 20 Hz - 2 MHz |
Available Modules
Understanding "Delta Mode"
"Delta Mode" refers specifically to a technique used by Keithley Models 6220 and 6221 in conjunction with the Model 2182/2182A Nanovoltmeter for ultra-low resistance measurements. It cancels thermal EMFs via an AC method. In PICA, "Ultra Low Resistance Measurements" is the general term used, while "Delta Mode" appears in specific Keithley-related modules.
Getting Started
Option 1: Install from PyPI (Recommended)
pip install pica-suite
Option 2: Install from Source
git clone https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation.git
cd PICA-Python-Instrument-Control-and-Automation
2. Create Virtual Environment & Install
# Create and activate a virtual environment
python -m venv venv
venv\Scripts\activate
# Install the package and its dependencies
pip install .
To update PICA to the latest version, run the following command in the project directory:
pip install --upgrade .
If you are already in your virtual environment and want to force Python to reinstall the package (overwriting the old one), run this in your root project folder:
pip install --force-reinstall .
Note: Ensure you have the NI-VISA drivers installed on your host machine to allow PyVISA to communicate with the hardware.
Running the Software
1. Graphical Launcher (Recommended)
The central dashboard for accessing all modules, the plotter, and the scanner.
pica-gui
You can also run any of the individual GUI measurement modules independently. This is useful for quickly accessing a specific measurement without opening the main launcher. To do this, simply run the Python script for the desired module.
For example:
python pica/keithley/k6517b/High_Resistance/IV_K6517B_GUI.py
2. Command Line Interface (CLI)
For headless operation (e.g., Raspberry Pi).
pica-cli
Important
Template Scripts: The instrument control modules (CLI's) provided are designed as template scripts. Users are expected to modify these scripts programmatically to adapt them to their specific experimental requirements and custom workflows. They are also excellent for developing custom measurement protocols, sequences, and for learning instrument automation. These scripts are typically named with an 'Instrument_Control' suffix to denote their programmatic nature. This approach ensures maximum flexibility and customization for advanced research applications.
Note
Legacy CLI Notice: The PICA CLI (pica-cli) is retained to support legacy headless workflows. While fully functional for specific protocols, this interface is less frequently maintained and may not support recent features available in the GUI.
We strongly recommend new users utilize the PICA GUI for the most complete and supported experience.
System Requirements & Compatibility
Supported Platform: Windows 10 / 11 (x86_64)
Windows Only
PICA is validated exclusively for Windows environments. Linux and macOS are not currently supported due to dependencies on Windows-specific GUI libraries and font rendering.
A VISA Backend is Required
PyVISA is a wrapper, not a driver. You must install a backend:
- NI-VISA: The industry standard from National Instruments.
- PyVISA-py: A pure Python backend (installed as a fallback).
Experimental Linux Instructions
Warning
Linux support is currently experimental. You will likely encounter UI-related issues.
If you wish to experiment on Linux:
- Install Tkinter:
sudo apt-get install python3-tk(for Debian/Ubuntu). - Virtual Environment: Use
source venv/bin/activateto activate. - Installation: Follow the standard source installation steps.
Running Tests
To run the test suite locally, first install the development dependencies:
pip install -r requirements-dev.txt
Then, you can run the tests:
python -B -m pytest -p no:cacheprovider
How to Check Coverage Locally
To see the coverage percentage on your local machine, run this command instead:
python -B -m pytest --cov=pica --cov-report=term-missing -p no:cacheprovider
Project History
PICA evolved from simple offline scripts in 2022 to a full-stack automated suite.
- v1.0.3 (Latest): GUI refreshed with the Latte theme. Available on PyPI.
- v1.0.0 (Initial Public Release): Version numbering has been reset from legacy development builds (v17.0) to v1.0.0 to standardize the package for public distribution and citation.
- v17.0: Professional directory restructuring, Semantic Versioning, and documentation overhaul.
- v15.0: JOSS submission preparation, CI/CD integration.
- v13.0: Transition to Multiprocessing and standardized GUI themes.
2022 - 2023: Inception & Prototyping
- 2023 (Migration): Moved from offline lab systems to GitHub; organized scripts into instrument modules (Keithley/Lake Shore).
- 2022 (Origins): Started in an air-gapped lab with
pyvisascripts replacing manual logging.- Concept: Proposed by Dr. Sudip Mukherjee to automate characterization workflows.
- Prototypes: Built alongside hardware upgrades and cryogenic probe work at UGC-DAE CSR.
Background:
For a detailed chronological log, see CHANGELOG.md.
Resources & Documentation
- Full Documentation: Comprehensive API reference and user guides are available on Read the Docs.
- User Manual: Detailed physics and usage guides are available in the Official User Manual.
- Source Files: Access the documentation source via the GitHub Markdown file.
- Instrument Manuals: A list of instrument manuals is available in docs/Instruments_Manuals_Lists.md.
License
This project is licensed under the MIT License - see the LICENSE file for details.
How to Cite This Software
If you use this software in your research, please cite it:
Scientific Manuscript: The associated research paper pre-print is available on OSF Project, Academia.edu, or via our GitHub repository (PDF).
For more information, visit the Zenodo Archive.
@software{Deshmukh_PICA_2026,
author = {Deshmukh, Prathamesh Keshao and Mukherjee, Sudip},
title = {{PICA: Advanced High-Precision Transport Measurement Automation with Python}},
month = jan,
day = 26,
year = 2026,
publisher = {Zenodo},
version = {1.0.3},
doi = {10.5281/zenodo.18377217},
url = {https://doi.org/10.5281/zenodo.18377217}
}