Hello!
I'm doing hydroponics project with MKR 1010-board. I have two digital peristaltic pumps which I'm using for dosing nutrients. Gravity__Digital_Peristaltic_Pump_SKU__DFR0523-DFRobot. I have couple of questions about those pumps.
Pumps should pump same amount of nutrient solution, components A&B at the same time. Now I have tested those pumps and results were that another pump pumps more than another. In my sketch myservo3 pumps always more than myservo2. myservo2 pumps 0,85 times liquid than myservo3. Any ideas what could cause this? Im using external 5V power to power up pumps (switching power supply 230v/3/4,5/5/6/7,5/9/12V 27W 2250mA)
Another question about those pumps: Pumps dont wake up, if they are being off for a while. Then when I disconnect electrical connector and plug it in again those pumps start working normally. Any suggestions what I can do to solve this?
#define servo1Pin 6
#define servo2Pin 5
#define servo3Pin 4
#include <Servo.h>
Servo myservo1;
Servo myservo2;
Servo myservo3;
manualDoseCounter = 0; //manualDoseCounter is Cloud variable
unsigned long servoStartTime = 0;
const unsigned long servoRunTime = 3000; //
bool servoActive2 = false; // Servon activity state
int buttonState = 0;
void setup() {
myservo1.attach(servo1Pin);
myservo2.attach(servo2Pin);
myservo3.attach(servo3Pin);
myservo1.write(90); // 90 is stop
myservo2.write(90); // write stop so that they dont start when powering up
myservo3.write(90);
}
void loop() {
manualDoseF();
}
void manualDoseF() {
buttonState = button; // button is Cloud variable
if (buttonState == HIGH && !servoActive2) {
servoStartTime = millis(); //
myservo2.write(0); // 0 is servo on
myservo3.write(0);
servoActive2 = true; //
manualDoseCounter++;
}
if (servoActive2 && millis() - servoStartTime >= servoRunTime) { // If servo have runned servoRunTime
myservo2.write(90); // Stop servos
myservo3.write(90);
servoActive2 = false; // Aseta servon aktiivisuuden tila epätodeksi
}
}
Pumps need to be calibrated, even those with a stepper instead of a dc motor. Flow rate is not linear: the faster it spins, the higher the loss. The hose is not wear resistent: the older the hose, the less throughput. The inner diameter of the hose is not constant across batches. ...
That circuit appears to have the Arduino supply the pump power , which can’t be correct .
You would need to calibrate these pumps, esp if the liquids have different physical properties , have different pipe runs , reservoir heights .
The page you linked to says
“ Q1. How to accuracy control the flow rate?
A1. It is better to make a calibration before usage, you can put the pump in the water, get power, and calculate the time it fill up the cylinder, Then, you will know the flow rate in each second”
@Railroader
When running manualDoseF() They work normally many hours, but when pumps not been used lets say 2 days they dont start, until disconnect connector (is it called JST-connector?) and place it back again. After that pumps work normally again. I have to do more testing... @zwieblum
I dont have any idea how I could calibrate those pumps. Maybe I just have to try to find correct servo speed, for another pump so that pumps pumpping equal amount each. Or another option is to dilute another fertilizer-liquid to mach that pumping. Pumps are new and hoses are new. @jim-p
I know that in my code I'm only pumpping couple of seconds, but I did many tests with pumps pumpping over 100ml each. Every time results were same. Another pumps 0,85 less than another. @TomGeorge
I insert some pictures of my project. I know that quite a mess...
Hi,
Can I suggest, if you haven't done so already, write some code to JUST drive ONE pump.
Measure its performance.
Then swap pumps and do the same, and also for the third.
Basically, put your existing code away for the moment and write some diagnostic code, to check your pumps. Nothing else in the code but pump code.
How I can do that? What do you mean by it? Calibrate by changing myservo command? For example if I normally write:
myservo2.write(0);
should I write?
myservo2.write(10);
Is this what you mean by calibrating pumps? Changing speed of servo?