Welcome to labequipment’s documentation!

Arduino Sketches for Lab Equipment

Python code for all the different bits of lab kit

Shaker Arduino Sketch

class labequipment.arduino.Arduino(port=None, rate=9600, wait=True)

Bases: object

choose_port(os='linux')
flush()
ignorelines(n)
quit_serial()

Close the serial port

read_all()
read_serial_bytes(no_of_bytes)

Read a given no_of_bytes from the serial port

read_serial_line()

Waits for data in the input buffer then reads a single line from the serial port.

Outputs:
text the data from serial in unicode
readlines(n)
send_serial_line(text)

Send a string over the serial port making sure it ends in a new line .

Input:
text the string to be sent to the arduino
wait_for_ready()

Ensure the arduino has initialised by waiting for the ‘ready’ command

labequipment.arduino.find_port()

Lab Equipment

Python code for all the different bits of lab kit

Arduino

class labequipment.arduino.Arduino(port=None, rate=9600, wait=True)

Bases: object

choose_port(os='linux')
flush()
ignorelines(n)
quit_serial()

Close the serial port

read_all()
read_serial_bytes(no_of_bytes)

Read a given no_of_bytes from the serial port

read_serial_line()

Waits for data in the input buffer then reads a single line from the serial port.

Outputs:
text the data from serial in unicode
readlines(n)
send_serial_line(text)

Send a string over the serial port making sure it ends in a new line .

Input:
text the string to be sent to the arduino
wait_for_ready()

Ensure the arduino has initialised by waiting for the ‘ready’ command

labequipment.arduino.find_port()

Lauda Water Bath

class labequipment.lauda.Lauda(port)

Bases: sphinx.ext.autodoc.importer._MockObject

read_current_temp()
set_pumping_speed(val)
set_temp(new_temp)
start()
stop()

Omega Temperature and Humidity Sensor

class labequipment.omega_temperature_probe.Probe(port='/dev/serial/by-id/usb-Omega_Engineering_RH-USB_N13012205-if00-port0')

Bases: sphinx.ext.autodoc.importer._MockObject

get_relative_humidity()
get_temp_C()

Shaker

class labequipment.shaker.Shaker

Bases: object

change_duty(val)
init_duty(val)
quit()
ramp(start, end, rate, step_size=1, record=False, stop_at_end=False)
read_all()
start_serial()
switch_mode()
labequipment.shaker.convert_audio_frequency_to_duty_cycle(freqs)

Converts audio frequencies to duty cycle (out of 1000)

Stepper

class labequipment.stepper.Stepper(ard)

Bases: object

Class to manage the movement of stepper motors

move_motor(motor_no, steps, direction)

Generate the message to be sent to self.ard.send_serial_line

Inputs: motor_no: 1 or 2 steps: int direction: either ‘+’ or ‘-’

Indices and tables