DIY cat feeding timer on Arduino Mega

Apologies for the wrong hub

Initially, the article was written under the “DIY week” in the corresponding hub, but the support told me that arduino is not DIY, and it was a pity to delete what was written. It seemed to me that this hub is the most suitable, if I’m wrong, I’ll correct it.

I am a developer, at that time I worked in a small “one product company”, sawing something like an ERP dedicated to repairing large fleets of trucks, bulldozers, excavators, accounting for client money eaten for this repair and controlling the time spent on it.

As usual, I have a cat. This is not a tribute to fashion: my cats live all my life. And all their lives cats want to eat (and some even EAT) which is not a problem when you live alone and always know that you have either already fed the cat or not yet – there are no intermediate states in this system.

But when you live with your family, you notice that the cat is less and less likely to jump on your desk to help you debug, and when you break away from the computer to pour tea for yourself and pour cat food for the cat, it suddenly turns out that the fluffy bro is sleeping peacefully and does not respond to the conditional sound-handshake of poured feed.

Everything is clear: someone recently fed him. Most likely then someone else fed. And then you too. And then…

  And then suddenly SIX KILOGRAMS and torn ligaments on both hind legs

And then suddenly SIX KILOGRAMS and torn ligaments on both hind legs

In total, we need to somehow lose the cat’s weight and streamline his feeding regimen. The wife took from her grown daughter her hand-operated toy clock, the hands of which we set at the time of the last feeding, then every time we visited the kitchen it was necessary to add four hours to this time in her mind and, looking at the usual clock, calculate whether it was time for the next feeding, or does this “meow” mean “maybe a ride”?

Oh yeah, where did four hours come from…

According to some “old school” it is believed that cats need to be fed twice a day: in the morning and in the evening. I saw many videos with the process of feeding in nurseries: a man with a zhrach enters, cats who have not had time to wake up fall off the beds, take him into the ring with a plaintive bark, greedily catch food, jump on each other, run over each other’s heads, trample the weaker ones, meowing, fighting… Don’t you feel sorry for them? Plus, such a speed of eating is by no means conducive to either their digestion or the level of happiness inside a single cat …

Somehow, together with our veterinarian, we came to the conclusion that every four hours (this interval is also recommended for people) it will be easy for us and it’s good for the cat, the cat agreed with this plan (or rather, he had to) and has been steadily on duty in the kitchen for the last half hour or hour (apparently his internal clock is in a hurry). The only thing that bothered me was the need to manually calculate the time each time.

Initially, there was an idea to buy an automatic feeder, of which there are on aliexpress for every taste, but suddenly from somewhere the thought flew into me that if the cats were fed on a full automatic, they would completely lose touch with the person. If the zhrachka in the feeder will appear by itself, then even in the most fluffy cat’s head this magic will not work and will not be connected with the presence of a person in the process. That is, cats in all seriousness will believe that the zhrachka is falling from the sky and that it is now completely unnecessary to murm on a person’s knees.

It was impossible to allow such a demarche, but I’m a programmer with my mother …

I consulted with friends, decided that Arduino is just right for such a task, plus feeling a new language is a separate pleasure. I chose the input-output system for a long time: either buttons and LEDs, then a display for the clock and again buttons, but I suddenly stumbled upon such a sandwich on aliexpress:

https://aliexpress.ru/item/1005004858453685.html?sku_id=12000030776083948&spm=a2g2w.productlist.search_results.5.2bff4aa6BAq7jp

Arduino Mega for such a task is a little overengineering, but it was bribed by the fact that you don’t need to fiddle with buttons, that you can use a touchscreen, that you can draw any picture on the display and move it, and even encapsulate the whole thing in a single case – yes, like two bytes forward. And plus a friend who has a 3D printer promised to help.

Hehe…

Yep, right now. The case, as usual, turned out to be the most difficult structural element, but the friend did not help … In total, the case turned out to be the most shameful place in the project, and it’s too late to redo it: I sawed a hole in the front of the kitchen cabinet and the case is now permanently registered there.

Sketch for arduino is absolutely nothing interesting. Know how to count the minutes and after a certain amount, take one strip of “charging” from the display. The only thing I got confused about was a more accurate clock module, but as it turned out, I did it completely in vain: with the module, the arduino clock goes about the same as without it.

On the arduino display, the image of a cat is initially painted over with charging stripes, as on the well-known battery icon. There are eight such strips in total, and every half hour they become one less. When there are no strips left, a signal sounds and the cat, overtaking a person going to the kitchen, meets him at the bowl with varying degrees of concern on muzzle face. At night, the signal is not heard and the cat automatically goes into emergency mode “natasha get up.”

Due to failures in the cat BIOS, it sometimes happens that the cat is on duty at the bowl when the last strip remains and in the first version of the timer it was impossible to understand whether there were 20 minutes left before feeding or only 5. To do this, in the second version of the timer, during the last half hour, the number of minutes remaining before feeding and the person knows in advance whether it is time or not.

Having fed the cat, the person presses the green button and the cat (not the fluffy one, but its on-screen copy) is completely painted over with charging stripes. An alternative case is when the cat was lightly fed a treat, the red button was pressed and another half an hour was added to the time, after which the cycle continues again.

The most shameful moment in the project is the hull. I never managed to find a 146% suitable case, and my friend, who initially promised to help solve this issue on his 3D printer, merged and I had to buy anything.

Well, okay … the main thing is that the cat is fed!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *