Sunday, April 22, 2012

An idea blooms

There’s all sorts of problems out there to solve but you have to be careful.  Not everything can be fixed with a microcontroller.  Sometimes it seems like it’d be nice but then you hit hurdles – oops, now I need wireless.  Oops, there isn’t a battery big enough to make this work.  Oops, this is physically impossible.  The truth of the matter is that there are few problems that can be fixed cleanly with a microcontroller – and I’m all about clean.  I hate kludgy systems grafted on to other systems grafted on to Twitter.  Sometimes you just need to wait for a problem that is begging to have code written to solve it.
And I found that problem.  Here it is:

That wasn't like that before!
I know what you’re thinking – who could be responsible for this heinous misuse of the trash can?  WHO WOULD DARE?!  WHAT KIND OF ANIMAL WOULD DO SUCH A THING!?  As luck would have it, we know exactly who the offender is.  Here she is doing her hardest to appease us with cuteness:
Bad dog! Bad adorable dog!
Really, what kind of fool does this dog take me for?  That’s only a half-windsor!  Not bad for a creature without thumbs, I’ll admit, but this does not excuse her bad behavior. Not at all.
Naturally she only does it when we’re not in the house.  And it doesn’t take long at all – this isn’t a desperate gamble to get our attention, to force us to recognize that we are abandoning her and she has to take measures to fend for herself.  No, this is after perhaps a half hour of being alone.  That’s apparently all the time it takes her to realize that there’s bacon grease in the trash.  And boy does she love her bacon grease.  

What to do?  Hide the trash when we leave?  Not bloody likely – that sounds like work.  Get a different trash can – one that closes tightly and allows no dog to access its contents?  That’s also work – I hate going to Bed Bath and Beyond.  Plus, neither of those ideas trains our dog to be better.  Who knows where all that energy will be directed if not the trash – perhaps to the kitty litter?  I want to train her so she leaves things alone, not accommodate her bad behavior.  But she’s crafty – she only gets into the trash when we’re not present.  So how persuade her to stay away from the trash when you’re not there?  This is a solution that begs for an automated approach!  What are our options?

Well, because I keep up on the latest in tools from Cool Tools I have the inside track on a neat little device used to train cats:  the Innotek SSSCAT Cat Training Aid  It’s basically a can of compressed air with a motion sensor on it.  You put it wherever you don’t want your cat to be – usually up on counters or something like that.  When the cat jumps up there and gets within range of the motion sensor it releases a burst of compressed air that scares the crap out of the cat.  People say it works rather well – it’s a consistent negative association for the cat.  Best of all is that it’s automatic – it doesn’t rely on a person being there and consistently disciplining the cat.  That sort of consistent training helps the lessons stick.  If I want to train our dog to not get into the trash I need something like the SSSCAT.  I could probably use the SSSCAT – it wouldn’t be a bad idea for me to own one anyhow since we have two annoying cats.  But damnit, it’s spring – when a young man’s fancy turns to… engineering.  Of course.  I want to make something  and this is perfect for several reasons.
First, it’s not too complicated.  I’ve thought it out and it will only need one or two sensors as inputs and one noise maker as an output.  There are no complicated communication interfaces, no zany analog front ends, and no high frequencies.  You could code the whole thing in assembly if you wanted.   Second, nothing exactly like what I need currently exists.  The SSSCAT might work – perhaps I could place it behind the trash can or inside of it somehow, but that might just as easily not at all work.   Third is that I can add features that aren’t in any product I can find.  Inventing something that doesn’t exist but would make your life easier is the reason I got into this engineering racket.  Some people write to make the world a better place, some enter politics.  I find new ways to be lazy. Someday I dream of a world where everyone can be lazy.
So it’s decided – I’ll save the world by making something that yells at my dog when she knocks over the trash.  It’s a tall order, but I think I’m up for it. Next time I’ll discuss high-level design: why it’s important, what sort of documents you should produce as part of it and what kind of information they should contain.  We’ll also discuss project organization and folder structure if you’re lucky.