Easy Pump arduino stepper 3D model preview
View source Save
0 downloads 105 likes 7,138 views Paid price

About this 3D model

Easy pump with arduino and Stepper motor.https://youtu.be/dSlVYtNwtloi use: 6x bearings: 10x5x4 mmNEMA 17Stepper motor with 5mm shaftsteper driver pololu A4988Arduino Nanorezistor 10kswitchsilicone pipe 5x3mmsome screws M3,M2 and nuts arduio code:int x;const int buttonPin = 2;int buttonState = 0; void setup(){pinMode(6, OUTPUT); // EnablepinMode(5, OUTPUT); // SteppinMode(4, OUTPUT); // DirdigitalWrite(6, LOW); // Set Enable lowpinMode(buttonPin, INPUT);Serial.begin(9600); } void loop(){buttonState = digitalRead(buttonPin); Serial.println(buttonState); if (buttonState == HIGH) { digitalWrite(6, LOW); // Set Enable lowdigitalWrite(4, HIGH); // Set Dir high for (x = 0; x < 4000; x++) // Loop 200 times{ digitalWrite(5, HIGH); // Output high delayMicroseconds(300); // Wait 1/2 a ms digitalWrite(5, LOW); // Output low delayMicroseconds(300); // Wait 1/2 a ms}delay(1000); // pause one second}else { digitalWrite(6, HIGH); // Set Enable low } }