A modular software suite for automating laboratory measurements in physics research.
PICA (Python-based Instrument Control and Automation) is a software suite designed to provide a robust framework for automating laboratory instruments in materials science and condensed matter physics research. The suite features a central graphical user interface (GUI), the PICA Launcher, which serves as a dashboard for managing and executing a variety of characterization experiments.
A key architectural feature is the use of isolated process execution for each measurement module via Python's multiprocessing library. This ensures high stability, prevents inter-script conflicts, and allows the main dashboard to remain responsive during long-running experiments.
β οΈ Important Note on Testing & ValidationThis software is actively used for daily laboratory measurements and has been verified on physical instruments (Keithley, Lakeshore, etc.).
Recently, significant updates were made to the codebase to integrate Automated CI/CD Testing (simulations and logic checks). While these automated tests pass successfully, the refactoring required for them may have introduced subtle timing or hardware-specific regressions. A comprehensive round of manual validation on the physical instruments is currently underway to ensure full operational stability.
- Architecture
- Core Features
- Instrument Specifications
- Getting Started
- Running Tests
- Project History & Evolution
- Resources & Documentation
- Citation
- License
- Authors & Acknowledgments
The core design philosophy of PICA is the separation of concerns, implemented through a distinct GUI-Backend architecture for each measurement module.
- GUI (Frontend): Each measurement has a dedicated GUI script (e.g.,
IV_K2400_GUI_v5.py) built withTkinter. It is responsible for user interaction, parameter input, and real-time data visualization usingMatplotlib. - Backend: The instrument control logic is encapsulated in separate classes (e.g.,
Keithley2400_Backend). This layer handles allPyVISAcommunication, SCPI command parsing, and data retrieval. - Process Isolation: When a measurement starts, the GUI launches the backend logic in a separate, isolated process. This prevents a hardware timeout or script error from crashing the entire application suite.
- Inter-Process Communication: The frontend and backend communicate via thread-safe
multiprocessing.Queues, allowing for high-speed data transfer without race conditions.
- Centralized Control Dashboard: A comprehensive GUI for launching all measurement modules.
- Integrated VISA Instrument Scanner: An embedded utility for identifying and troubleshooting GPIB/VISA connections via the NI-VISA backend.
- Modular Design: Each experimental setup is a self-contained module, making the codebase easy to extend.
- Embedded Documentation: In-application viewer for technical manuals and project guides.
- System Console Log: A real-time logging system that provides status updates and error diagnostics.
This software controls a facility designed for characterizing the full spectrum of electronic transport properties in cryogenic environments (80 K to 320 K). The setup integrates multiple high-precision instruments to cover a resistance range spanning 24 orders of magnitude.
| Module | Configuration / Instrument | Use Case | Resistance Range |
|---|---|---|---|
| 1. Low-Resistance (Delta Mode) | Keithley 6221 (Current Source) + K2182 (Nanovoltmeter) | Superconductors & metallic films; actively cancels thermal EMFs. |
|
| 2. Mid-Resistance (Standard) | Keithley 2400 SourceMeter | Semiconductors, oxides, general transport. |
|
| 3. Mid-Resistance (High-Precision) | Keithley 2400 + K2182 | Detecting subtle phase transitions. |
|
| 4. High-Resistance | Keithley 6517B Electrometer | Dielectrics, polymers, & ceramics. |
|
- Python: Python 3.10 or newer is recommended.
- NI-VISA Driver: You must install the National Instruments VISA Driver or an equivalent backend. This is required for the
pyvisalibrary to communicate with the instruments.
-
Clone the Repository
git clone [https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation.git](https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation.git) cd PICA-Python-Instrument-Control-and-Automation -
Create a Virtual Environment Recommended to verify dependencies and avoid conflicts.
# Create the virtual environment python -m venv venv # Activate (Windows) venv\Scripts\activate # Activate (macOS/Linux) source venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Launch the Application
python PICA_v6.py
This repository includes a robust test suite using pytest. It mocks hardware interactions and GUI components, allowing the logic to be verified in a headless environment (CI).
To run the tests locally:
-
Install Test Dependencies:
pip install pytest pytest-cov flake8
-
Run the Test Suite:
python -m pytest
-
Generate Coverage Report:
# Generates an HTML report in the htmlcov/ directory python -m pytest --cov=. --cov-report=html
PICA has evolved from a collection of offline utility scripts into a modular software suite. The development timeline highlights the shift from manual instrument handling to a fully automated, asynchronous control system.
π Project Lore: For a detailed chronological log of the project's development history, including the offline prototyping phase and specific version changelogs, please refer to
docs/Change_Logs.md.
Status: Released November 2025 Focus shifted to code quality, stability, and documentation standards.
- CI/CD Integration: Implementation of automated testing pipelines using GitHub Actions.
- Refactoring: Comprehensive cleanup of the codebase to meet JOSS standards.
- Validation: Currently undergoing rigorous physical validation to ensure the refactoring process retained hardware-specific timing integrity.
Status: Major Release This period marked the transition to the GUI-Backend isolated architecture.
- Multiprocessing: Implementation of
multiprocessingto separate UI threads from instrument control loops. - UI Standardization: Adoption of a unified dark-themed UI across all measurement modules.
- New Modes: Added "Passive Sensing" modes for R-T measurements and integrated plotting utilities.
- 2024 (Migration): The codebase was migrated from offline laboratory systems to GitHub. The structure was reorganized from loose scripts into categorized instrument measurement modules (Keithley/Lakeshore).
- 2022 (Origins): Development began in an air-gapped laboratory environment. Initial work focused on proof-of-concept scripts using
PyVISAto replace manual data logging.- Project Concept: Proposed by Dr. Sudip Mukherjee to automate characterization workflows.
- Early Prototypes: Built iteratively alongside hardware upgrades and cryogenic probe development at UGC-DAE CSR.
- User Manual: Detailed setup and troubleshooting guides are available in docs/User_Manual.md.
- Instrument Manuals: Original PDF manuals for the supported hardware are located in
assets/Manuals/.
If you use this software in your research, please cite it using the following BibTeX entry:
@software{Deshmukh_PICA_2023,
author = {Deshmukh, Prathamesh Keshao and Mukherjee, Sudip},
title = {{PICA: Python-based Instrument Control and Automation Software Suite}},
month = sep,
year = 2023,
publisher = {GitHub},
version = {15.0.0},
url = {[https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation](https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation)}
}Alternatively, refer to the CITATION.cff file in the root directory.
- Lead Developer: Prathamesh Deshmukh
- Principal Investigator: Dr. Sudip Mukherjee
- Affiliation: UGC-DAE Consortium for Scientific Research, Mumbai Centre
Funding: Financial support for this work was provided under SERB-CRG project grant No. CRG/2022/005676 from the Anusandhan National Research Foundation (ANRF), a statutory body of the Department of Science & Technology (DST), Government of India.
This project is licensed under the MIT License - see the LICENSE file for details.

