Reference
Last revision 2026/01/05
This article offers an in-depth look at peristaltic pumps, focusing on their communication protocols, API functionalities, and operational principles, providing readers with essential information to effectively control fluid flow using precise PPM signals.
Library
You can find the library for this peristaltic pump from this Github link : https://github.com/DFRobot/GravityPump
Communication Protocol Description
The motor driver board uses the PPM signal to control the pump. The corresponding relationship is as follows:
| PPM Signal | Peristaltic Pump Status (Top View) |
|---|---|
| 500 ~ 1400us (0~81°) | Clockwise maximum speed rotation |
| 1400 ~ 1600us (81~99°) | Stop |
| 1600 ~ 2500us (99~180°) | Counterclockwise maximum speed rotation |
In addition, the closer to 500us(0°) or 2500us(180°), the faster the flow rate speed is; when the value is closer to 90°, the slower the motor speed. Therefore, according to the requirement, you can set the appropriate angle value to adjust the motor speed, to achieve the purpose of controlling the flow rate.
API Description
- void update();
get the state from system, need to be put in the loop.
- void setPin(int pin);
set the pin for GravityPump.
- void calFlowRate(int speed = 180);
Calibration function.the speed parameter is running speed what you needed.
please input the "STARTCAL" in serial to start cal
Pump some liquid in some secs
please input the actual mumber in serial by "SETCAL:XX" cal end
- void pumpDriver(int speed, unsigned long runTime);
the basic pump function, have to given speed in number(0 to 180. 90 for stop, 0 and 180 is max speed in each direction.)and runing time in milliseced.
- float timerPump(unsigned long runTime);
timer pump function,base on the basic function.the function need to given the running time then the pump will dosing as long as your have given and return the quantitation. if you have Calibration, the number will be close to result.
- float flowPump(float quantitation);
quantification setting pump function,base on the basic function,the function need to given a quantification. Then the pump will dosing the quantification in given number. if you have Calibration, the number will be close to result.
- void getFlowRateAndSpeed();
flowrate and speed reading from EEPROM
- void stop();
stop function. whenever you use this function the pump will stop immediately.
Was this article helpful?
