Hello everyone,
After getting to work with arduinos in university, I got quite interested and wanted to make a project myself.
And since my plants allways die of dehydration i choose to engineer an arduino that waters plants for me.
In hindsight there are probably better ways to do this but I wanted to use a steppermotor with a spindle to move a hose from pot to pot. And a simple pump to push the water into the pots. It’s controlled by an uno combined with an ancient adafruit v1clone. (Therefore I’m using the old library)
The code itself was pretty easy and quickly done. The problem just arised as i was trying my system on a test build.
If I power the system via usb(PC) the pump barely has enough power to lift the water 3cm, the stepper is silent and doing its job of moving the hose good.
But if I power it via 9v 1A the Stepper Motor is absurdly loud and stuttering sometimes, while the pump is shooting water.
Both ways I power the arduino (not the motor shield) directly if this makes a difference please let me know.
I got an arduino mega and adafruit v2.3 motor shield from university. I allready tried to fit my parts on this combination but it was the same outcome.
I guess in one scenario I’m underpowering both parts and in the other one I’m overpowering them.
The dc pump is pretty cheap and I don’t really care if it dies someday, the stepper is the Quimat nema 17 qd04, bipolar, 200steps/rotation, phase of 2A.
Now to my question:
Is there a way to keep the stepper silent while using 9v1a?
i allready tried all the Stepper settings (Single Double...) it doesnt help at all ^^
Maybe by cutting the maximum voltage/current if yes is this possible in programming or do I need other parts ?
Thank you in advance
#include <AFMotor.h>
#include <ArduinoSTL.h>
using namespace std;
vector<int> Potwatertime {200, 2, 2, 2, 2, 2};
int place;
int check;
int waterio;
AF_DCMotor MotorPump1(1, MOTOR12_64KHZ);
AF_DCMotor MotorPump2(2, MOTOR12_64KHZ);
AF_Stepper MotorStepper(200, 2);
void setup() {
// put your setup code here, to run once:
MotorPump1.setSpeed(200);
MotorPump2.run(RELEASE);
MotorPump2.setSpeed(200);
MotorPump2.run(RELEASE);
MotorStepper.setSpeed(20);
pinMode(2, INPUT_PULLUP);
pinMode(13, OUTPUT);
place = 0;
check = 1;
}
void loop() {
if (digitalRead(2) == LOW) {
while (place<=4){
water(Potwatertime[place]);
if (place==5){
break;
}
nextPosition();
}
backtostart();
}
}
void water(int timetowater) {
MotorPump1.run(FORWARD);
MotorPump2.run(FORWARD);
while (timetowater >= 1) {
delay(1000);
timetowater = timetowater - 1;
}
MotorPump1.run(RELEASE);
MotorPump2.run(RELEASE);
}
void backtostart() {
while (place >= 1) {
MotorStepper.step(4750, FORWARD, SINGLE);
place = place - 1;
}
}
void nextPosition() {
if (place <= 5) {
MotorStepper.step(4750, BACKWARD, SINGLE);
place = place + 1;
}
}