Stanley Solutions Blog

engineering and creativity - all under one hat

Making Feline Stink a Distant Memory


ScentAssist

Like I said, we all love our pets, but sometimes the "stink" can be overwhelming. Especially with cats...

My little "Cat Closet" helps to keep things somewhat isolated, but it produces a new challenge: all of that stink gets trapped indefinitely. That's... well, less than ideal in just about any situation. So I came up with a solution that I call ScentAssist. In a nutshell, it's an automatic fan. Nothing crazy, but it's SUPER helpful, and pretty simple!

ScentAssist

So, with a system that's not really IoT, but is embedded, I wanted a very predictable routine configuration. I wanted the system to be predictable, and work without too much fuss.

asside: I'm still working on that last part, but I'll get to that later...

With this desire in mind, I opted to base my system around a relatively simple state-machine.

ScentAssist State Machine

So, that's all pretty simple, what wasn't simple (or should I say isn't, since I'm still working on it) was the motion-sensor qualification. I'm cheap, and a fan of reusing old parts, so I pulled out an old 12VDC power supply from my "storage." It was originally from an RGB DJ light that I tore apart and hacked. Don't get me wrong, the power supply is reasonable, enough, but it's not exactly... "clean." The output is a bit noisy. In fact, I've had trouble with these things before. I've used its brethren before (that's right, I had like 8 of these things, at one point) and they worked, but gave me trouble. So with all that noise, the motion sensor drives some funny behavior on its output.

I'm using little motion sensors like the one pictured below; they're simple enough, +/- voltage rails, and an output. The output provides a little less than a solid digital signal, so I hooked it up to one of the analog inputs on the Arduino. No biggie. However, with all that noise from my friend the 12V supply, the output signal becomes a bit...

messy.

motion sensor

Still, it's not unreadable. I can pretty easily detect the step-change when visually inspecting the waveform, or watching the analog readouts from the Arduino, itself. Just need to filter out all that garbage. Sure! Analog filtering is pretty easy. Right?

...

Right...?

It was easy when I was in college, and had just learned the stuff. But I haven't touched algorithms like IIR (Infinite Impulse Response) in about three years! So, needless to say, I was a bit rusty. Still am... in fact. The filtering I built still isn't quite where I want it, but I'm close. Should just be a few more tweaks, and then I'll be able to call this project complete!

When I do complete it, I'll be sure to bring some more thoughts to this article (below), but for now... enjoy the few project photos!