Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Sarena Berg
Published

Dog/Cat Feeder

This machine will work so that if you send a text message, it will dispense your animals food without you having to get out of bed.

BeginnerShowcase (no instructions)10 hours931
Dog/Cat Feeder

Things used in this project

Hardware components

Photon
Particle Photon
×1
SparkFun ESP8266 Thing - Dev Board
SparkFun ESP8266 Thing - Dev Board
×1

Software apps and online services

Maker service
IFTTT Maker service
Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Power Drill
Wire stripper
Exacto blad

Story

Read more

Schematics

Wiring

Code

Code

C/C++
  Servo myservo;
    
    int servoPin = A5; 
    int soundPin = D0;
    
    
    void setup()
    {
    
      myservo.attach(servoPin);  
      myservo.write(0);
      delay(1000);
      myservo.detach();
      
      Particle.function("feed",triggerFeed);
    }
    
    void loop(){
        
    }
    
    int triggerFeed(String command)
    {
    
    
      //adapted from "Alexa: The Dog Feeder" by Team reid (Malia Young Reid and Christopher Reid)
         if (command=="feed")
            {
            digitalWrite(soundPin, HIGH);
            delay(500);
           digitalWrite(soundPin, LOW);
            myservo.attach(servoPin);
            myservo.write(0);
            delay(2000);
            myservo.write(360);
            delay(2000);
             myservo.detach();
          Particle.publish("doggy_time", "time");
          return 1;
          } else {
              return -1;
              }
        
        }

Credits

Sarena Berg
1 project • 0 followers
Contact
Thanks to Gabriel Roche.

Comments

Please log in or sign up to comment.