###Hackable Syringe Pump
If you want to be able to control an open source syringe pump
- with an arduino
- using python
- with others
- from anywhere
this will show you how. This modifies the open-source syringe pump (also found here) by Michigan Tech's Open Sustainability Technology Lab to use Arduino, not Raspberry Pi. Python is then used to control the motor through pithy and nodeforwarder.
###Code Examples
Instead of calculating the rpm and steps needed to control a motor, this program takes in any 2 of the following:
- volume (mL)
- time (min)
- flowrate (mL/min)
calculates the remaining parameter and automatically runs the motor at the required speed and steps.
For example,
syringe(‘forward’, time=0.7, volume=10)
will push the syringe forward for 0.7 minutes (42 seconds) to dispense 10mL of liquid. The motor moves 8400 steps at 60 rpm.
syringe(direction[, time=0, volume=0, flowrate=0])
The function syringe only has 1 required parameter, direction, which is either ‘forward’ or ‘backward’. The other three default to 0 and will be changed when given.
###How it Works
Pithy writes a string to a url, which acts like a serialport thanks to nodeforwarder. Arduino then reads off the serialport and runs the motor accordingly.
###Building the Pump
Please refer to the instructions from Michigan Tech to build the open-source syringe pump.
Also refer to the documentation file for more specific details on how we printed ours.
###Additional Hardware
In addition to the parts needed to build the syringe pump, the parts for the arduino / pithy controller include:
- Arduino Uno (we used R3, but any version works)
- Adafruit Motor Shield v2
- Micro-USB adaptor cable (to connect the board to the computer)
- 4 wires to connect motor to motor shield
Attach the Adafruit Motor Shield onto the Arduino, and attach the syringe pump motor to the M3 and M4 motor ports on the shield.
###Software Prerequisites
To run this, you will need:
###Software Installation
- Download nodeforwarder. Do not open a node. Serialport, express, etc, will be installed in step 6.
- Download pithy and follow directions.
- Clone this repository.
- Run syringe_arduino.ino on the arduino. The serialport should read “Stepper test successful!” If an error occurs saying the port is busy, close any open nodes.
- cd into the nodeforwarder folder.
- Run startnode.bat [windows] or startnode.sh [macs]. Note: this file is in the hackable-syringe-pump folder, not the nodeforwarder folder, so copy it over or type the path in front of the file. If permission is denied, type chmod u+x startnode.sh to give yourself permission to execute the file.
- Open syringe.py using pithy and run the code.
And that’s it!
###Special thanks to
- Lindsey Adamson
- Jason Mulderrig
- Dan Steingart
- Lindsay Epstein