RFID Cat Feeder

Project Description

RFID Cat Feeder is a “smart” feeder that opens up only when a certain cat wants to eat. It can do this by reading an RFID tag on a cat's collar, or ideally its microchip. The purpose of such a feeder is to stop a gluttonous cat from eating all the food.

Hardware

Description

The hardware is relatively simple. ESP32 gets info about the RFID tag from an RFID reader. The door motion is controlled by a servo motor. Registering a new tag is done through a button. Two LEDs help the user know what the feeder is currently doing.

To have a safety mechanism so that the door doesn't close on the cat, the feeder uses an ultrasonic sensor to sense if there is a cat in front of it.

Diagram

Parts list

  • ESP32
  • RC522 RFID reader + RFID tag
  • HC-SR04 ultrasonic sensor
  • 2 x LED (1 green, 1 red)
  • Button
  • TowerPro SG90 servo motor

Software Description

Libraries

#include <ESP32Servo.h> - Easy control of the servo motor, a fork of Arduino's Servo.h that is compatible with ESP32

#include <MFRC522.h> - Library for reading from the RFID reader

#include <SPI.h> - Another library used for the RFID reader

#include <NewPing.h> - A library to simplify the usage of the ultrasonic sensor

Pseudocode

The core functionality of the feeder can be simplified in this pseudocode:

loop() {
    if (register mode) {
        turn on red led
    } else {
        turn off red led
    }

    if (button pressed) {
        toggle register mode
    }

    if (reading a card) {
        if (register mode) {
            add card uid to vector
        } else {
            if (card uid is in vector) {
                open door
                wait 5 seconds
                close door if no obstacle
            } else {
                do nothing
            }
        }
    }
}

The full code can be viewed on my github

Testing

References

iothings/proiecte/2022sric/rfid_cat_feeder.txt · Last modified: 2023/06/02 07:59 by maria_irina.gherman
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0