1 / 9
Automatic Pet Food Dispenser with Adjustable Portions — zdjęcie 1
1 / 9

Automatic Pet Food Dispenser with Adjustable Portions

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

This device dispenses pet food when a bowl is placed under it, you are able to adjust how much is dispensed each time

Ocena
0 / 5
Polubienia
3
Pobrania
16
Wydruki
0
Wyświetlenia
249
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Kategoria
Electronics
Licencja
Standard Digital File License

This pet food dispenser has been made to solve the issue of inconsistent portions when serving dry pet food, this is an issue with multiple pets and ensuring they all get an equal portion is important. The dispenser has a sensor that detects when a bowl is present and it will then dispense the pet food, the amount that is dispensed can be changed to fit the needs of your pets. This dispenser is very simple to use - simply place a bowl under it and in a few seconds it will have just the right amount of food in it.

Demonstration:

How To Refill:

 

Functions:

  • A servo moves a slide up, to block the path of the food, or down, to allow food to pass through to dispense pet food quickly
  • A servo rotates and allows the food dispensing area to be refilled with pet food from the hopper
  • A WS2812 (RGB LED) shows the user when pet food is being dispensed, to show that the bowl has been detected
  • A distance sensor detects if a bowl is present, it will only dispense food once until the bowl has been removed

 

Hardware Used:

Software Used:

  • Autodesk Fusion
  • Arduino IDE
  • Fritzing
  • Bambu Studio

Wiring Diagram:

Below are 2 wiring diagrams, one without the 5V and GND wiring (to simplify it so you can follow the wires more easily), one has everything. Please note that WS2812 and VL6180 components were not present in the software used (Fritzing), so I had to use similar components but the wiring is correct

For the power supply I connected the USB-C Connecter Jack to VIN and GND on the Arduino

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Code

Please ensure the following libraries are installed so the code functions correctly:

  • Adafruit_VL6180X
  • Adafruit_NeoPixel

The code has been designed in a way so that it is easy to adjust. Variables such as the bowl detection threshold, servo angles, LED colour and adjusting timings (to adjust portion) can be easily changed.

 

#include <Adafruit_VL6180X.h>
#include <Adafruit_NeoPixel.h>
#include <Servo.h>

#define PIN 6        // WS2812 LED data pin
#define NUMPIXELS 1  // Number of WS2812 LEDs used
#define THRESHOLD 38 // Distance threshold for bowl detection (mm)

Adafruit_VL6180X vl = Adafruit_VL6180X();  
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

Servo dispenseServo;  
Servo refillServo;    

int dispensePin = 9;  
int refillPin = 10;  

int dispenseClosed = 180;  
int dispenseOpen = 95;    
int refillClosed = 35;    
int refillOpen = 0;        

int brightness = 255;  
unsigned long lastBowlTime = 0;
bool dispensing = false;  
bool bowlDetected = false;  

void setup() {
  Serial.begin(9600);  
  pixels.begin();    
  pixels.setBrightness(brightness);  
  pixels.show();      

  dispenseServo.attach(dispensePin);
  refillServo.attach(refillPin);

  dispenseServo.write(dispenseClosed);  
  refillServo.write(refillClosed);      

  if (!vl.begin()) {
    Serial.println("Failed to initialize VL6180X sensor.");
    while (1);  // Halt if sensor setup fails
  }

  Serial.println("System ready.");
}

void loop() {
  int distance = vl.readRange();

  if (distance < 0) {
    Serial.println("Failed to read distance.");
    return;
  }

  Serial.print("Distance: ");
  Serial.println(distance);

  if (distance < THRESHOLD && !dispensing && !bowlDetected) {
    Serial.println("Bowl detected! Dispensing...");
    bowlDetected = true;
    dispenseFood();
  }

  if (distance > THRESHOLD && dispensing) {
    Serial.println("Bowl removed. Closing dispenser.");
    closeDispenser();
  }

  if (distance > THRESHOLD && bowlDetected) {
    bowlDetected = false;
    Serial.println("Waiting for bowl to be detected again.");
  }

  if (bowlDetected && distance < THRESHOLD) {
    return; // Pause until bowl is removed
  }
}

void dispenseFood() {
  dispensing = true;
 
  // Fade LED on
  for (int i = 0; i <= 255; i++) {
    pixels.setPixelColor(0, pixels.Color(0, 0, i));  
    pixels.show();
    delay(5);
  }

  dispenseServo.write(dispenseOpen);  
  delay(1500);  // Dispense duration
 
  dispenseServo.write(dispenseClosed);  

  // Fade LED back to off
  for (int i = 255; i >= 0; i--) {
    pixels.setPixelColor(0, pixels.Color(0, 0, i));
    pixels.show();
    delay(5);
  }

  delay(10);  // Short pause before refill

  refillServo.write(refillOpen);  
  delay(1000);  // Refill duration change to adjust portion
  refillServo.write(refillClosed);  

  Serial.println("Dispensing complete.");

  dispensing = false;
  lastBowlTime = millis();
}

void closeDispenser() {
  dispenseServo.write(dispenseClosed);
  Serial.println("Dispenser closed.");
}

 


Printing Instructions

  • PLA - Bambu Lab Matte Sky Blue & eSUN PLA Basic White
  • 0.20mm layer height
  • 15% Infill
  • Supports needed for a few parts, it has mostly been designed to avoid supports, reducing the filament needed, I printed it in Bambu Studio with tree supports and support critical regions only, ensure you auto orientate it as well
  • I printed the main part in 2 pieces, you can see the location of the cut from the photos, this was done to reduce the amount of support needed
  • It takes 1 day, 5 hours to print (on Bambu Lab A1)
  • It uses 650g of Sky Blue filament and 475g of White filament

Assembly Instructions

  1. Screw into place the dispensing servo, once it is in place add the slide first then screw the gear onto the servo
  2. Attach the refill attachment to the refill servo, you have to do this by pushing it up the dispensing shute and screwing it in when it is basically in place, then screw the servo into place
  3. Cut wire to length for the distance sensor and LED
  4. Put the distance sensor and LED in place and connect the wires, ensure they do not go outside of the accent part as it attaches flat to the main part.
  5. Twist the wires together and put them in the bottom left part of the accent part - where there is the access point in the main part, install the accent part into place by sliding it down
  6. Grab the wires through from the accent part using the access point and connect them all as the wiring diagram above shows
  7. Put the USB-C connector jack into place and connect it to the arduino
  8. Power it up and test it to ensure it functions as intended
  9. If it functions as intended install both side panels by simply sliding them on
  10. Fill the hopper with pet food

Potential Upgrade

If you have the ability to connect two distance sensors to the arduino the main part includes space for a second distance sensor above the hopper so you can monitor the levels of food in the hopper. You could code it to flash red after dispensing to tell you to refill it if the level of food is low. A wire passthrough and mounting point for the distance sensor is already included in the design to allow this upgrade.

Tagi