Live data from Hacker News

Fixing a broken smart cat feeder with ESP32

pdx.su

41–50 of 53 posts

Re: Fixing a broken smart cat feeder with ESP32

#41
post #39

Earlier quoted context omitted.

It's one of these https://www.homehealthcareshoppe.com/buy-ergo-auto-pet-feede... Big hopper with a plastic auger at the bottom, driven by a gear motor similar to the one that runs a dryer timer. Very simple, no sensors beyond motor overheat. Mine is slightly modified because the idiot cat ate the spout off the end of the auger mechanism. I cobbled together a replacement that's tougher than her.

Oh, so this is also a programmable feeder where you are now using the startup movement to dispense food? Did you try the programming and it did not work for you? But thanks! Always good to have more options.

Mine had no smarts in it at all. The programmability from the factory was a plug in timer similar to a block heater timer, but that wasn't with the unit when I bought it. If you supply power, the auger turns until the power is disconnected. As in the motor is wired directly to the power cord, with only a thermal cutout in line. The timer I use allows you to set interval in minutes and duration in seconds. They're commonly sold as "inching" timers, which I suspect is a translation error but it's descriptive enough.

Re: Fixing a broken smart cat feeder with ESP32

#42
post #39

Earlier quoted context omitted.

Oh, so this is also a programmable feeder where you are now using the startup movement to dispense food? Did you try the programming and it did not work for you? But thanks! Always good to have more options.

Mine had no smarts in it at all. The programmability from the factory was a plug in timer similar to a block heater timer, but that wasn't with the unit when I bought it. If you supply power, the auger turns until the power is disconnected. As in the motor is wired directly to the power cord, with only a thermal cutout in line. The timer I use allows you to set interval in minutes and duration in seconds. They're com…

Alright, that clears it up. The description I found was misleading. Thanks again!

Re: Fixing a broken smart cat feeder with ESP32

#43
post #40

Earlier quoted context omitted.

Current sensors can respond in microseconds if needed. Tension takes milliseconds to build up. I would say the current sensor is probably the right engineering design for reliability, but clearly poor implementation choices were made in this case. An even better design is a BLDC motor with saliency feedback. That avoids brushes (wear component), and gives both angle and torque feedback. Unfortunately I think someone…

That's complete overkill. Single BLDC driver can drive 3 DC motors each, even in both directions independently if combined with a dual power supply. I think positional readouts from BLDC is still incremental, so either an origin sensor or a separate absolute encoder is going to be necessary on top of current monitor for sanity check. Whereas, that sanity check current sensing channel could detect jams somewhere in th…

Tiny BLDC motor controllers can be had for under 1.5 cents, plus a microcontroller (which most devices have anyway). (six 1 amp mosfets, plus a few passives, and about 1 cm^2 of board area)).

Unfortunately they normally need a control loop that runs at at least 10kHz for saliency measurement, which means all the other code on the microcontroller needs to be well behaved and not have millisecond long critical sections. If you can't do that, you need to add another 5 cents for another microcontroller.

Re: Fixing a broken smart cat feeder with ESP32

#44

I love Home Assistant but I have yet to venture into the ESP32 board route of things. Can someone point to a good guide to getting started with these boards? How much soldering and/or microcontroller experience is needed?

The sonoff line is typically pretty hackable and now has etl certification on some of their products. If recommend something like this if you want to switch mains voltage. I use tasmota, which is similar to esphome. The tasmota wiki has disassembly and flashing info. I've always used wires to flash mine but I think there's a software only flash method. The s31 can be flashed with some spring hook probes and the appropriate rs232 cable (3.3v on the data lines iirc). Some of the in wall line need a few pins soldered on (typically 4).

Tasmota has a setup package of you don't mind manually setting up each device. You can also configure them with code if you learn a little c and platformio. At this point, I batch my devices and flash them with wires for initial configuration (Wi-Fi, mqtt, etc), then run updates wirelessly using an http server on my network and mqtt to coordinate.

Side note, the esp8266 is older and less powerful than the esp32. In practice, the esp8266 can't handle https but the esp32 can. This has never been an issue for me and most of my devices are 8266.

Re: Fixing a broken smart cat feeder with ESP32

#45
This is a clever hack. However, if the intent is serious use, I'd be concerned about resiliency. It sounds like the schedule is maintained in Home Assistant, and that it sends a command to the ESP8266 to dispense food. That means a ton of moving parts have to all be working, otherwise the cat doesn't eat: Home Assistant's server and power source, Wi-Fi, and the $1 microcontroller.

