Close

Entry 1: the One-Day Hack

A project log for The Wash-Is-Done-inator

I'm tired of wasting time between when the washing machine finishes, and when I notice it's done. Time to build a gadget!

Jorj BauerJorj Bauer 01/29/2018 at 01:400 Comments

Every weekend works pretty much the same way. No matter whether it's me or my wife doing the laundry, it goes something like...

1. Put laundry in washing machine

2. Put detergent in laundry machine

3. Start washing machine

4. Yell at Siri until the alarm is set correctly

5. ... forget about the alarm, because it didn't get set properly, and then remember the laundry's done like four hours later.

Wouldn't it be nice if this 20-year-old washing machine could, y'know, IoT its way in to my life? And with all the time we'd save, I'm *sure* we'd finally be able to take over the tri-state area!

This build has been on my back burner for ages. Sure, I could wire in to the control circuit board to grab the seven-segment display outputs (both of them) and figure out how many minutes are left. But that seems ... inelegant. And if I'd put something over the display, it seems like that would reduce the general usefulness of the display itself. So I've left this on the back burner, waiting for my brain to come up with a better plan.

Well, that time came this weekend.

It occurred to me - while thinking about how I should be cleaning up all the crap in the basement so I can actually find things in my workshop again - that I don't actually care how much time is left. It would be nice, sure. But what I really want to know is: Is It Done?

That's a much easier problem. Monitor power draw, perhaps. But there are quiet periods, so that would mean heuristics that I'd rather not touch. (Plus, not really thrilled with tapping the power mains - or splitting the wires so I can monitor flux, for that matter.) OCR, maybe, with a camera? Too much trouble, and too fiddly - the camera would probably lose alignment easily.

No, today's epiphany was that all I need to do is monitor one LED.

The power LED, for example. A couple minutes after the wash cycle is complete, the whole front panel goes dark. It's on solid through the wash cycle. And I'm certainly not losing any information while blocking it - the rest of the control panel is lit up like a Christmas tree.

A quick raid of supplies, then, and maybe I can make this a one-load-of-laundry hack!

* One Adafruit Trinket. An ATTiny85, packaged with a Mini USB port and bootloader.

* One photo interruptor.

* One Adafruit MAX98306 3.7 Watt Class D amplifier.

* One crappy speaker salvaged from a noisy birthday greeting card.

* Some blue painter's tape, some wires, USB cables and USB power supply.

The photo interruptor was from a project a few years ago, where I needed a stop sensor. I bought 10 random photo interruptors from the first place I found them on Amazon; it was a "I need it now" kinda thing, and I wasn't picky about the particulars. I wound up with 10 HY301-21 slotted photo interruptors.

For those that don't know what these are: they're really simple. One side has an infrared LED in it; when you apply voltage, it lights up. But it's encased in black plastic - with a single slot in it, allowing the infrared light to escape toward the center channel. And on the other side of the channel is a similar slot that opens up to a phototransistor. You read the phototransistor to see whether or not you're seeing infrared light; if you're not, then you know something is physically in the channel between the LED and receiver.

The important thing for this build is that these are two completely distinct components. By cutting the plastic in half, it's possible to use just the sensor piece without the Infrared LED. And the phototransistor isn't only sensitive to infrared light. It senses lots of kinds of light (albeit not necessarily as well as infrared light).

A couple resistors later, presto - you've got a sensor that will tell you whether or not any old LED happens to be emitting light. Add some blue painter's tape to affix it to an LED on the washer's control panel and suddenly you've got a non-invasive hack that can tell you when your washer's power LED is turned off.

Which is what you see here:

The sensor is taped over the power LED, on top of the start button; that runs down to the Trinket, which is just (at this point) turning its own LED on and off to mirror the state of the power LED. The simple but important piece of circuitry looks like this:

The code is pretty straightforward - attach this to a digital input, perhaps something like this for an Arduino Uno...

#define LED 13
#define SENSOR 2
void setup()
{
  pinMode(SENSOR, INPUT);
  pinMode(LED, OUTPUT);
}

void loop()
{
  digitalWrite(LED, digitalRead(SENSOR));
}

And from here, it's just a matter of "how fancy does this need to be?"

For a first cut, the answer is "not very fancy." I just rigged it up to make noise whenever the LED was off, as a proof of concept. And then things start to get interesting...

Discussions