Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Image 1
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Image 2
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Image 3
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Image 4
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Image 5
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Image 6
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Image 7
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Thumbnail 1
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Thumbnail 2
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Thumbnail 3
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Thumbnail 4
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Thumbnail 5
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Thumbnail 6
Smart Pet Feeder - with Arduino, RPi Pico and ESP32! 3D Printer File Thumbnail 7

Smart Pet Feeder - with Arduino, RPi Pico and ESP32!

ThunderClap avatarThunderClap

April 1, 2025

printables-icon

Description

WARNING- This is really some of my first few times coding. I have done my best, and if you feel like you can improve upon it, please do! Just be aware that this code could be rough or have unexpected behaviors.

WORK IN PROGRESS - all currently uploaded files should be good to go. Small changes/updates may occur to code or models. 

The need arose for an automated feeding option for our Leopard Gecko, just in case the house sitter missed a feed. Using Ataboo's design as a foundation, I decided to modify the original intent utilizing 2mL auto-sampler vials that are perfect for one large meal worm, to drop into the food bowl from outside the enclosure. The project can utilize just about any microcontroller that can operate either MicroPython (preferred) or Arduino IDE based .ino files. Once you 3D print the parts for this and configure the specifics, it is as close to a set-and-forget as you can get with a single feed per 24 hours. 

**There is NO redundancy for power-loss, both MicroPython and Arduino code should initialize and operate as if they were starting from zero. No real harm though, if this does occur, the feeder should progress to the next dose 24 hours after initialization or the scheduled feed time for the NTP-based MicroPython code. Once the actuator slides past the motor gear, it will run harmlessly as long as the feeder slide has a place to safely rest when it self-disassembles. 

----------------------------------------------------------------------------------------------------------------

Hardware and Software: 

