Sensor Pet Feeder

by jducharme2 in Circuits > Sensors

8 Views, 0 Favorites, 0 Comments

Sensor Pet Feeder

Screenshot 2025-04-09 at 2.41.08 PM.png

The problem that we will be trying to solve is how an individual can feed their pet using technology. The goal is that the motion of the pet will activate it. We will be using the Express playground to achieve our teams goal of a creating an easy-to-use pet feeder. “Because you can program the same board in 4 different ways the Express has great value and re-usability. From beginners to experts, Circuit Playground Express has something for everyone.” (Adafruit 2025)


Supplies

All necessary supplies and equipment are provided with links.

  1. Base
  2. Portion Control
  3. Holder

Example

  1. Adafruit Circuit Playground Express Basekit
  2. Continuous Rotation Micro Servo
  3. Alligator Clips to Male Wires
  4. 3D Printer

Download and Print These 3 Parts of the Pet Feeder

Screenshot 2025-04-09 at 2.45.05 PM.png
  1. Download and print the following STL files using a 3D printer. Use a raft and supports.

thingiverse:

https://www.thingiverse.com/thing:4878578


Assembly

Screenshot 2025-04-09 at 2.45.39 PM.png

Assemble 3 parts that have been printed. Insert the portioner into base (it will just sit on top, you can see the indent where the motor will go so don’t screw anything on yet. The holder will then go on top of these 2 pieces

Wiring

Screenshot 2025-04-09 at 2.46.08 PM.png

Insert the motor into the small slot in the base of the feeder and make sure wires that lead to cpx are connected. The wires will feed through the bottom of the base and will connect to cpx that will stay on the side of the feeder.

  1. Screw the portioner to the motor using a small screwdriver

This is what it should look like:


Code

Screenshot 2025-04-09 at 2.46.40 PM.png
Screenshot 2025-04-09 at 3.02.45 PM.png

"""CircuitPython Essentials Servo standard servo example"""

import time

import board

import pwmio

from adafruit_motor import servo

from adafruit_circuitplayground import cp

# create a PWMOut object on Pin A2.

pwm = pwmio.PWMOut(board.A1, duty_cycle=2 ** 15, frequency=50)


# Create a servo object, my_servo.

my_servo = servo.Servo(pwm)


while True:

if cp.button_a:

print("Button A pressed!")

cp.red_led = True

for angle in range(0, 180, 5): # 0 - 180 degrees, 5 degrees at a time.

my_servo.angle = angle

time.sleep(0.05)

for angle in range(180, 0, -5): # 180 - 0 degrees, 5 degrees at a time.

my_servo.angle = angle

time.sleep(0.05)

if cp.button_b:

cp.pixels[5:10] = [(0, 255, 0)] * 5

else:

cp.pixels[5:10] = [(0, 0, 0)] * 5

Test

Once the steps above are finished test out the pet feeder by shaking the Cpx or touching the green alligator clip that activates the inner portioner to move. You may want to add an object into the holder so you can see it fall out.


Downloads