Edward Sandoval
Published

Lane Tech HS - PCL -Pet Feeder

An automatic pellet dispenser designed to feed your dog or cat without lifting a finger

IntermediateWork in progress2 days878
Lane Tech HS - PCL -Pet Feeder

Things used in this project

Hardware components

Photon
Particle Photon
×1
Servos (Tower Pro MG996R)
×1
Adafruit force sensor
×1
Breadboard (generic)
Breadboard (generic)
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Blynk
Blynk

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Bowl

Code

Code for Feeder

Arduino
This was coded using Particle's IDE, which is very similar to Arduino's IDE
you will also need to use the Blynk app to set up the email notifications
// This #include statement was automatically added by the Particle IDE.
#define BLYNK_PRINT Serial 
#include <blynk.h>

char auth[] = "<Insert your Blynk authentication pin here>";

Servo myservo;

int pos = 0;
bool foodThere;
bool open;

int led = D1;
int sensorPin = A1;
int value;

int servoLock = 0;

int emailSent = 1;

void setup() {
  pinMode(led, OUTPUT); 
  Serial.begin(9600);
  pinMode(2, OUTPUT);
  myservo.attach(2);
  
  Blynk.begin(auth);
}

void loop() {
    
  value = analogRead(sensorPin);       //Read and save analog value from touch sensor
  value = value/10;
  Serial.println(value);               //Print value
  
  if (value > 100){
    digitalWrite(led, HIGH);
    foodThere = true;
    emailSent=0;
    delay(500);
  }
  else {
    digitalWrite(led, LOW); 
    foodThere = false;
    emailSent = 1;
  }

  delay(500);
  
  if( foodThere == true && servoLock == 0){
    myservo.write(170);
    delay(1000);
    servoLock = 1;
  }
  
  if( foodThere == false && servoLock == 1){
    myservo.write(5);
    delay(5000);
    servoLock = 0;
    myservo.write(170);
    delay(5000);
  }
  
  if( foodThere == false && servoLock == 0 ){
    delay(2000);
    if( foodThere == false && servoLock == 0 && emailSent == 1){
        Blynk.email("Insert Your Email Here", "Food Levels", "Your Conatiner Is Empty!");
       
    }
  }
}

Credits

Edward Sandoval

Edward Sandoval

2 projects • 1 follower

Comments