Skip to main content

Python interface to the SMARTChem-Ion3 ion-selective electrode instrument.

Project description

This is a python interface to the SMARTChem Ion3 ion-selective electrode instrument.

It requires the device to be connected to the host computer using a RS232 style serial port, such as through a USB-to-serial converter, and then provides a basic wrapper around the device’s control capabilities. See the device’s user manual for details on its capabilities.

Source code at https://gitlab.com/ptapping/smartchem-ion3.

Documentation online at https://smartchem-ion3.readthedocs.io/.

Basic Usage

import smartchem_ion3

# Make a function to pretty print data obtained from the device
def handle_data(d):
    """Handle receipt of spontaneous data sent from the instrument."""
    print(f"Reading #{d.n} at {d.timestamp.isoformat()}")
    print(f"  Channel 1, {d.ch1.unit.description} = {d.ch1.value}{d.ch1.unit.suffix}")
    print(f"  Channel 2, {d.ch2.unit.description} = {d.ch2.value}{d.ch2.unit.suffix}")
    print(f"  Channel 3, {d.ch3.unit.description} = {d.ch3.value}{d.ch3.unit.suffix}")
    print(f"  Temperature, {d.cht.unit.description} = {d.cht.value}{d.cht.unit.suffix}")

# With no parameters, will use the first detected serial port at 38400 baud.
ion3 = smartchem_ion3.Ion3()

# Get a reading of the current state of the data channels and print it out
handle_data(ion3.current_data())

# Get the logged data and print them out
for d in ion3.logged_data():
  handle_data(d)

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

smartchem_ion3-1.0.0.tar.gz (21.2 kB view hashes)

Uploaded Source

Built Distribution

smartchem_ion3-1.0.0-py3-none-any.whl (20.9 kB view hashes)

Uploaded Python 3

Supported by

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