Feed Your Pet From Anywhere in the World! a Pi Pico W Powered, Telegram Interfaced Pet Food Dispenser

by Areeeeen in Circuits > Raspberry Pi

113 Views, 1 Favorites, 0 Comments

Feed Your Pet From Anywhere in the World! a Pi Pico W Powered, Telegram Interfaced Pet Food Dispenser

IMG_0049.jpeg
IMG_0054.jpeg

I'm Areen Phaltankar studying in 12th grade at mastermind high school.



Ever dreamt of feeding your pet back at home while on vacation in Venice? Or maybe you were late for work and forgot to feed your cat? Look no further, for i have made just what you are looking for (and you can make it too!)

This Instructable will show you how to make your own dispenser which you can modify based on your size requirements.


the dispenser can be accessed from ANY device that can run telegram regardless of what internet connection it is connected to

Supplies

  1. anywhere from 100 to 300 grams of 3D printing filament depending on your size requirement
  2. 1x Airtight container in which a wide slit can be made at the bottom
  3. 1x Raspberry Pi Pico W or 2W
  4. 1x SG92R servo motor (or any 3 pin servo which can run on 3.3v)
  5. 1x USB-A to micro-usb cable
  6. 8x M2.5 screws
  7. A device that can run Telegram
  8. super-glue

Setting Up the Telegram Bot

Screenshot_20250427_111054.png
  1. Open the Telegram app.
  2. Search for BotFather.
  3. Start a chat with BotFather and type /newbot.
  4. Follow the instructions:
  5. Give your bot a name.
  6. Give it a username (must end with bot).
  7. BotFather will give you a Bot Token.
  8. Save this token safely – you’ll need it later in code.


To find your Telegram Chat ID,

  1. Search for userinfobot in Telegram.
  2. Start the chat, and it will immediately show your Chat ID.

Setting Up Arduino IDE and Uploading the Code

  1. Open Arduino IDE.
  2. Go to File → Preferences.
  3. In "Additional Board URLs," add:

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

(if there are other links seperate each link with a comma(,))

  1. Then go to Tools → Board → Board Manager and search for "Raspberry Pi Pico / RP2040".
  2. Install it.

The Code

Screenshot_20250427_160743.png

when flashing the pico for the first time, press and hold the BOOTSEL button on the pico while plugging it in to the computer


  1. enter your own WiFi ssid, password, botToken (which you got from botFather), chatID (which you got from the userinfobot)
  2. download the .zip library file from here pico RTC library and import it to the code (refer to https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries/)
  3. upload the code to the raspberry pi pico W


P.S check the serial monitor while the pico is still connected to the computer in case of errors

The Circuit

Screenshot_20250427_165938.png
IMG20250427170440.jpg

the electronics part only consists of a Raspbery Pi Pico W and an SG92R servo motor.

PICOSG92R

3v3 → POWER

GND → GROUND

GP5 → DATA

Modifying the 3D Design

modifying the 3D design

this step shows you how to change the dimensions of the dispenser to fit your needs


Substep 1.1: Open the files provided, in fusion 360

Substep 1.2: Click on the MODIFY button in the ribbon near the top of the screen

Substep 1.3: In the menu pop-up, click on Change Parameters

you will see a table of dimensions and their corresponding values. Change these values as per your need. (refer to the video below)


MAKE SURE THAT CHANGES MADE IN ONE FILE ARE REFLECTED IN THE OTHER

Modifying the Container

Screenshot 2025-04-26 140813.png
dimensions.JPG

the main part of the dispenser is the storage box that will store the pet food. This project uses a container you can get on amazon for pretty cheap.

in the parameters table of the BOX.pet_food_dispenser.f3d you will find dimensions labelled : slot_length, slot_distance, container_width.

based on these dimensions, make the slot at the bottom of the container as per the directions given in the image above


the model i have made uses a container with dimensions 19.5 x 13 x 19 cm.

Assembly

IMG20250426182647.jpg
IMG20250426182833.jpg
IMG20250426183940.jpg
IMG20250426192140.jpg
IMG_20250426_205904.jpg
IMG_20250427_172216.jpg
assembly

when the parts are all done printing, you need to use super glue to stick a few parts together (printing the entire model in one go would have introduced alot of supports which would have been a hassle to remove all of)


  1. align the shute/slope part with the slot at the bottom of the box and stick it
  2. stick the legs parallel to each other at either sides

  1. fit the servo motor into the holder provided
  2. screw on the flap to the servo motor. NOTE: let the fit be loose for now
  3. align the flap inside the gap of the shute and stick the servo holder to the side of the shute (refer to the video)
  4. place the pi pico into the cavity at the bottom of the shute, and screw it on using 4x M2.5 screws
  5. screw the top on using another 4x M2.5 screws (I used tape cuz i didnt have the required screws :/ )

Powering the Dispenser

IMG_0055.jpeg
IMG_0056.jpeg

Either a power-bank or a wall outlet with a charger adapter can be used to power the dispenser

First Start Up

go back to the message sent by BotFather on telegram. It should have included a link to access the bot. Click on that link, and it will lead you to a new text channel with the new bot.

Click on start and text it /help to see all commands.


NOTE: The reason i had asked you not to screw the flap too tightly, was because everytime the pico turns on, it will recenter the servo. So let the code run, and when it stops moving after a second, rotate the flap so it fits in the gap of the shute. This way you can center the flap without needing to know which direction the servo is pointing!

ALSO NOTE: I dont own a pet, so i wasnt sure of the correct time the flap should be open to dispense the right amount of food. this can easily be changed in the code i provided to better suit your needs.


the following commands have been implemented

1. /feed small – Dispenses a small portion of food.

2. /feed medium – Dispenses a medium portion of food.

3. /feed large – Dispenses a large portion of food.

4. /schedule [size] HH:MM – Set a schedule for automatic feeding (24 hr clock):

• /schedule small HH:MM – Schedule a small portion at the given time.

• /schedule medium HH:MM – Schedule a medium portion at the given time.

• /schedule large HH:MM – Schedule a large portion at the given time.

5. /schedule pause – Pause the scheduled feeding.

6. /schedule resume – Resume the scheduled feeding.

7. /schedule status – View the current schedule and whether it is active or paused.

8. /help – Display this help message again.

Demonstration

Telegram pet feeder demo

the commands i run in the video are:


  1. /feed small
  2. /feed medium
  3. /schedule small 11:43

How It Works

how it works.png

the priority of mine when i started building this project was to make it usable from anywhere, and not restrict the connectivity to a common WiFi access point. I first took to hosting my own cloud server but soon realized it wouldnt be financially viable. I then thought about using a pre-existing cloud server which specializes in point to point connection with a cloud server intermediary. I was using WhatsApp one day and realized that it was exactly what i needed. After researching about how bots would work on such platforms, i decided to bring my project to telegram since it had a much better support for user-defined bots.


You can access your Telegram pet feeder from anywhere in the world because the Pico W connects to the internet and communicates with Telegram’s cloud servers. When you send a command through the Telegram app, it travels through Telegram’s global network to reach your device, wherever it is, as long as it has an internet connection. Telegram acts as a bridge between you and your feeder, bypassing the need for complicated networking setups like port forwarding.


The telegram bot gets commands from the user, which are sent to the pico W.


I hope you enjoyed my first Instructable and hope you will come back for more soon :)