Table of Contents
- What Is a Peristaltic Pump and How Does It Work?
- Applications: Where Peristaltic Dosing Is Used
- Components List for the Dosing System
- Circuit Diagram and Wiring
- Calibrating Your Peristaltic Pump
- Basic Arduino Dosing Code
- Scheduled Dosing with Real-Time Clock
- Multi-Pump System for Nutrient Dosing
- Flow Monitoring and Error Detection
- Enclosure and Tubing Considerations
- Recommended Products
- Frequently Asked Questions
- Conclusion
What Is a Peristaltic Pump and How Does It Work?
A peristaltic pump moves fluid by squeezing a flexible tube between rollers and a circular housing. As the motor rotates, the rollers travel around the inside of the housing, compressing the tube in sequence. This creates a series of moving pockets of fluid—exactly like the muscular contractions (peristalsis) in the human intestine. The fluid is pushed forward with no contact between it and the pump’s internal mechanism.
This operating principle gives peristaltic pumps unique advantages over centrifugal and diaphragm pumps:
- Self-priming: Can lift fluid from below without priming or check valves
- Reversible: Reverse motor direction to reverse flow and retract fluid from the tube
- Sterile and hygienic: Only the tube contacts the fluid—ideal for food, medicine, and sensitive chemicals
- Precise volume metering: Each full motor rotation delivers a fixed, repeatable volume
- Dry-run safe: Will not damage the pump if run without liquid (unlike centrifugal pumps)
- Easy cleaning: Replace or sterilise the tube; the pump head never needs cleaning
For Arduino makers, the most important advantage is precise volume delivery. By timing how long the motor runs, you can deliver an accurate dose of liquid—making peristaltic pumps perfect for automated hydroponics, aquarium dosing, laboratory dispensing, and beverage systems.
Applications: Where Peristaltic Dosing Is Used
Peristaltic pump dosing systems built on Arduino are popular across a wide range of applications:
- Hydroponic nutrient dosing: Automatically add Part A, Part B, and pH adjustment solutions to a reservoir on a schedule or in response to sensor readings
- Aquarium maintenance: Dose calcium, magnesium, alkalinity supplements, or liquid fertilisers on precise schedules
- Homebrewing: Add priming sugar solution, yeast nutrient, or hop extracts in exact quantities
- Laboratory dispensing: Deliver precise volumes of reagents without operator contact
- Coffee machine automation: Add flavour syrups or milk frothers in exact doses
- Plant watering: Deliver fertiliser solution with each watering cycle
- Chemical processing: Acid or base dosing for pH control in industrial processes
Components List for the Dosing System
| Component | Specification | Notes |
|---|---|---|
| Arduino Uno / Nano | Any 5V Arduino | Nano for compact builds |
| Peristaltic Pump Head + DC Motor | 12V DC, 0-100 mL/min | One per dosing channel |
| L298N Motor Driver Module | Or MOSFET + diode per pump | L298N handles 2 pumps |
| 12V Power Supply | 2 A minimum (more for multi-pump) | Regulated switching PSU |
| DS3231 RTC Module | I2C real-time clock | For scheduled dosing |
| Silicone Peristaltic Tubing | Matching pump head ID | Silicone is chemical resistant |
| 16×2 LCD (optional) | I2C interface preferred | For status display |
| Measuring Cylinder (10 mL) | For calibration | Glass or polypropylene |
Circuit Diagram and Wiring
For a single-pump dosing system, the wiring is straightforward. For simplicity and directional control (useful for retracting fluid from the tube after dosing), we use one channel of an L298N motor driver.
Wiring connections:
- 12 V PSU positive → L298N VCC (motor power input)
- 12 V PSU negative → L298N GND + Arduino GND (common ground)
- L298N 5V out → Arduino 5V (powers Arduino from the same supply)
- Arduino Pin 5 (PWM) → L298N ENA (speed control)
- Arduino Pin 8 → L298N IN1 (direction control A)
- Arduino Pin 9 → L298N IN2 (direction control B)
- L298N OUT1, OUT2 → Peristaltic pump motor terminals
For multiple pumps, each additional pump needs its own driver channel or a separate MOSFET switch (if direction reversal isn’t needed). A single IRF520 MOSFET with a 10K gate resistor can switch a single-direction pump from any Arduino digital pin.
For simple single-direction dosing (no reversal):
- Gate of IRF520 → Arduino digital pin (via 10K resistor)
- Drain → Pump motor negative terminal
- Source → GND
- Pump motor positive → 12 V
- 1N4007 diode across motor terminals (cathode toward +12 V) for flyback protection
Calibrating Your Peristaltic Pump
Calibration is the most important step. The goal is to determine exactly how many milliseconds of motor runtime delivers 1 mL of liquid. This calibration factor depends on your specific pump, tubing, and operating voltage.
Calibration procedure:
- Fill the supply reservoir with clean water and prime the tubing (run the pump until water reaches the outlet).
- Place a 10 mL measuring cylinder under the outlet.
- Run the pump for exactly 10,000 ms (10 seconds) using your Arduino code.
- Measure the volume collected in the cylinder.
- Calculate:
ms_per_mL = 10000 / volume_collected - Repeat 3 times and average the results for accuracy.
- Store this value as a constant in your code.
Example: If 10 seconds delivers 8.5 mL, then ms_per_mL = 10000 / 8.5 = 1176 ms/mL. To dose 5 mL, run the pump for 5 × 1176 = 5882 ms.
Factors that affect calibration:
- Motor voltage (higher voltage = faster flow, more mL/sec)
- Tubing wear (flow rate decreases as tubing ages — recalibrate every few months)
- Fluid viscosity (water vs. nutrient solution vs. thick syrups)
- Head pressure (height difference between reservoir and outlet)
12V High Quality DC Mini Submersible Pump
A compact 12V pump suitable for reservoir filling, plant watering, and complementary liquid transfer in your automated dosing setup.
Basic Arduino Dosing Code
Here is a complete Arduino sketch for timed single-pump dosing with calibration support:
// Peristaltic Pump Dosing System
// Pin definitions
const int PUMP_ENA = 5; // PWM speed
const int PUMP_IN1 = 8; // Direction forward
const int PUMP_IN2 = 9; // Direction reverse
// Calibration: milliseconds to deliver 1 mL (run calibration to find this)
const float MS_PER_ML = 1176.0;
void setup() {
pinMode(PUMP_ENA, OUTPUT);
pinMode(PUMP_IN1, OUTPUT);
pinMode(PUMP_IN2, OUTPUT);
stopPump();
Serial.begin(9600);
Serial.println("Peristaltic Pump Dosing System Ready");
Serial.println("Enter dose in mL via Serial (e.g., '5.0')");
}
void runPumpForward(int speed = 255) {
analogWrite(PUMP_ENA, speed);
digitalWrite(PUMP_IN1, HIGH);
digitalWrite(PUMP_IN2, LOW);
}
void runPumpReverse(int speed = 200) {
analogWrite(PUMP_ENA, speed);
digitalWrite(PUMP_IN1, LOW);
digitalWrite(PUMP_IN2, HIGH);
}
void stopPump() {
analogWrite(PUMP_ENA, 0);
digitalWrite(PUMP_IN1, LOW);
digitalWrite(PUMP_IN2, LOW);
}
void doseML(float ml) {
if (ml 0 && ml <= 100) {
doseML(ml);
} else {
Serial.println("Enter a value between 0.1 and 100 mL");
}
// Clear serial buffer
while (Serial.available()) Serial.read();
}
}
The short reverse pulse after each dose retracts fluid slightly back into the tube, preventing drips from forming at the outlet nozzle — an important detail for clean, precise dosing.
Scheduled Dosing with Real-Time Clock
For automated hydroponic or aquarium systems, you want doses to happen at scheduled times (e.g., every 6 hours), not just on demand. Adding a DS3231 RTC module gives your Arduino accurate timekeeping even through power cycles:
#include <Wire.h>
#include <RTClib.h>
RTC_DS3231 rtc;
// Dose schedule: dose at 08:00 and 20:00 every day
const int DOSE_HOURS[] = {8, 20};
const float DOSE_AMOUNT_ML = 10.0;
bool dosed[2] = {false, false}; // Track if today's dose was given
void setup() {
// ... (pump pins setup as before)
Wire.begin();
rtc.begin();
// Uncomment once to set RTC time:
// rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
void loop() {
DateTime now = rtc.now();
for (int i = 0; i < 2; i++) {
if (now.hour() == DOSE_HOURS[i] && now.minute() == 0 && !dosed[i]) {
doseML(DOSE_AMOUNT_ML);
dosed[i] = true;
}
// Reset flag after the scheduled hour passes
if (now.hour() != DOSE_HOURS[i]) {
dosed[i] = false;
}
}
delay(30000); // Check every 30 seconds
}
Multi-Pump System for Nutrient Dosing
A complete hydroponic nutrient system typically needs at least three pumps: Part A nutrient, Part B nutrient, and pH Down solution. Here’s how to structure a three-pump system:
Use three separate MOSFET switches (or two L298N modules) — one per pump. Define a structure for each pump’s configuration:
struct Pump {
int pin; // MOSFET gate pin
float msPerML; // Calibration factor
const char* name;
};
Pump pumps[] = {
{4, 1176.0, "Nutrient A"},
{5, 1200.0, "Nutrient B"},
{6, 1050.0, "pH Down"}
};
void doseChannel(int pumpIndex, float ml) {
unsigned long runTime = (unsigned long)(ml * pumps[pumpIndex].msPerML);
Serial.print("Dosing "); Serial.print(pumps[pumpIndex].name);
Serial.print(" - "); Serial.print(ml); Serial.println(" mL");
digitalWrite(pumps[pumpIndex].pin, HIGH);
delay(runTime);
digitalWrite(pumps[pumpIndex].pin, LOW);
delay(2000); // Wait between doses to avoid overflow
}
void fullNutrientDose() {
doseChannel(0, 10.0); // 10 mL Part A
doseChannel(1, 10.0); // 10 mL Part B
doseChannel(2, 2.0); // 2 mL pH Down
}
Always dose each pump sequentially, not simultaneously, to keep current draw from spiking above your power supply’s rating.
14L Water Pump
High-volume water pump for reservoir filling, recirculation, and irrigation in larger hydroponic systems alongside your peristaltic dosing pumps.
Flow Monitoring and Error Detection
A basic dosing system trusts that the pump ran for the right amount of time. For higher reliability, add a small flow sensor (YF-S201 or similar) inline with the tubing. The flow sensor outputs pulses proportional to flow rate, which you can count with Arduino’s interrupt pins.
Basic flow monitoring approach:
- Count pulses during the dose run using
attachInterrupt() - Calculate volume from pulse count (each sensor has a pulses/litre constant from its datasheet)
- Compare expected vs. actual volume
- If actual volume is < 80% of expected, trigger an alert (LED, buzzer, or text message via GSM module) indicating a tubing blockage or empty reservoir
Enclosure and Tubing Considerations
For reliable long-term operation of your dosing system, pay attention to the physical build:
Tubing
- Use silicone tubing for the pump head — it’s flexible enough for repeated compression and is chemically resistant to most fertilisers, acids, and food-grade liquids
- Avoid PVC tubing with acidic solutions (pH Down / sulphuric acid) — silicone is safer
- Replace pump head tubing every 3–6 months for critical applications; silicone fatigues with constant compression
Enclosure
- Mount all electronics in a weatherproof (IP65) enclosure if used near water
- Route tubing through grommets with drip loops — if a tube leaks, liquid should drip down, not into the electronics
- Label each pump’s tubing with permanent marker or colour-coded tubing clips
Power
- Use a 12 V, 2 A (minimum) switching power supply for up to 3 pumps
- Add an in-line fuse (2 A) in the 12 V positive line
- Add 100 µF electrolytic capacitors at each pump motor’s power terminals to reduce EMI
24VDC 350 GPH Bilge Submersible Pump
High-capacity submersible pump for reservoir emptying, tank-to-tank transfers, and emergency drainage in large hydroponic and water management systems.
Recommended Products
Complete your peristaltic dosing system with these components from Zbotic:
12V High Quality DC Mini Submersible Pump
Use for reservoir recirculation and maintaining even nutrient concentration in your hydroponic or aquarium dosing setup.
25GA-370 12V 12RPM DC Reducer Gear Motor
This slow, high-torque gear motor can power custom peristaltic pump heads when paired with appropriate tubing and a 3D-printed pump housing.
Frequently Asked Questions
How accurate is a peristaltic pump for dosing?
After calibration, a typical peristaltic pump system can achieve ±2–5% accuracy for doses above 1 mL. For doses below 1 mL, accuracy decreases due to startup inertia and the time it takes for the motor to reach full speed. For very small doses, use a smaller tubing ID or reduce the motor voltage to slow the flow rate.
Can I use a peristaltic pump for corrosive chemicals like acid?
Yes — silicone tubing is resistant to most acids at low concentrations (pH 1–14 range). For concentrated acids or solvents, use PTFE (Teflon) tubing instead. The pump head mechanism never contacts the fluid, so only the tubing material matters for chemical compatibility.
How do I prevent the pump from dripping between doses?
Run the pump briefly in reverse (0.2–0.5 mL equivalent) immediately after each dose. This retracts fluid back into the tube and prevents surface tension from pulling a drip off the nozzle. The code example above includes this technique.
What flow rate do peristaltic pumps achieve?
Flow rate depends on tubing ID and motor speed. Common hobbyist peristaltic pumps with 3 mm ID tubing run at 20–100 mL/min at rated voltage. Larger 8 mm ID pumps can reach 1,000 mL/min. For dosing applications, slower flow rates are more accurate — consider running the pump at 70% PWM for better volume control.
Do I need to recalibrate after replacing the tubing?
Yes, always recalibrate after replacing or changing tubing. New tubing has slightly different elasticity than worn tubing, which changes the volume displaced per rotation. Even the same type of tubing from different batches can vary by 5–10% in flow rate.
Can Arduino sleep between doses to save power?
Yes. Use the Arduino LowPower library with the DS3231 RTC’s alarm interrupt to wake the Arduino only when a dose is needed. Between doses, the microcontroller can sleep at approximately 20 µA, extending battery life massively for off-grid installations.
Conclusion
Building a DIY peristaltic pump dosing system with Arduino is one of the most practical and rewarding electronics projects for plant growers, aquarium hobbyists, and homebrewers. The combination of precise volume control, chemical isolation, and easy Arduino integration makes peristaltic pumps an ideal choice for automated liquid management.
Start with a single-pump basic setup to learn calibration and timing, then expand to multi-pump configurations with RTC scheduling and flow monitoring as your confidence grows. The investment in a well-built dosing system pays dividends in plant health, consistency, and the satisfaction of watching automation work reliably day after day.
Explore Zbotic’s full range of pumps and motors to find the right components for your automated dosing project.
Add comment