This is Fyodor. He's an old Maine Coon and he's missing a fang. Raised on the streets of Brooklyn, rumor has it this cat ate the canary. Others contend he ate his sister, the runt of the litter. Sharp as his love may come, he's captured the hearts of a surprising number of us.

Over the weekend, I joined my cousin in engineering a water dispenser with a motion-sensor so Fyodor might drink at his leisure in his preferred place of enjoyment: the bathtub.

If someone were to say, "Tell me three things about that cat," here's what I'd come up with:

  • He's mean
  • He's vicious
  • He's thirsty

I'd never been a cat person. Not until Fyodor. In fact, any cat except Fyodor is bound to make my lips swell, my eyes puff, and my skin itch. But this little feller's grown on me. It might be because he's the first cat I haven't been allergic to. But it could also be that he's enchanted me with whatever spell makes all of his lovers endure his evil ways.

He'll cut you, no joke

An Insatiable Feline

It is Fyodor's custom to drink from the faucet in the bathtub. Here's a snapshot of the feline's expression of water-desire.

  1. Stands near the entrance of the bathroom
  2. Mews excessively
  3. Follows every individual into the bathroom with the hopes of the tub being turned on
  4. Mews some more
  5. When tap is turned on, drinks until he's bloated
  6. Maybe barfs on the carpet
  7. Takes a nap

Given his tendency to over-imbibe, a timer is usually set when the faucet is turned on for the old cat-man.

Fyodor has a perfectly good bowl of water around the house, but he'll only accept a drink in the tub. While we could have tried putting a water bowl in the bathroom, it wouldn't have been as much fun as programming a Tessel 2 and a motion sensor to trigger a small pond pump at the bottom of a five-gallon bucket.

The Hardware

The Tessel 2 is a single-board computer that runs on Javascript. This means it can control appliances and tools - real-world physical objects - with a syntax similar to the language used to control objects in a web browser.

Motion sensor on the left, Tessel 2 on the right.

There are multiple modules one can attach to the Tessel to allow it to interface with a variety of objects. The Tessel Relay, for example, gives us the power to control appliances and tools.

We used the Relay to control the power to the pond pump. The the pond pump itself does not have an on/off switch. Once you plug the pump in, the proverbial fountain flows.

Catdrip Diagram

Here's a quick rundown

There is a power supply to the Tessel and power cord to the pond pump. When plugged in, the Tessel uses its power to run itself (obvi!) as well as the motion sensor (not so obvi! but maybe, kind of...). The cord to the pond pump is spliced before it reaches the Relay module. This is so the Relay can act as a switch. When the motion sensor senses Fyodor's balletic leap into the bathtub, it sends a signal to the second port on the Tessel. The Javascript is programmed to listen for this signal. When it detects the motion sensor's signal, the code tells the Relay to allow power to pass to the pump. And then, voila! The water flows.

We didn't start out with the pond pump in mind. The original idea was to use a solenoid - a motorized shut-off valve common in irrigation and sprinkler systems. I'll get to how we decided on the pond pump later.

The Code

It only took a few lines of code to program the Tessel to accomplish its goal. This code snippet was lost during the port-over from Wordpress sorry friends.

The Harder-ware

As I mentioned, we considered a solenoid as a gatekeeper for the water. There were two challenges with this approach.

  1. It would be difficult to control the flow rate because the solenoid has only two settings: open and closed.
  2. The solenoid is threaded with 1/4" NPT, which means whatever kind of container (jug, paint bucket, water bottle) we used, we'd have to jerry-rig some kind of water-proof adapter. This would create a critical point of weakness the system.

Thinking through this led us to consider a low-powered submersible pump, the sort you'd find in a garden fountain adorned with gnomes, fairies, and other mythical creatures of the lawn.

We took a trip to our local hardware store to build the dispenser. We picked up a five-gallon bucket and the following:

The pump solved the flow rate issue - it is adjustable via a small knob where the output tube is attached - so Fyodor wouldn't get power-sprayed in the whiskers. All we'd have to do is cut a hole in the top of our container for the plastic tubing to exit and run into the tub.

A Tub Next To The Tub

I cut two holes in the lid of the five-gallon bucket, one for the pump's power cord and another for the tubing.

Once we had the Tessel, Relay module, and motion sensor wired together, we squished them into the sandwich container and set it on top of the lid. It took a bit of finagling to get the power cord and Relay to sit appropriately in the sandwich case.

We used hot glue and the wire to mount the motion sensor and point it at Fyodor's preferred standing spot in the tub.

I spy a cat. And a motion powered water dispenser!

A Cat's Gonna Do What A Cat's Gonna Do

It's one thing to build a motion powered water dispenser. It's an entirely different challenge to coax a kitten not to fear the alien-like floating eyeball in the bathroom.

Over the course of a week, Fyodor slowly realized that he holds the power to imbibe in his own, tiny, mildly evil paws.

Part of me worries he might also be realizing that his unlimited access to water is really a way for us to pay less attention to him. And for this I fear his wrath...

Thanks for reading! If you have any questions, let Gus know. He's the AI in charge of this joint ✌️

✌️Last updated 
November 13, 2021