DIY Peristaltic Pump




About: Awesome Electronics Tutorials, Projects and How To´s

In this project we will have a look at peristaltic pumps and find out whether it makes sense to DIY our own version of it or whether we should just stick with the commercial buy option instead. Along the way we will create a stepper motor driver circuit and a suitable 3D print for our DIY version.

Step 1: Watch the Video!

The video gives you all the information you need to create your own peristaltic pump. During the next steps I will present you some additional information.

Step 2: Order the Components!

Here you can find a parts list with example seller:


1x Arduino Nano:

1x NEMA17 Stepper Motor:

1x DRV8825 Stepper Motor Driver:

1x 10kΩ Potentiometer:

1x 100µF Capacitor:

1x Arduino Nano:

1x NEMA17 Stepper Motor:

1x DRV8825 Stepper Motor Driver:

1x 10kΩ Potentiometer:

1x 100µF Capacitor:

1x Arduino Nano:

1x NEMA17 Stepper Motor:

1x DRV8825 Stepper Motor Driver:

1x 10kΩ Potentiometer:

1x 100µF Capacitor:

Step 3: Build the Circuit!

Here you can find the schematic and code for the circuit. Feel free to use them as a reference.

Step 4: 3D Print the Pump!

As mentioned in the video, my design is basically a modification of an already existing design from Ralf. It is this one:

Here you can download my 5 modified .stl files in order to 3D print them. Make sure to use ABS and an infill of 60%.

Step 5: Success!

You did it! You just built your own Peristaltic Pump!

Feel free to check out my YouTube channel for more awesome projects:

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information:



    • Faux-Real Contest

      Faux-Real Contest
    • Warm and Fuzzy Contest

      Warm and Fuzzy Contest
    • Sweet Treats Challenge

      Sweet Treats Challenge

    10 Discussions


    2 months ago

    Can someone explain me what the capacitor is for? It's for absorbing backward current?
    so the nema got 5v directly from arduino? what if I want to connect 20 motor? how can I modify the circuit to have exxternal power source?

    1 reply

    Reply 8 weeks ago

    it protects the stepper motor driver from voltage spikes


    Question 3 months ago

    will the STL files print in the same size as in the DIY or Buy video?


    Question 9 months ago

    I would like to control the stepper motor intermittently using 3 potentiometers:

    1. Speed
    2. time of rotation or number of steps
    3. The dwell time
    Please help me write the code.


    Question 11 months ago

    I am leveraging your code to produce a variable frequency output. The code works perfectly on at ATMega328 but I am having trouble porting it to the ATTiny85. Are you familiar with the ATTiny series of chips? Would you be willing to assist? My code:

    long analogvalue;

    const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);

    void setup()


    ADCSRA &= ~PS_128;

    ADCSRA |= (1 << ADPS2); //ADC Prescaler of 128

    TCCR0B = 0;

    TCCR0B = bit (WGM02) | bit (CS00); //CTC mode, no prescaling

    TCCR0A = 0;

    TCCR0A = bit (COM0B0) | bit (COM0A0); // enable CTC and toggle OC0B/OC0A on compare match

    pinMode (1, OUTPUT); // chip pin 7 // OC0B - Timer 0 "B"

    pinMode (0, OUTPUT); // chip pin 8 // OC0A - Timer 0 "A"

    pinMode (A1, INPUT);

    } // end of setup

    void loop() {


    analogvalue = analogRead(A1);

    analogvalue = map(analogvalue, 0, 1023, 200, 100000);

    OCR0A = analogvalue;


    1 answer

    Question 12 months ago

    Do the STL files already account for the shrinkage of ABS or did you select to print them a few percent larger in the slicer?

    1 answer

    Answer 12 months ago

    No, I did not enlarge the model with the slicer software. Everything should fit without modifications.


    12 months ago

    Aside from the price issue (no real issue for those of us who just like to build things). These pumps cause the tubing to see a lot of wear and tear from the roller process, thus they fail a lot and I'm not sure an ABS housing would stand up to the load either. As a hobby build it would be instructive but I'd make sure it had a drain tray under it if it were unattended.


    1 year ago on Step 5

    After adding prices of all of the components I got roughly something around 10+3+1.5+some small parts = ~15$. You added 3D printing costs as 5$ so in total it's around 20$ for 200ml/min pump.

    Doesn't it have worse "value to price" factor comparing to cheaper pumps You mention on the beginning of Your video?