Malia Young ReidChristopher Reid
Published © GPL3+

Alexa: The Dog Feeder

Ever need to feed your dog but you're not home? With the help of Alexa and the Internet of Things you can now feed your dog from anywhere!

BeginnerFull instructions provided2 hours2,081
Alexa: The Dog Feeder

Things used in this project

Hardware components

Echo Dot
Amazon Alexa Echo Dot
×1
Photon
Particle Photon
×2
Servos (Tower Pro MG996R)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Dry Food Dispenser
×1
wood screws
×4
wood
×4
Cable Ties (10 Pack)
OpenBuilds Cable Ties (10 Pack)
×4
eye bolts
×4

Software apps and online services

Amazon Alexa service
IFTTT Amazon Alexa service
Google Sheets
Google Sheets

Hand tools and fabrication machines

Drill

Story

Read more

Schematics

Photon wiring

Photon Circuit Diagram

A5 - Yellow Servo Wire
GND - Black Servo Wire
3V3 - Red Servo Wire

Second Photon

The second photon is only connected to a power source

Code

Dispense Dog Food

C/C++
This photon powers the servo motor. Here the program is triggered by Alexa. Using IFTTT Alexa communicates to the servo.
Servo myservo;

int servoPin = A5; 



void setup()
{

  myservo.attach(servoPin);  
  
  Particle.function("feed",triggerFeed);
}



int triggerFeed(String command)
{


 if (command=="feed")
    {
     
        myservo.attach(servoPin);
        myservo.write(0);
        delay(2000);
        myservo.write(360);
        delay(2000);
        myservo.write(0);
        myservo.detach();
        delay(2000);
        myservo.attach(servoPin);
        myservo.write(0);
        delay(2000);
        myservo.write(360);
        delay(2000);
        myservo.write(0);
        myservo.detach();
      Particle.publish("doggy_time", "time");
 
 
    }

}

Text message & Graphing function

C/C++
This is the communication of the first photon to the second photon. When the second photon recognizes the data published by the other photon it sends a text and graphs the data using IFTTT.
// We start with the setup function.

void setup() {

  Particle.subscribe("doggy_time", text);
}
void text(const char *event, const char *data)
{
 

  if (strcmp(data,"time")==0) { 
      Particle.publish("doggy_text","time2"); 
      Particle.publish("doggy_graph","1");
      
      
  }
  }

Credits

Malia Young Reid

Malia Young Reid

1 project • 0 followers
Christopher Reid

Christopher Reid

1 project • 0 followers

Comments