Watching the laundry with a Raspberry Pi
About five years ago, I replaced my washer and dryer. The old ones were fairly old, so I could justify a new purchase (even though they technically still worked). And I’d just gotten divorced, so that was my impulsive “Hey I’m single now! Watch me frivolously spend money!” purchase. I’m not terribly frivolous.

And while they’re wonderful laundering devices, technology worked against them in one key manner—their end-of-cycle notifications. The old devices had a loud mechanical NNNRRRTTT buzzer that could easily be heard up on the first floor and I rarely ever missed it. The new ones? They have cutesy little electronic jingles they play and sound like an early cell phone and cannot be heard from upstairs without your ear pressed to the floor.
Needless to say—I have forgotten about the laundry any number of times.
Well no more! I am a programmer, after all, and surely there was a software related solution to this. I’d mulled it over for a few years now, but never bothered to actually implement anything. I finally bought the equipment I needed last week, wrote the software this weekend, and now I am good to go.
The Raspberry Pi Zero W is a lovely little singleboard computre that comes from the Raspberry Pi foundation. They cost about $10 but can sometimes be had for less. It’s a very low end computing device (what do you expect for $10?), but it was all I needed for these purposes.
My plan was to get a Pi 0, the camera module, and a case for it. Then I’d mount the camera pointing at the washing machines and write up some software to monitor the machines and notify me somehow when they were done.

I bought a CanaKit Raspberry Pi Zero W Starter Kit and a camera module off of Amazon. Honestly, I probably could’ve saved a few bucks by shopping around or buying a less comprehensive kit, so don’t just blindly follow my links.
Next step was to mount it so it could view the washer and dryer, so i stuck it onto a return air duct on my furnace right across from the machines. I insulated it with a little piece of cardboard, but since it’s a return vent there shouldn’t be too much of a temperature difference between that and the surrounding air. The view was pretty good!

With the hardware in place, yesterday was a day of writing software. I’ll just give you the gist of it—
- The camera is set to a relatively low resolution, much smaller than it’s actually capable of, since I didn’t need super high quality photos. All I needed to do was look at where the timers were. The dryer, on the left, is lit up with some numbers on it. The washer, on the right merely has a black box since it’s not running right now.
- The software would need to look at just those boxes and see what was in there. Now, I could’ve gotten fancy and tried to do some OCR processing and figure out exactly how much time was left. But who wants to deal with that? A simple “has bright lights” / “doesn't have bright lights” check is sufficient.
- Most of the Raspberry Pi software projects out there use Python, which I don’t know. :-( I do, however, know JavaScript, and fortunately jimp is a pretty comprehensive image library. I was able to analyze the squares and figure out a default value (mid-gray ish, close to black), and see some HUGE spikes in brightness when any of the digits were lit up. Awesome.
- Of course, I didn’t just want to hardwire the squares to look at. After all, the camera could get moved. Or the washer/dryer. So I’d need to be able to easily re-configure that. React front-end to the rescue!

- Putting it all together, I ended up with a frontend configuration that lets you select the boxes to monitor in the image (you can barely see the blue outline around the display on the right, and even less so see the red outline on the display on the left). You can manually adjust the boxes if you need it more accurate, and it’ll tell you the current RGB average in there.
- The backend is a node process that just vends out a few brain dead simple routes—the configuration view, /config routes to save/get the boxes to watch, a /status route to say if things are running/not running, and an /image route to see what’s currently on display.
- And there’s a monitor service that uses those backend routes to figure out if it’s on. How can this determine if it’s stopped? It snaps a picture once a minute and looks at it. If it’s less than or equal to the default RGB values, it assumes it’s off. If any of the colors are more than 20 digits higher, then it assumes it’s running and stores that internally. Next, if it ever sees that the machines are currently off, but they were on during the last check, then it knows that it’s stopped. In that case, it sends a message to my Google Home (“Washer is done”).
And so far so good! It’s alerted us a couple of times and we’ve been able to go change out the laundry promptly. Technology to the rescue!
If you want to try out something similar, by all means use my little projects as a starting point. They’re all free on github under the MIT license. Do as you wish with them.
Just a couple of caveats, though—
- This is my quick-n-dirty fun weekend project. So it’s not documented or tested. You’ll need to spend a little time reading the code. That said, the entire source code for all 3 projects is only 421 lines, including the blanks. It’s super easy. Because there’s no docs or tests, of course.
- There is zero security on it. It’s sitting behind my firewall and not accessible to the world. Even if a Black Hat somehow got inside, there’s not much they can do. Watch me washing clothes? Woo. A Pi Zero is hardly going to be a worthwhile machine to mine bitcoin on. And if a friend finds it and screws up my config, it’ll take 2 minutes to restore it. No big deal. If you need security, you’re encouraged to add it yourself.
- It’s just hardwired to run on port 3000, despite the service claiming it’ll hand in a PORT via the environment.
- You’d have to manually install the service files and start them, and the front-end build needs to be manually copied to the backend’s public folder.
- It’s only set up to use a washer and dryer, but it’d be trivial to extend the software to watch multiple chunks of an image.
- It’s also only set up to notify a google home, so if you want other notifications you’ll need to roll ’em yourself.
But all that said, if you want to enter the high tech age of Google spying on your washing machine to let you know when it’s finished and spare you from trudging up and down the stairs or setting your own timer, then have at it!