Skip to content

OPEN_KEITHLEY_24XX

Open a connection to the Keithley 2400 source meter. Params: device : Serial The connected serial device corresponding to the Keithley 2400 source meter. Returns: out : None
Python Code
import serial
from typing import Optional
from flojoy import SerialDevice, flojoy, DataContainer
from flojoy.connection_manager import DeviceConnectionManager


@flojoy(deps={"pyserial": "3.5"})
def OPEN_KEITHLEY_24XX(
    device: SerialDevice, baudrate: int = 9600
) -> Optional[DataContainer]:
    """Open a connection to the Keithley 2400 source meter.

    Parameters
    ----------
    device: Serial
        The connected serial device corresponding to the Keithley 2400 source meter.

    Returns
    -------
    None
    """

    ser = serial.Serial(
        port=device.get_port(),
        baudrate=baudrate,
        bytesize=serial.EIGHTBITS,
        parity=serial.PARITY_NONE,
        stopbits=serial.STOPBITS_ONE,
        timeout=1,
    )

    DeviceConnectionManager.register_connection(device, ser)

    return None

Find this Flojoy Block on GitHub

Videos

Measure voltage from a solar panel using Flojoy

Example

Having problems with this example app? Join our Discord community and we will help you out!
React Flow mini map

In this example, we demonstrate how to record an I-V curve using Flojoy, a Keithley2400 source meter, and a computer. Fist you need to connect the Keithley2400 sourcemeter to the computer with a serial communication cable. Then, connect your device (Solar cell in this example) to the sourcemeter. After that you can prepare your flojoy app:

The LINSPACE node defines the voltage range sent to the electronic device. The user defines the voltage range by setting these parameters with Numeric Input:

  • LINSPACE START: Define your first Voltage.
  • LINSPACE END: Define your last Voltage.
  • LINSPACE STEP: Define the number of voltages between the first and the last one.

The KEITHLEY2400 node will communicate with the source meter by serial communication to send voltages and measure currents from the device.

The connection must first be opened using the OPEN_KEITHLEY_24XX node, which has two communication parameters set by the user after connecting the Keithley2400 to their computer:

  • DEVICE: Select the serial device that corresponds to the Keithley2400.
  • BAUDRATE: Define the Baud rate of your communication protocol (the default is 9600, the value has to correspond to the Instrument settings).

The LINE node will display the I-V curve by plotting the currents received from the device as a function of the voltages transmitted to the device.

When the setup is ready, and the parameters above are well defined, the experiment can be started by turning on the source meter and clicking the PLAY button.