Electronics#
Modular Design#
A major benefit of this syringe pump design is that the electronics are modular. A 7-pin female header socket provides access to the bipolar stepper motor and two limit switches.
Dispensing liquid from a syringe pump requires precise control of stepper motor's rotation. Typically, this involves having some control software running on a computer communicate to a microcontroller...
- when to rotate
- which direction to rotate
- how far to rotate
- how fast rotate
The microcontroller calculates the quantity and timing of partial rotations (steps) that will produce the intended motor movement. This collection of precisely timed step signals is fed into a stepper motor driver IC, which in turn supplies current to motor coils in a sequence that creates a rotating magnetic field, causing the motor shaft to incrementally rotate (here is a good video for more information on how hybrid stepper motors work).
Multiple options exist for each element in the technology stack (control software + microcontroller + stepper driver IC), thereby creating many possibilities for controlling a syringe pump. For example, these three neuroscience labs developed the following solutions:
Project | Software | Development Board (Microcontroller) | Stepper Driver |
---|---|---|---|
Poulet Lab Bpod motor controller | Bpod | Teensy 3.6 (MK66FX) | TMC2100 |
Pachter Lab Poseidon System | Poseidon Controller | Arduino Uno (ATMEGA328) | DRV8825 |
Karpova Lab SCB for pyControl | pyControl | Feather M0 equivalent (ATSAMD21) | TMC2209 |
The existence of these multiple solutions highlights the importance of the syringe pump not being tied to a specific technology stack. The pump can benefit more users since the control electronics are decoupled from the rest of the syringe pump. One can easily swap in their own electronics to integrate the pump with their particular setup. No more vendor lock-in! You should be able to use your syringe pumps with whatever system you choose. If a cool new display or better motor driver IC becomes available, upgrading the electronics should be an easy swap.
Community Designs
Do you have ideas for a custom control board? A design that you've already built? Consider sharing in the discussions for others to benefit from. I can add community design links and information to this documentation page!
To ensure compatibility with the existing baseplate, your PCB should include a 7-pin header and a mounting hole (refer to the pyControl SCB layout below for dimensions).
pyControl Syringe Control Board (SCB)#
In our lab we designed a motor controller that interfaces with pyControl. It receives power and communication from pyControl hardware via an RJ45 connection.
The PCB adheres to Adafruit's feather wing specification. This enables the possibility of plugging in a variety of "feather wings" to expand the controller's capabilities. For example a display or radio communication can be easily added.
The motor controller can receive movement commands from pyControl and/or respond to user input from the onboard buttons. Information and warnings can be shown on the display. In the past, we have used a Mini color TFT with Joystick feather wing. Currently, we use the more basic 4-digit 7-segment display.
Printed Circuit Board#
The manufactured PCB contains two board designs which can be separated by breaking off the perforated "mousebite" tabs. The skinny PCB is meant to permanently attach to the syringe frame and make connections with the stepper motor and limit switches. It provides access to those connections through a 7-pin socket. The larger PCB is a pyControl compatible device that plugs into the motor connection socket.
Components BOM#
Qty | Reference | Description | Value/MPN |
---|---|---|---|
5 | C1, C5, C6, C7, C8 | 0603 Capacitor | 100nF |
3 | C2, C3, C9 | 0603 Capacitor | 2.2µF |
1 | C4 | Electrolytic Capacitor | 100µF |
1 | C10 | 0603 Capacitor | 22nF |
3 | H1, H2, H3 | 2mm Standoff | 9774010943R |
1 | J1 | RJ45 Jack | 54602-908LF |
1 | J2 | 16-pin Female Header | ESQ-116-12-T-S |
1 | J3 | 12-pin Female Header | ESQ-112-12-T-S |
1 | J4 | 7-pin Right Angle Male | PH1RB-07-UA |
1 | J7 | 7-pin Right Angle Female | PPTC071LGBN-RC |
4 | R1, R2, R3, R5 | 0603 Resistor | 10KΩ |
2 | R4, R6 | 0805 Resistor | 0.3Ω |
3 | S1, S2, S3 | Right angle tactile switch | PTS645VH39-2 |
1 | U1 | 3.3V voltage regulator | BU33SD2MG |
1 | U2 | Microcontroller | ATSAMD21G |
1 | U3 | Motor Driver | TMC2209 |
1 | U4 | EEPROM | AT24C01C-STUM |
Assembly#
Cut wires to the following lengths:
- motor leads: 25 mm
- infuse limit switch: 70 mm
- retract limit switch: 235 mm
Programming#
User Guide#
Initial Setup#
The Syringe Control Board needs to perform a "homing" sequence to determine how the electronics are connected. With this information it will know which direction to rotate for "infuse" and "retract", as well as which limit switch corresponds to which direction.
- Press and hold down the center of the button. After 4 dashed lines fill up the display, the carriage will begin to move.
- Once the carriage reaches a limit, select whether the direction it went was "infuse" or "retract" by pressing the left button for "infuse" or the right button for "retract".
- Check that everything is correct by pressing the right button. The carriage should move in the retracting direction until it hits the retraction limit and stops.
pyControl Operation#
The syringe board can be used as pyControl device. Its pinout is compatible with pyControl behavior ports.
Note
The pump must be plugged into a port that has a serial UART.
- For Breakout board 1.2, this can be ports 1, 3 or 4.
- For D-series Breakout Board 1.6, this can be ports 8, 10, 11 or 12.
The following example assumes that the syringe pump is plugged into port 3 of Breakout board 1.2.
- Download syringe_pump_device.py and place it in your "devices" directory.
- Download pump_example_task.py and place it in your "tasks" directory.
- Open up pyControl GUI
- Connect to your board
- Click the
Config
button and then clickLoad framework
. This will ensure the syringe_pump_device.py is transferred onto the pyBoard microcontroller. - From the Task dropdown select the "pump_example_task"
- Click
Upload
- Click
Start
- Pressing the user button on the breakout board will tell the syringe pump to infuse 0.25 mL.
- Click
Variables
and set the pump_volume to 2500. Press the user button again and see the difference. You can also try giving it a negative number, causing the motor to spin in the opposite direction.