BOM: 
  • 1 28BYJ-48 Stepper motor and ULN2003 motor driver (here).
  • 2 momentary push buttons (any kind will do, but you'll have to modify the file for anything other than what I used) 
  • I used a Creality Filament sensor switch like this one and just removed the PCB from the housing. ---- OR ----
  • Omron D2F-L limit switch like these (working on the variant for the main body)
  • Arduino Nano (here) OR ESP32-WROOM-32 module (here) OR Raspberry Pi Pico W/2W (here).
  • 5V power supply OR (Buck converter I used) capable of 5V. (2.5A rated or better preferred.)
  • 10x - 2ml Auto-sampler Vials (here).
  • WIRE! Your choice.
  • DuPont connectors and crimps to make your own jumpers/cables. 
  • Screws 
    • 2-M3x8 SHCS w/nuts (mount stepper motor)
    • 2-M2.5x6 coarse thread screws (mount limit switch)
  • PRINT THE RIGHT MAIN BODY for the type of limit switch you are using!
Software and Code:

For the MicroPython coding, you may need to follow a tutorial on how to burn the firmware for your specific device. For the ESP32-WROOM-32 module I used, I used this (GUIDE) here to get it burned. That guide provides you options for various platforms to burn, including Linux, Mac and PC options. Once you get the MicroPython burned, you can follow other guides within that website to figure out how to load the files (similar to this guide) on to your specific device and edit the files to meet your specific configurations. 

For my specific case, I used (uPyCraft) to burn the MicroPython firmware and then load the .py files on to my device(s). 

For the Arduino code, you will need to download (Arduino IDE) and open the sketch. You will need to correctly set your board, COM port and other things needed to correctly flash your board. Please find a guide on how to do this, specific to your device, and it should go seamlessly. The Arduino code is available (HERE).

 !!!The Raspberry Pi Pico W utilizes a RP2040 chip and the Pico 2W utilizes the RP2350!!!

  • This difference may effect how the programming is performed and how the code functions. I have tested this on the Pico 2W, you may need to make changes to your code in order to utilize the older Pico or Pico W. 
ESP32 / RPi Pico MicroPython:
  1. Initialize and perform feed at scheduled time after getting current time from NTP server. Produces a local webpage to enter variables of time. 
  2. May need to press either of the buttons for ~10 seconds before function/movement occurs. That is the set check interval for the system.
Arduino Nano / Arduino IDE code:
  1. Initialize and perform feed at 24 hour intervals, no smart function or WiFi. 
ESP32 / RPi Pico W/2 W - Arduino IDE:
  1. Initialize and perform feed at scheduled time after getting current time from NTP server. Produces local webpage to enter variables of time.

--------------------------------------------------------------------------------------------

Wiring Diagram:

This is going to be broken into three parts. The wiring is essentially the same for all three options, the only real changes are the GPIO pins used and ensuring their assignments match the code OR you change the code to match your pin assignments. PAY ATTENTION TO THIS. 

ESP32:

Arduino Nano:

RPi Pico W/2 W:

----------------------------------------------------------------------------------------------------------------

Printing Instructions:

  • Filament Used: eSUN PLA matte black and Elegoo PLA+ white (use whatever you want!)
  • Layer Height: .2mm
  • Infill: 25% gyroid
  • Walls: 4 (.4 nozzle)
  • Support: YES! - Main body only. (All other parts should be printed without support)
    • Main body will DEFINITELY need supports for the overhangs on the feeder slide rail retention on each edge. 
      • ** Failure to use supports here will likely cause the feeder rail to be too tight and not slide freely. **
    • Holes in main body (circular holes in electronics box and screw holes) may need supports if your printer does not bridge well. 

---------------------------------------------------------------------------------------------

Assembly Instructions:

Assemble and test electronics:
  1. Wire the stepper motor driver, the power supply, and the microcontroller BEFORE assembly into 3D printed parts. 
  2. Program your microcontroller with preferred method and code.
  3. Power on and TEST your electronics and functionality before assembly. 
Assemble electronics into 3D printed housing:
  1. Press-fit the gear onto the 28BYJ-48 stepper motor. (should be snug)
  2. Screw-in all 10 auto-sampler vials into feeder rail
  3. Mount limit switch onto main body
    1. Run wires for this through hole facing limit switch
  4. Mount 28BYJ-48 stepper motor on to the main body cradle, wires facing UP.
    1. Wires route through enclosure cut near the motor.
  5. Place ULN2003 driver PCB into posts closest to motor. 
    1. *May need to break off 2 printed posts. This is okay, not all PCB's are the same.
  6. If using buck converter linked in BOM - place buck converter PCB into printed posts.
    1. Power IN should not have wires in it YET, place these in the screw terminals after placing in electronics box. 
  7. Place microcontroller:
    1. ESP32 will screw on to lid of enclosure. 
    2. Arduino Nano does not have mounting holes.
      1. Place into electronics box - Protect exposed pins to prevent shorts (kapton tape, electrical felt tape, etc). 
    3. Raspberry Pi Pico W does not have mounting holes
      1. Place into electronics box - Protect exposed pins to prevent shorts (kapton tape, electrical felt tape, etc).
  8. Slide the feeder slide into main body, until toothed gear starts to engage the fixed teeth on the slide. 
  9. Press Load (Reverse) button when powered. 
    1. If configured correctly, feeder slide will “suck in” and attempt to hit limit switch. This will be the ready/loaded position for the feeder to start from once placed and powered on. 

Usage Instructions:

  1. Remove system from surface.
  2. Extend the feeder slide out by hand (gently please).
  3. Flip whole system over, holes for vials should be facing up now. 
  4. Fill each vial with food for the one day dose.
  5. POWER ON THE DEVICE - wait for initialization ~10-20 seconds.
  6. Push “Reverse” button, motor should retract the feeder slide until it hits the limit switch.
  7. Place the feeder (i.e. magnets, tape, velcro) so the vials will dump into the enclosure or tank as they extend. Ensure there is space for the slide to extend fully
  8. Provide power to the system if you disconnected it for placement.

 MicroPython and Arduino Web Interface:

The code for WiFi enabled microcontrollers will attempt to connect to your network and then generate a webserver/webpage for you to input scheduled time(s). While you have the microcontroller connected to your IDE program (Arduino IDE, Thonny, uPyCraft), you will need to observe what IP address has been assigned. This IP address will be what you type into your web browser to interact with your new IoT feeder. 

 

One “dose” of food should be extended out to dispense either at your scheduled time, or 24 hours after it has been powered on.