Pipetting with the electronic pipette

Connect to an electronic pipette, then aspirate, dispense, eject tips, and clear its state.

The electronic pipette is a wireless handheld pipette that an arm holds and operates. You connect to it once under a logical name, then drive it with the epipette_* calls from your robotic_code.py. These calls command real hardware: the piston moves, liquid is drawn in and pushed out, and tips are ejected.

⚠️

These pipette calls have no simulation branch. Even in the cloud simulator they try to reach a real pipette over the wireless link, and a connect can block on the order of several minutes before it gives up. If your skill pipettes but is meant to run in the simulator, guard every pipette call behind is_sim_mode() so the simulator never blocks on hardware that is not there. Never treat a {"success": True} return as confirmation that it is safe for a person or object to be near the arm.

Device names

You refer to a pipette by a logical name that you pass to init_epipette and then to every later call. These name constants are exported for you:

  • EPIPETTE is "epipette", a plain default logical name.
  • EPIPETTE_GREY is "epipette_grey", the logical name for the grey pipette.
  • EPIPETTE_ML is "epipette_ml", the logical name for the millilitre pipette.

Two more constants hold the wireless device identifiers of the two pipettes wired to a cell, for passing as the ble_device_name argument to init_epipette:

  • EPIPETTE_GREY_BLE_NAME: the device identifier of the grey pipette.
  • EPIPETTE_ML_BLE_NAME: the device identifier of the millilitre pipette.

The logical name is your handle in code. The device identifier tells init_epipette which physical pipette to pair with. Pass the constant rather than a literal string, so your skill stays correct if the underlying device changes.

Connecting

init_epipette(name, ble_device_name="picus", debug=True)

Connect to a pipette and register it under a logical name. Call this once per device before any other epipette_* call.

  • name (str): the logical name you will pass to every later call, for example EPIPETTE_GREY.
  • ble_device_name (str, default "picus"): the wireless device to scan for and pair with. Pass one of the *_BLE_NAME constants to target a specific pipette.
  • debug (bool, default True): turn on verbose connection logging.

This call blocks while it scans, pairs, and readies the device. It can block on the order of several minutes before timing out. It returns a handle to the connected device on success, or None if no matching pipette was found or the connection failed. If init_epipette was already called for this name, it returns the existing device without reconnecting.

from execution.execution_functions import *

if not is_sim_mode():
    init_epipette(EPIPETTE_GREY, ble_device_name=EPIPETTE_GREY_BLE_NAME)

Aspirate and dispense

epipette_aspirate(name, volume=5, speed=5)

Draw liquid into the tip.

  • name (str): the logical name from init_epipette.
  • volume (default 5): volume to aspirate. The source does not state a unit, so treat the unit as unspecified and match the values your device expects.
  • speed (default 5): aspirate speed. Unit unspecified in source.

Returns {"success": True} when the aspirate completes. Returns {"success": False, "error": ...} if the pipette was never initialized under name or the pipette link is not available. If the wireless link drops mid-op it reconnects and retries a small number of times; if it still fails, or the error is not a dropped link, the call raises rather than returning.

epipette_dispense(name, volume=5, speed=5)

Push liquid out of the tip. Same arguments, units, return shape, and failure behaviour as epipette_aspirate.

  • name (str): the logical name from init_epipette.
  • volume (default 5): volume to dispense. Unit unspecified in source.
  • speed (default 5): dispense speed. Unit unspecified in source.
if not is_sim_mode():
    epipette_aspirate(EPIPETTE_GREY, volume=50, speed=5)
    # move the arm over the destination well between these calls
    epipette_dispense(EPIPETTE_GREY, volume=50, speed=5)

Tips and clearing state

epipette_tip_eject(name)

Eject the tip currently on the pipette.

  • name (str): the logical name from init_epipette.

Returns {"success": True} on completion, or {"success": False, "error": ...} if the pipette is not initialized under name or the link is unavailable.

epipette_home(name)

Return the piston to its zero position. Use this to clear a piston-drift error state that would otherwise cause the pipette to reject an aspirate or dispense. It is a good pre-run step to put the device in a known state.

  • name (str): the logical name from init_epipette.

Returns {"success": True} on completion, or {"success": False, "error": ...} if the pipette is not initialized under name or the link is unavailable.

epipette_blow_out(name, speed=10)

Push out any residual liquid left in the tip and clear the device's "liquid present" state, so a following operation is not blocked by that warning.

  • name (str): the logical name from init_epipette.
  • speed (int, default 10): blow-out speed. Unit unspecified in source.

Returns {"success": True} on completion, or {"success": False, "error": ...} if the pipette is not initialized under name or the link is unavailable.

Recovering the link

epipette_reconnect(name)

Re-establish a wireless link to a pipette that was already connected with init_epipette but has since dropped. It reuses the known device, so it does not re-scan or re-pair, which makes it faster than a full init_epipette. On success it restores the pipette to its ready state.

  • name (str): the logical name from init_epipette.

Returns {"success": True} when the link is back, or {"success": False, "error": ...} if the reconnect fails, the pipette was never initialized under name, or the link is unavailable. This call can block for up to about a minute.

ℹ️

The aspirate, dispense, tip-eject, home, and blow-out calls already reconnect and retry on their own when the link drops mid-op. Reach for epipette_reconnect only when you want to recover the link outside of an operation. If the device was never initialized at all, use init_epipette instead.

epipette_disconnect(name)

Cleanly disconnect a pipette: it is taken out of its active state and the wireless link is closed.

  • name (str): the logical name from init_epipette.

Returns {"success": True} once the disconnect completes, or {"success": False, "error": ...} if the pipette was not initialized under name or the link is unavailable. The logical name stays registered after disconnect, so a later epipette_reconnect(name) can bring the same device back.

Related


Did this page help you?