issaom
Published © GPL3+

Self-service cat feeder

You can learn to use modern electronics and get your own food :-)?

BeginnerFull instructions provided13,428
Self-service cat feeder

Things used in this project

Story

Read more

Custom parts and enclosures

feeder_for_cat_electrical_circuit_diagram_Hp1aj46FH7.jpg

Schematics

Feeder for cat Electrical circuit diagram

Code

feeder_for_cat.ino

Arduino
#include <Servo.h>
int CatButton;  //  
Servo servo1;   //  servo  Servo

void setup() {

  pinMode(3, OUTPUT);     //  3 
  pinMode(11, OUTPUT);    // 
  servo1.attach(9);       //     

// 
  analogWrite(11, 20); //   
  servo1.write(10);    //       
  delay(250);          //       
  analogWrite(11, 0);  //   

}

void loop() {

  CatButton = analogRead(A0); //      

  if (CatButton > 700) {      //       
    analogWrite(11, 20);      //     ()     
    digitalWrite(3, HIGH);    //    
    servo1.write((map(analogRead(A1), 0, 1024, 0, 180))); //    
    delay(250);               //     
    servo1.write(10);         //  
    delay(250);               //     
    digitalWrite(3, LOW);     //    
    analogWrite(11, 0);       //    
    delay(500);               //       
  }

}

Credits

issaom

issaom

6 projects • 16 followers

Comments