Skip to content

ljelschen/KeithleyInstruments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

picometer_6485

Python wrapper for the Keithley 6485 picoammeter (example code and convenience functions).

This repository contains a small instrument wrapper around the Keithley 6485 used to simplify simple current measurements, buffering, and averaging. It includes a ready-to-run example script: picometer_6485/examplePicometer6485.py.

Features

  • Connect to a Keithley 6485 via a serial/COM port
  • Take buffered time-series measurements
  • Compute mean values from several buffered readings
  • Small, dependency-light codebase intended for quick measurements and experimentation

Requirements

  • Python 3.8+ (3.10 or newer recommended)
  • pyserial
  • numpy
  • matplotlib (optional, used by the example script)

Install dependencies with pip:

pip install pyserial numpy matplotlib

Quick start

  1. Connect the Keithley 6485 to your PC and note the COM port (Device Manager → Ports (COM & LPT)).
  2. Edit picometer_6485/examplePicometer6485.py and set the correct port (for example COM3 or COM14).
  3. Run the example script:
python .\picometer_6485\examplePicometer6485.py

The example script demonstrates creating a PM6485 instance, taking a buffered reading (time and values), plotting results with matplotlib, computing a mean, and closing the connection.

Example usage (summary)

From the example examplePicometer6485.py:

  • Create instrument object:
from KeithleyInstruments import PM6485
pm = PM6485(port='COM14')
  • Take a buffered reading (returns two arrays: time and measured current values):
time, values = pm.buffer(count=100, buffer_delay=0.1, buffer_itime=20e-3)
  • Compute a mean value (single averaged current):
mean_value = pm.getMeanValue(count=10, buffer_delay=0.02, buffer_itime=10e-3)
  • Close the connection when finished:
pm.close()

Notes: the exact method names and parameter meanings are implemented in src/KeithleyInstruments.py. If you need additional features (range control, integration time presets, trigger configuration), add them there or open an issue.

Units and timing notes

  • Parameter names in the example (such as buffer_delay and buffer_itime) are time-related. Before relying on a specific numeric scale (seconds vs milliseconds), check the docstrings in src/KeithleyInstruments.py to confirm units used by the wrapper. The example uses SI-style floats (e.g. 0.1 for 100 ms, 20e-3 for 20 ms) but older code sometimes uses millisecond integers — verify for your installed version.

Troubleshooting

  • Permission / access errors: ensure no other program (or another Python process) has the COM port open.
  • Wrong COM port: verify the correct COM port in Device Manager and update the example.
  • No measurements / NANs: check instrument front-panel settings (range, zero check) and cabling.
  • If pyserial raises issues, upgrade or reinstall it: pip install --upgrade pyserial.

If you run into problems, inspect src/KeithleyInstruments.py for implementation details and adjust settings there.

Tests and validation

This project doesn't include automated hardware tests. If you add unit tests, keep them separate from tests that require hardware; mock the serial port where possible.

Contributing

Small PRs are welcome. Typical improvements:

  • Add explicit unit tests (mocked serial) for parsing and buffering logic
  • Add documentation for each method in src/KeithleyInstruments.py
  • Add a LICENSE file (MIT recommended) if you want permissive reuse

License

MIT License

Copyright (c) 2025 Lars Jelschen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Keithley Instruments Collection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages