Skip to content

Fab Academy’s Project


A Micro-syringe pump is a pump infusion instrument in a small size that progressively discharges minute amounts of a fluid. This instrument adheres to principle of the Archimedean screw which simply forces a fluid to shift to a discharge location. This enables the syringe to move forward reliant to the amount of pression force applied. Thus, the flowrate depends on the amount of pression force. The most popular application for the instrument is in the medical sector specially in palliative care and to inject fluids into the microchannels of the microreactor. First, a design was adopted from a previous project to ease the process. Some TinkerCAD files were downloaded and printed using a 3D printer by my colleague Zahra. To read more about the design and printing steps please click here. The first fitting test was done and a conclusion regarding increasing the base length was reached. While waiting for the design to be printed, I started working on the connections and coding of the instrument. Finally, all the parts were assembled to finalize the project. The connections and coding were my part. Thus, A detailed illustration is provided below.


A microstep driver is an electrical part used to divide the steps of a stepper motor. In the absence of a microstep driver, the stepper motor turns one full step for every given pulse. Thus, to fulfill smaller steps a controller (i.e. the Arduino nano in this case) and a microstep driver are used to send suitable amounts of current pulses. Furthermore, the microstep driver using certain algorithms determines the partial pulses to be sent to the stepper motor. The used algorithms are developed and provided directly from the manufacturer. The former allows the motor to wind by a fraction of the step only [1a]. The mircosteps ranges from 16 to 64 microsteps per one step. In addition, the microstep driver protects the motor from burning as it will minimize the sent pulses. G212 microstep drive is used in this project. 12 terminals can be connected to wires using a small screwdriver to move the jumpers on each terminal and to tighten the wires to the terminal as well. The power supply ground is to be connected to terminal 1 and the positive power supply is to be connected to terminal 2 where the voltage of the direct current power supply should be between 24 to 80 V. Connect one motor winding (I,e, coil A) to terminal 3 and the other end of the winding (i.e. coil /A) to terminal 4. Similarly, coil B is to be connected to terminal 5 and coil /B is to be connected to terminal 6. If the motor is spinning on the opposite direction, the connections of terminal 3 and 4 must be exchanged. There is no connection to terminal 7. The direction line is to be connected to terminal 8 and the step line is to be connected to terminal 9. +5V pin of the controller is to be connected to terminal 10. A resistor is to be connected to terminal 11 and 12 (i.e. each of the terminals is to be connected to one end of the resistor). The value of the resistor can be calculated using the following equation: R=(47*I)/((7-I)) (1) Where, R is the resistance in kΩ and I is the current in A.


The power supply must be within the provided range as exceeding 80 VDC damages the driver. The power supply must be turned off when connecting or disconnecting motor wires. Current 3 A without heat sink (i.e. resistor) may damage the driver.


Arduino nano was used to control the instrument (i.e. micro-syringe pump). It was connected to the microstep driver, the on/off switch and the direction switch. The Arduino nano was placed on a bread board and connected to a PC using a USB connection. The pinout of the Arduino nano is attached at the end. A code was sent to the Arduino to implement the desired commands.


A stepper motor is an electrical motor that has a rotating shaft. The shaft rotates by performing steps with a fixed angle. The internal structure of the motor enables this rotating mechanism and predicting the exact angular position of the shaft through counting the performed steps. The stepper motor consists of two main parts, the stationary part, the stator and the moving part, the rotor. Figure x-xx represents a drawing the section of the motor. The stator has some teeth wired with coils, whereas the rotor can be either permanent magnet or a variable reluctance iron core. Furthermore, once the sent current flows in the coils, a magnetic field generates and moves the rotor. When different phases are sent in sequence, the rotor rotates with a precise amount to arrive to a specific desired location [3]. The used motor was NEMA 14 stepper motor which is considered one of the strongest stepper motors. And Its step angle is 1.8 deg. It achieves 200 steps per revolution [4].

On off switch

An on/off push switch button was used to turn the instrument on and off whenever desired. The used switch type was PB-22E60E [a5]. Including this button is crucial as it prevents accidents. Prior to the addition of the switch, the instrument was turned on and off through connecting and disconnecting the USB cable which was impractical. Also, this enables better control over the instrument without the need to connect it to a PC. The switch has six pins, two of them should be connected to the arduino. To identify which pin should be connected the arduino, a multimeter used. The reading of the multimeter changes when the correct pair of pins are connected. There are more than one correct pair to be selected. The following picture represent the identification process.

The pin on the corner is to be connected to the VIN pin in the arduino which is parallel to the brown wire that is connected to the VIN whereas the pin on the middle is connected to D2 pin. D2 is a digital pin that can take only two status that are LOW and HIGH which make it suitable for an on/off switch [5]. Apparently, the simple mechanism the button works on is the state of the button. A 10 kΩ resistor was used to connect the switch [a3]. The pins of the switch was soldered and then coated with a protective layer of a heat shrink tube while the other end of the wire was stripped using a wire cutter, crimped using a crimping tool and similarly coated with a heat shrink tube. In the soldering process it is highly important to apply a layer of flux pen to yield a uniform heat distribution and melt a solding wire to get a better result.