If this is intended for serious usage, i.e. the cat won't eat if it fails to dispense, a different design would be more resilient: maybe still define the schedule in Home Assistant or another control plane, but then have it "push" the whole schedule to the device. The device will also need time sync and a realtime clock. Then, the device manages its scheduled dispensation autonomously, even if the network or control plane are unavailable. And, the dispenser should have a little battery so it can run for a couple days with the power out.

Re: Fixing a broken smart cat feeder with ESP32

#46
post #45

This is a clever hack. However, if the intent is serious use, I'd be concerned about resiliency. It sounds like the schedule is maintained in Home Assistant, and that it sends a command to the ESP8266 to dispense food. That means a ton of moving parts have to all be working, otherwise the cat doesn't eat: Home Assistant's server and power source, Wi-Fi, and the $1 microcontroller. If this is intended for serious usag…

Hi, post author here ESPhome timers are actually local to the ESP device. They just depend on a time signal for timekeeping. For now, the time is sent by HomeAssistant, but I could stick an RTC or GPS timesource on the ESP,and have it run 100% locally.

But since this is mostly supplemental food for dental concerns, and he still gets two bowls of wet every day, its not really an issue

Re: Fixing a broken smart cat feeder with ESP32

#47

> This thing is covered in sensors; it's got two scales, ostensibly for measuring the weight of the hopper and the weight of food dispensed, a pair of infrared sensors to detect when the hooper is empty, sensors that monitor the motor's turning, and others that I haven't figured out the purpose of. Bad for business if your cat feeder fails to feed the customer's cat and they return from a trip to a very hungry cat.

Yeah, that sentence shows me that this guy isn't an engineer at all, he's just a hacker. If he made his own automatic litter box (the rotating drum kind) for his cat, he'll also not see the point of all those sensors that "aren't really needed", and one day he'll come home to find his cat chopped in half.

When the device was in service, the sensors didn't really work, and were likely never enabled in the software. The hopper feed level never accurately indicated in-app, and was mostly just based on calculating the approximate amount dispensed vs a "full" hopper, and the machine would often happily report that it dispensed food, and never actually did, so I doubt the scales actually were enabled either

Re: Fixing a broken smart cat feeder with ESP32

#48
post #39

Earlier quoted context omitted.

Oh, so this is also a programmable feeder where you are now using the startup movement to dispense food? Did you try the programming and it did not work for you? But thanks! Always good to have more options.

Mine had no smarts in it at all. The programmability from the factory was a plug in timer similar to a block heater timer, but that wasn't with the unit when I bought it. If you supply power, the auger turns until the power is disconnected. As in the motor is wired directly to the power cord, with only a thermal cutout in line. The timer I use allows you to set interval in minutes and duration in seconds. They're com…

Something like this was actually my plan for a feeder if I couldn't get the one in the article to work. Except instead of a purpose built catfood dispenser, it was an old BBQ wood pellet feeder I found on the local craigslist-equivalent for $20.

Basically a big metal bin with a powerful auger and chute out the side of it

Re: Fixing a broken smart cat feeder with ESP32

#49

It's a nice high-level writeup of getting a flakey piece of consumer electronics back in service, though he used an ESP8266, so I am not sure about the title.

I think the author is not an embedded guy and assumed that ESP32 is the generic name given to these sort of devices. Either way, I am sure this was a fun project and he achieved what he wanted to do. But if this happened to me I would probably try to reverse engineer the device to free it from PetNet cloud. It would be fun and cool and interesting and I would probably never finish it..

There are a few projects out there that were based around reverse-engineering, and running a local server with DNS hijacking to make the feeder use them as its CC server[1]. But I mostly just wanted something that could sit happily in HomeAssistant along with all the other automations, so ESPhome based device it is

And yeah, I'm not an embedded guy, but I've updated the article with an addendum

[1]: https://github.com/feedernet/petnet-feeder-service/wiki/Gett...

Re: Fixing a broken smart cat feeder with ESP32

#50

It's a nice high-level writeup of getting a flakey piece of consumer electronics back in service, though he used an ESP8266, so I am not sure about the title.

To add more to the confusion, twice in the text of TFA he refers to an ESP8622, which AFAIK isn’t a thing. The ESP8266 is fine in this application of course since he’s using a single GPIO pin.

Accidental Dyscalculia
Post reply on HN