ESE 111 Automated Pet Feeder Technical Description Bisher Haddadin & Omar Hafez A personal problem we both faced as pet-owners was filling a pet’s bowl with food which is a time-consuming and tedious task to be performing multiple times a day, every single day of the week. This is also related to the problem of pet-owners not being able to travel and leave their pet behind for a few days or even longer. After having an ideation session, this inspired us to come up with the concept for our Automated Pet Feeder. The approach we adopted was find a need in the market that we satisfy with the creation of our product as opposed to trying to fit a technical product to some need in the market. This is perhaps one of the most important reasons our product concept led to the creation of a likeable and marketable product prototype. We now had this wonderful idea that we were trying to implement using our knowledge of embedded systems based on the Arduino microcontroller. It was time to go to the drawing board. You can see below the very basic prototype plan that involved using a light-gate that will detect the level of food in the bowl and using a lower threshold in order to detect when the bowl was empty. It sounded very promising on paper.

We left the drawing board and headed straight to the lab, enthusiastic as we were. We then started discussing our idea with the lab engineers and technicians attempting to find any potential failures of the system and any possible improvements. We started thinking of each component of our system separately and considering that the light-gates one was the most ambitious, it was the first to be scrutinized. After thorough research, we discovered that the light gate beam might be scattered by the surface of our bowl even if it was clear. This would have led to inconsistent readings and the lower threshold would vary greatly and be inaccurate. We started brainstorming for alternatives and decided that using a strain gauge-based load cell would be the most feasible alternative in order to find the lower threshold of food in the bowl (using mass this time instead of the length of column of food in the bowl). With this alternative proposed, we started procuring parts that weren’t readily available in the lab. These were: The load cell, the load cell amplifier (since the voltage change the load cell produces is too small to be directly read by the Arduino), the dispenser and stand and the bowl to be used. We also got 3 Arduinos, breadboards, a servo motor, two Bluetooth modules, an Ethernet shield and connecting wires. We decided that we will be 3D printing the part that will be used to open and close the dispenser and the part connecting the servo to that stopper that will be used to rotate it 90 degrees to open and close it. The apparatus setup is shown in the following pictures:

We began with the servo-load cell system. The load cell needed to be calibrated to give accurate readings of weight by using a known weight and editing the calibration factor. The following code was uploaded to the Arduino that connected the servo to the load cell. It opens the servo by rotating it by 90 degrees and updates the value of the Bluetooth serial with an ‘H’ if the weight is below the threshold. It uses the HX711 library (for the load amplifier), the servo library and the SoftwareSerial library for Bluetooth. /* Load cell-servo system: Arduino pin 2 -> HX711 CLK 3 -> DOUT 5V -> VCC GND -> GND Most/ any pin on the Arduino Uno will be compatible with DOUT/CLK. The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine. */

include "HX711.h"

include

include

define DOUT 3

define CLK 2

HX711 scale(DOUT, CLK); SoftwareSerial BTSerial(7, 6); //RX TX float calibration_factor = -21260; Servo serv; double weight = 0;

void setup() { BTSerial.begin(9600); Serial.begin(9600); Serial.println("Weight Readings:"); serv.attach(10); // attaches the servo on pin 10 to the servo object serv.write(90); scale.set_scale(calibration_factor); scale.tare(); //Reset the scale to 0 } void loop() { scale.set_scale(calibration_factor); //Adjust to this calibration factor Serial.print("Reading: "); Serial.print(scale.get_units()); Serial.print(" kg"); Serial.println(); weight = (scale.get_units()); if (weight < 0.05) { //if the weight is less than the lower threshold, rotate servo delay(2000); serv.write(0); delay(900); serv.write(90); BTSerial.println("H"); delay(900); } else { BTSerial.println("L"); } delay(100); } Afterwards, this information is relayed using Bluetooth modules to another Arduino which is governed by the following code:

include

SoftwareSerial BTSerial(7, 6); //RX TX void setup() { BTSerial.begin(9600); Serial.begin(9600); } void loop() { if (BTSerial.available()) { char inChar = (char) BTSerial.read(); Serial.println(inChar); if (inChar == 'H') { digitalWrite(2, HIGH); } else { digitalWrite(2, LOW); } } } This then uses digitalWrite() and digitalRead() functions to relay the threshold to our load cell-e-mail system which serves to give our product a greater utility by sending an e-mail notification to user letting them know that the pet has completed another bowl-full. This allows the owner of the pet to keep track of the pet’s eating habits which allows the user to know just how frequently the pet is eating. This can prevent pet obesity and other diet-related issues. We came up with this idea in order to further make this product marketable and aesthetic for pet-owners. The Arduino code that is responsible for sending the e-mail uses the Temboo interface and library and has been edited by us to use the lower threshold and send an e-mail when the bowl is emptied. It is found below:

include

include

include

include

include

include

include "TembooAccount.h" // Contains Temboo account information

byte ethernetMACAddress[] = ETHERNET_SHIELD_MAC; EthernetClient client; int numRuns = 1; // Execution count, so this doesn't run forever int maxRuns = 10000; // Maximum number of times the Choreo should be executed int val = 0; void setup() { Serial.begin(9600);

// For debugging, wait until the serial console is connected delay(4000); while(!Serial); Serial.print("DHCP:"); if (Ethernet.begin(ethernetMACAddress) == 0) { Serial.println("FAIL"); while(true); } Serial.println("OK"); delay(5000); Serial.println("Setup complete.\n"); } void loop() { val = digitalRead(2); if (numRuns <= maxRuns && val == HIGH) { Serial.println("Running SendEmail - Run #" + String(numRuns++)); TembooChoreo SendEmailChoreo(client); // Invoke the Temboo client SendEmailChoreo.begin(); // Set Temboo account credentials SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT); SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME); SendEmailChoreo.setAppKey(TEMBOO_APP_KEY); // Set Choreo inputs String MessageBodyValue = "Your pet has just finished another bowl-full! Bon appetit!"; SendEmailChoreo.addInput("MessageBody", MessageBodyValue); String SubjectValue = "Automated Pet Feeder Notification"; SendEmailChoreo.addInput("Subject", SubjectValue); String PasswordValue = "axhgbkvicwnrzzfd"; SendEmailChoreo.addInput("Password", PasswordValue); String UsernameValue = "bisher.haddadin@gmail.com"; SendEmailChoreo.addInput("Username", UsernameValue); String ToAddressValue = "omarhafez3300@gmail.com"; SendEmailChoreo.addInput("ToAddress", ToAddressValue); // Identify the Choreo to run SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail"); // Run the Choreo; when results are available, print them to serial SendEmailChoreo.run();

  while(SendEmailChoreo.available()) {
    char c = SendEmailChoreo.read();
    Serial.print(c);
  }
  SendEmailChoreo.close();
}
Serial.println("\nWaiting...\n");
delay(15000); // wait 15 seconds between SendEmail calls

} The e-mail notification sends the following message: Your pet has just finished another bowl-full! Bon appetit!

Built With

Share this project:
×

Updates

Bisher Haddadin posted an update

Description: This device consists of a 3D printed cylindrical container that has a valve at the bottom of it. The user manually fills the container with the pet food and by use of an accelerometer we detect the presence of the pet nearby the bowl which is also 3D printed. Both containers must be made of clear plastic which would allow us to use light-gates in order to detect how full the cylinder and the bowl are. The valve operates by the use of a motor installed at the bottom of the cylinder. This will all be translated into code that will control the function of the said device.

Log in or sign up for Devpost to join the conversation.