pet feeder
We calculate the final price from your selected file. You review and accept it before payment.
Saved on this device.
the button must be normaly open
- Rating
- 0 / 5
- Likes
- 2
- Downloads
- 22
- Makes
- 0
- Views
- 200
- Reviews
- 0
Updated at source:
Model information
- Source
- Printables
- Category
- Pets
- License
- Creative Commons — Attribution — Noncommercial — NoDerivatives
material:
- steper motor
- relè
- normally open button
- steper motor driver
- arduino uno
- 2 screw
- 2 nut
circuit : https://www.tinkercad.com/things/4Va9ai9c75P-smooth-juttuli
sketch:
#include <Stepper.h>#define STEPS_PER_REV 200 //Number of steps for one rotation
//Stepper motor control pin
#define STEP_PIN1 8
#define STEP_PIN2 9
#define STEP_PIN3 10
#define STEP_PIN4 11
Stepper stepper(STEPS_PER_REV, STEP_PIN1, STEP_PIN2, STEP_PIN3, STEP_PIN4);
#define BUTTON_PIN 2 // Pin botton
#define RELAY_PIN 7 // Pin relè
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(RELAY_PIN, LOW);
stepper.setSpeed(60);
}
void loop() {
if (digitalRead(BUTTON_PIN) == LOW) {
digitalWrite(RELAY_PIN, HIGH);
unsigned long startTime = millis();
while (millis() - startTime < 10000) {
stepper.step(STEPS_PER_REV / 10);
}
digitalWrite(RELAY_PIN, LOW);
}
}
