This is an old revision of the document!
PurrGlow Feeder is a smart, automatic cat feeder that dispenses food at four fixed times per day, but only when the cat is nearby. It uses a proximity sensor to detect the cat’s presence and activates a motor to rotate a food container, releasing food into the bowl. The main goal of the project is to automate and optimize the cat feeding process, reducing waste and ensuring the pet eats at regular intervals. The idea came from a personal need to reliably feed a cat even when not at home, while also making the experience more interactive. A colorful LED cube acts as a night light and plays dynamic light patterns whenever food is served. One of the lighting modes can be customized using a potentiometer, giving the owner some control over the ambience. A button is also used to change the light modes, implemented using an external interrupt. This project is useful for pet owners who want an efficient and engaging way to care for their animals, and for us, it’s a fun and educational way to apply embedded systems concepts to a real-world scenario.
The PurrGlow Feeder system includes both hardware and software modules that work together to automate cat feeding and provide interactive feedback through an LED cube. Below is an overview of the main modules and how they interact:
Hardware Modules
Software Modules
Interaction Flow
List of Components:
Connection Overview:
Overview on hardware:
The hardware design of the PurrGlow Feeder includes several modules integrated around an Arduino Uno board, enabling both scheduled and on-demand food dispensing with visual feedback.
Arduino Uno
Acts as the main controller. It keeps time, handles feeding logic, controls the servo, reads sensor and input data, and manages LED animations. All components are powered from the Arduino’s 5V supply line.
Servo Motor (SG90)
Controlled via PWM on digital pin D5, the servo rotates to release food. It activates automatically at four fixed times per day.
Proximity Sensor (HC-SR04)
Connected to pins D3 (TRIG) and D4 (ECHO), this sensor is used by the owner to manually trigger extra feeding. If it detects presence continuously for 2 seconds, a food portion is released. The module runs at 5V and uses about 15 mA.
LED Cube (5× WS2812B matrices)
All matrices are daisy-chained and driven from pin D7 using FastLED. They display predefined lighting animations during feeding. Brightness is limited in software to reduce power usage (total draw ≈ 200 mA).
Push Button (mode switch)
Connected to pin D2 via an external interrupt, this button lets the user switch between different LED animation modes at any time.
Potentiometer
Wired to analog pin A0, the potentiometer allows the user to adjust either the LED animation speed or the color in specific modes.
The system is designed for simplicity and low power consumption, drawing under 500 mA total. Feeding can happen automatically or on request, and all interactions are confirmed visually via the LED cube.
Each hardware component is mapped to specific pins on the Arduino Uno, chosen based on electrical compatibility, timing requirements, or interrupt support.
D2 – Push Button (INT0)
This pin is used because it supports external interrupts (INT0 / PCINT18). It allows the system to detect button presses asynchronously and switch LED animation modes instantly.
D3 – HC-SR04 TRIG
Configured as a digital output to send ultrasonic pulses. It was chosen as a general-purpose pin close to D4, forming a logical pair for the proximity sensor.
D4 – HC-SR04 ECHO
Configured as a digital input to receive the echo signal. It is read using `pulseIn()` to measure distance accurately.
D5 – Servo Motor PWM
This pin supports hardware PWM and is connected to the SG90 servo. It allows precise pulse-width modulation for angle control during feeding.
D7 – LED Cube Data In
Used as the data pin for the WS2812B LED matrices. Chosen for its ability to handle tight 800 kHz timing required by FastLED, and because it's not shared with any serial or I²C functions.
A0 – Potentiometer
This analog input reads voltage from the potentiometer to control either LED speed or color. A0 is conventionally used for analog input and provides stable readings.
All components share a common GND, and are powered from the Arduino’s 5V rail. Pin assignments were selected to minimize conflict with internal timers and preserve clean signal timing for both the servo and WS2812 LEDs.
Development Environment:
The firmware was developed using the Arduino IDE, chosen for its simplicity and built-in support for common microcontroller platforms such as Arduino Uno. The environment supports both code compilation and serial monitoring.
Libraries and 3rd-Party Sources Used:
Library Name | Purpose |
---|---|
FastLED.h | Controls WS2812 RGB LED matrices with high-performance animations |
Adafruit_NeoPixel.h | Alternative library for driving NeoPixel (WS2812) LEDs |
Servo.h | Controls the servo motor responsible for food dispensing |
EEPROM.h | Store configuration or last feeding timestamp |
TimerOne.h | Enables time-based control for feeding intervals |
Algorithms and Planned Structures:
The firmware is structured into two main parts:
Function / Module | Description |
---|---|
snake() | Snake effect moving across the LED matrix |
vortex() | Circular animation effect across all matrices |
fade_color() | Smooth color transition based on potentiometer position |
random_star() | Randomly lights up LEDs like a starry sky |
convert_speed() | Converts potentiometer analog value to animation speed |
poweroff() | Turns off all LEDs |
detectPresence() | Measures distance with ultrasonic sensor to detect the cat |
rotateServo() | Controls the servo motor to dispense food |
shouldFeedNow() | Checks if it is the correct time to feed |