It is necessary to add a resistor with the push button when it is used with a microcontroller because in the absence of the resistor a floating input may be taken instead and a floating input has no defined state. Furthermore, a resistor is used to hold the digital pin of the microcontroller in a defined state (0 or 1) and prevent floating [6]. Cation must be taken in the solding process because high temperature instrument is delt with. It is better to have an expert around to help with the solding process.

The following layout explains how to connect an on/off switch to arduino UNO [7].

Direction switch

To control the direction of motor, a toggle switch was used. The used switch was MTS-102. This switch was added to return the syringe piston to its original position rather than returning it manually or changing the code or wires every time the direction is needed to be changes. The switch has 3 pins and all of them should be connected to the Arduino. The pin on the middle is to be connected to the digital pin D6 whereas the pins on the left and right are to be connected to the negative side of the bread board and VIN pin. The left and right connections can be reversed and respectively, the direction of this position will be reversed to. When the switch is located at a specific direction, right for example, the middle pin and the left pen will be connected together, and the motor moves clockwise or anti clockwise depending on the electrical connections and the code. There are different types of toggle switches. These 4 types are represented on the following picture [8]. The type used in our case is Single Pole Double Throw (SPDT) On-On which has a single input and two output that enables it to work as either on-off or on-on switch with different two paths [9]. The same soldering procedure was followed with this pin. The soldering process for this switch was easier because the pins have holes which ease twisting the connection wires around the hole.

The mechanism is further explained in the following pictures. [8].

The solding process photos.

Power supply

A switching power supply is an electrical device that is used to provide electrical power as the needed voltage and current for the motor was xxx which cannot be provided from a PC. The prime role of a power supply is to convert the electrical power delivered by a source into the correct voltage, and frequency to supply the targeted load. The power supply used converts from 240V AC to 24V DC.

The color coding for the connection wires should be investigated before connecting the wires as each color specifies the function of the wire [a9]. The extension cable contains 3 wires, pale purple indicating line (L), blue indicating neutral (N) and yellow with green strips indicating ground wire (GND). The mentioned wires are to be connected to their respective positions in the power supply terminals 1,2 and 3. Terminals 4 and 6 are to be left empty. Any voltage source should have a positive and a negative terminal [10]. Terminals 5 and 6 are to be connected to the negative (-V) and positive (+V) wire connections of the driver respectively.


The selected power supply must be suitable for the application. Furthermore, the voltage range should be appropriate to the targeted device. It should not be higher or lower. The power must be turned off while working on the connections.


Arduino IDE was used to write a V++ code. Each switch was coded separately first to anatomize its working mechanism. The key objective of the code is to control the micro syringe pump. The code specifies the motor speed, connects the on/off switch and the direction of motion. First, stepper motor was included from library. The motor function was originally taken from the stepper speed control and develop further to fit our usage. The steps per revolution was set constant as 200 which is the step this motor can spin within one resolution [12]. The pins connections are mentioned in the code. For the on/off and direction switches, a boolean, which is a binary variable that carries two possibilities, LOW (0) or HIGH (1) was used to operate the code [13]. The code is set to turn on the motor when the on/off switch is set on. The direction of the motor (i.e. clockwise or anti clockwise) is set according to the direction swtich. By the same token, if the direction is set to left for example which is set as LOW in the system, then a minus sign is added to the step function to let the motor moves clockwise and vice versa. This is the used code

#include <Stepper.h>

const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 3, 8);
int stepCount = 0;
int pinSwitch = 2;
int directionswitch = 6;
int motorSpeed = 0;
// declaring variables to hold the new and old switch states
//boolean oldSwitchState = LOW;
boolean SwitchState = LOW;
boolean motordirection = LOW;

void setup()
  digitalWrite(LED_BUILTIN, LOW);
  pinMode(pinSwitch, INPUT);
  pinMode(directionswitch, INPUT);

void loop()
  //on and off control
  SwitchState = digitalRead(pinSwitch);
  if ( SwitchState == HIGH ){    
        //digitalWrite(LED_BUILTIN, HIGH);
        motorSpeed = map(1500,0,1500,0,1500);
       // digitalWrite(LED_BUILTIN, LOW);
        motorSpeed = 0;      

  // direction control
  motordirection = digitalRead(directionswitch);
  if (motorSpeed > 0) {
    if (motordirection == LOW){
    // step 1/100 of a revolution:
    myStepper.step(-stepsPerRevolution / 100);
    digitalWrite(LED_BUILTIN, HIGH);
    else {
      myStepper.step(stepsPerRevolution / 100);
      digitalWrite(LED_BUILTIN, LOW);

This is a final look of the micro-syringe pump after assembly.

To see a video of the instrument working click here

Last update: September 15, 2021