OK…so I have a cat. His name is Thomas. Thomas is a douche bag. When he was young and growing up, he lived in a shitty little apartment with crappy bathroom fixtures. He learned to get fresh water from the leaky sink and never drank from a dish. I’ve tried to force him to drink from a dish whenever we moved…and it even kind of works for like a week. That is usually how long it takes for Thomas to find the bathroom and start expecting the humans to turn on the water for him. If the humans don’t turn on the water for him, he will bitch and moan until they do. Normally, this wasn’t a problem because I always had a roommate that was home most of the time. Well, for the first time it is just me and Thomas, so he doesn’t have anyone to turn on the water for him. Enter the cat waterer.
So, I got some cheap Arduino Pro Mini’s on eBay that were direct ship from China. I would have gotten them from SparkFun, but they ran out when I was purchasing.
Basically it’s a really simple design that uses a matched pair of an IR emitter and a detector. I got these from RadioShack ages ago. They are just an IR LED and IR phototransistor. I wired them up to a board with the appropriate resistors and voila, I had a way to tell if a cat jumped on the sink.
For the plumbing side I bought a couple of necessary tools from Harbor Freight, including a tiny pipe bender and pipe cutter. I got some 1/4″ flexible copper tubing to run the water through and a big fat solenoid to control the flow. The solenoid I got was way over kill. It is good for air, gasoline, natural gas, water, and pretty much everything else I can think of. If I did this again I would go for the quieter plastic version that I see around. I got a few bits of brass compression fittings and bolted it all together. If I knew what I was doing it would probably be cleaner and straighter…but I don’t.
For the coding, I take no responsibility or liability for it. It was done by Thomas.
I think there is much cleaner out there and he added a bunch of stuff that I don’t think it needs…but he’s learning. Well, that and he bit me when I started editing the code. The point of the code is to make sure that the software never cycles the solenoid too often. To do that he added some sleep time and tried to smooth out the signal from the IR. Pretty much all of the code was stolen from some other project then duct taped together into the form you can see below.
For the electronics you can see the Fritzing (both a blessing and curse of a software) exports below. Not much going on here. I had done the maths on a scrap piece of paper…that I have subsequently lost. Again, like the code, rough ideas from other projects (including the secret knock unlock project) and then sized the bits and pieces for my setup. I wired it together and it worked…mostly. Actually, there was that one time where I put 12VDC to the VCC…Nothing was happy about that. I blew up the board and the LED. Whoops. That’s not exactly the cheapest way to learn…but I learned.
breadboard-TW1.5 schematic-tw1.5
IRL Board Pics: