Automated cat food dispenser

dispenser

I had an automated cat food dispenser for quite a few years, with an Arduino on to override the build-in timer. It worked fine, until one day where the timer suddenly decided to also trigger at random times, forget to stop the motor letting the food out, detect it as being full, while being empty, and such things, so now I decided to completely make my own controller for it.

This time I will also try something different, so far I have only been making projects based on either an Arduino, or an ESP8266, this time I will try to combine both. The reason for this is because I want to make a controller for my garage door too, and I want the Arduino to only monitor what is going on, and stop the door if something is wrong, and my idea with that is to have another controller to tell it what should happen, and then it execute the command, and only make sure things are going smooth. This project is then the trial with some small hardware which isn’t strong enough to hurt anyone, in case of failure.

My plan with this is then also to have the ESP8266 handle communication, and the Arduino (bare ATmega 328p chip) handle the actual control of the dispenser.

Input/Output

And here my supreme Photoshop skills really shine… or something… anyways…

Trying to get an overview over what the 328P needs to control.
2016-04-03-15.06.32

Name Pins needed Function
Barrel stop switch Digital in Signal to stop barrel motor
Vibrator Digital out + mosfet Making sure the food does not stick in the hopper
Barrel motor Digital out + mosfet For turning the barrel and release food
IR emitter Digital out Check if there is a visible path between sender and receiver.
IR receiver Analog in Receive light from the emitter and validate value.
Lid ping sensor Digital out + digital in Calculate food level in the hopper.

Looks like the ATmega 328P will have plenty of pins to control what is needed, so lets try to break it out a bit further.

Barrel stop switch

Simple switch to stop the barrel at the right spot. Simple switch connected with one pin to gnd and the other to a digital pin with internal pull-up enabled.

Vibrator

DC motor for helping the food fall down from the hopper and into the barrel. Driven by a mosfet with pull-down resistor on the base to make sure it won’t start accidentally.

Barrel motor

DC motor for rotating the barrel, dispensing food. Driven the same way as the vibrator motor.

IR emitter

LED emitting IR light. Used for determining if there is food blocking the outlet from the barrel. Digital out with a resistor in series to turn it on.

IR receiver

Receive light from the IR emitter, calculate resistance to determine if the path is blocked or not. Connect to analog in.

(Ground) ---- (10k-Resistor) -------|------- (receiver) ---- (+5v)
                                    |
                                Analog Pin

Lid ping sensor

Calculate level of food in the hopper.

One digital pin used to trigger the sensor, another to receive the echo. Use time between trigger and echo to calculate distance from sensor to the top of the food.

Leave a Reply