I made my dumb appliances smarter with the Internet of Things

Sometimes I forget things. In particular, I forget to transfer my clean but wet laundry from the washing machine to the dryer. When this happens, I have to waste time, detergent, electricity, and water to re-wash the clothes. My wife's sister has an expensive race-car-red washing machine that plays a few cheerful musical notes when the cycle is finished. That reminder is helpful, and my better half likes the little tune, but I figured I could get crafty and make the dumb old washer and dryer whisper in my ear through the internet. Here's how I did it.

That Amazon Dash button has more technology inside than the entire washing machine it's stuck to

My survey of the internet for ideas revealed a number of people with the same problem and a wide range of solutions for it. Other forgetful individuals have built laundry monitors using optical sensors that look at an indicator light on the washer's control panel. My appliance had no such light. Some tied into end-of-cycle signals inside the appliances' control circuits. I wanted a design that could be replicated cheaply and was compatible with any washer and dryer pair without voiding the warranty, so I got to work devising my own sensor package. As one might with any home-brewed approach, however, I ran into some false starts.

First off, I tried using some piezo-based vibration sensors, but none were sensitive enough to pick up the subtle dancing of the washing machine. I thought I could brute-force the problem and use an Arduino and a couple of Hall-effect-based Allegro ACS712 current-measuring sensors to see if power consumption was in a high  or near-zero state. The approach worked reliably, but the materials needed to build a robust, safe housing for the 220VAC portion of the dryer-activity-sensing circuit were too expensive. The sacrificial 220VAC power cord cost a couple times more than the Arduino, both current sensors, and the ENC28J60 Ethernet interface.

After that dead end, a little dialogue with The Tech Report editorial staff turned up Jamie Navarro's laundry monitor system. Jamie's system used an ESP8266 Wi-Fi-enabled microcontroller along with a pair of Adafruit LIS3DH three-axis gyroscopic sensors. The gyro sensors measure acceleration, but they can also report "taps" to a microcontroller. A certain number of taps in a given period of time suggest that a machine is running, and when no taps are detected over a period of time, the machine is probably finished. The sensors attach to the body of the appliance with neodymium magnets.

One of the sensors that makes this all work.

Navarro's general hardware design seemed like a good match to my goals of low cost and near-universal compatibility, but I had my own ideas for the software. His approach kept track of timing on the device itself, then used SMTP2Go's free service tier to send notification emails. I wanted to log the data and apply logic on my server. I also wanted to receive SMS messages. My mobile carrier will convert emails to SMS, but for some reason the carrier consistently rejects messages from SMTP2Go. I wanted to keep the hardware simple, so I left out the physical buttons and the indicator LEDs from Navarro's plan.

With those basics in place, I started writing some software to make my ideas work. My solution incorporates some elements of Navarro's code, but I also wrote some of my own to take advantage of the lightweight, fault-tolerant MQTT publisher-subscriber-broker protocol used in many remote-sensing applications. I wanted the monitor gadget to connect to my Wi-Fi at boot-up and "publish" MQTT messages with the number of washer taps and dryer taps detected in a ten-second period. If 100 consecutive vibration-free periods elapse, the gadget stops transmitting until it detects new vibrations.

A $4 NodeMCU ESP8266 Wi-Fi development board

So that the monitor wasn't screaming into the void, I installed the Mosquitto open-source MQTT broker software on my home server. Mosquitto includes a bare-bones MQTT subscriber binary, but it lacks any ability to act on the messages. I did a little more research and put my meager Python skills to work writing a simple MQTT "subscriber" using the Paho MQTT Python library. The subscriber program accepts messages, adds date and time information to each message (the ESP8266 lacks a real time clock), and logs all data to a file. I didn't want to get false alarms when my dog's tail slaps against the washing machine or someone unloads the dryer, so I added some simple logic to determine whether the appliances were really running. If the subscriber script thinks one of the machines has started running, it sends a quick email. When the conditions match the signature of the end of a cycle, the software sends an email and an SMS via IFTTT. If one machine finishes while the other is running, no message is sent. I don't care if the washer is finished if the dryer is still running.

With all that groundwork laid, I set up a cron job on my server for the Python script to run at boot time and restart in the event of a crash. I made some mistakes in this step that led to receiving 50 emails when the dryer started and stopped, but I eventually figured it out. It took a few days to accumulate enough dirty clothes to get the sensitivity for each sensor dialed in—at one point I had the dryer sensitivity dialed in so high I was receiving emails when the furnace kicked on—but the gadget is now working reliably. The device reliably sends alerts when the washer and dryer run, and the usage of the MQTT protocol allows me to keep precise logs of washer and dryer operation. With my new setup, laundry cycles will be wasted only through willful laziness.

Over the course of developing the system, I learned plenty about microcontrollers, programming in the Arduino IDE, and working with the MQTT protocol. I would like to give credit to Jamie Navarro for the general design. Nick O'Leary's Arduino Client for MQTT code, with its excellent example files and API documentation, was also instrumental in creating a working system. An even greater reward for me was the way the ESP8266 brought past and future together. When I first became interested in computers in the mid-1990s, Wi-Fi didn't exist at all, and a 32-bit chip running at 80MHz was impressive. The ESP8266 packs 802.11n capability that was cutting-edge a few years ago into a board that costs less than $4. At the same time, programming the little chip is like taking a time machine into an era where 100KB was a lot of memory and the only way to tell if a program was working was to watch blinking lights. The community surrounding the Arduino and the ESP8266 is lively and helpful.

I have more ideas for similar sensors in my home, including an ESP8266-based sous vide water bath controller that uses MQTT to receive a target temperature and logs current conditions on my server, a device that uses a ultrasonic distance sensor to track the depth of water in my house's sump pump well, and another vibration detector that will track the activity of my HVAC system. For now, though, I'm just happy to know when my clothes are clean. If you suffer from the same absent-mindedness, the code for the ESP8266 and the Python MQTT subscriber client are both available on GitHub. The code works, but I'm sure you gerbils can point out many elements that could be improved.

Comments closed
    • gmskking
    • 3 years ago

    Cool but an awful lot of work here for a dryer. lol.

      • BIF
      • 3 years ago

      I agree. Now, I of course totally support coding for learning and stuff, so I say good on the author for his work.

      But for me, this is a solution looking for a problem. Beyond the learning effort, which I acknowledge is maybe the sole-best reason for this, the time and effort needed for the coding alone will never really be recovered. Not in my house, anyway. Besides, who forgets clothes in the washer? (just kidding! 😉 )

      No, I think I’d rather just set my dryer’s alarm sound to blare at the end of a drying cycle. It scares the bejesus out of me no matter where I am in the house, and probably shortens the life-expectancy of my next door neighbors’ dogs and maybe some vultures flying around outside too.

      Yeah, I said dryer’s alarm, so please bear with me. For the washer, which doesn’t have an alarm, I just set an egg timer to an hour. But I really don’t ever need that because it’s really only that first load that I might need to alarm, since the second load runs concurrently while the dryer is working on the first washer load. Yeah, I always have more than one load to run.

      Anyway, my dryer (low heat to help clothing last longer) cycle is always longer than my washer’s cycle, so the clothing sits in the washer for what, 10-15 minutes maybe. And then the dryer has that scary nerve-jangling alarm. Have to get the wrinkables out of the dryer right away anyhow, so it’s not like I’m going anywhere on laundry day. I’m always within the blast-zone of that ear-splitting klaxon…

      One day (hopefully before a catastrophic leak happens), both machines will get replaced. The new washer will be a high efficiency version, which means it will extract more water during the spin cycle (making the dryer not need to run so long). Any new machines will no doubt be able to text me, tweet me, tell me when I need more detergent or little antistatic sheets, and even sing me to sleep. Or better yet, write me a hit song. :O

      But on the first hand, there’s no better teacher than a problem to be solved, so good job.

      Or maybe Whirlpool or GE will be willing to pay licensing fees for something like this, huh? Entrepreneurism FTW! 🙂

    • TheMonkeyKing
    • 3 years ago

    Why don’t you use MQTT to send a message to you via GroupMe or some other messaging? You don’t need IFTTT which is basically trying to capture all your data so that it can become the next Google/Apple with aggregate data characteristics.

    • Anovoca
    • 3 years ago

    Next step, Install CA Autosys production scheduling agents on a unix server to monitor the execution of home appliance run parameters from a digital console.

      • BIF
      • 3 years ago

      I want to see the metrics every six months, including service level achievements regarding response times and total system availability. Oh, and when you have time, I’d like you to add a database categorizing outages by date, time, and severity, and don’t forget we’ll need to manage our Maytag repair man’s vendor service calls, including background checks and guard entry into the abode.

      While we’re on the topic of security, we wouldn’t want to implement anything without adequate protections against Russian hacking. God forbid that our washer’s temp was set to “hot” while we were walking the dog. In just a few short years, Laundry Room Security will be a Real Thing and it won’t just be your daddy’s insistence on making sure all the doors are locked when you leave the house… 😉

    • Redundant
    • 3 years ago

    I like this. Gotta figure out how to have them send a signal to the wife’s shock collar.

      • Chrispy_
      • 3 years ago

      Casual racism or sexism, even in jest is still racism or sexism and letting it slide is almost as bad as condoning it.

        • liquidsquid
        • 3 years ago

        And all this time I thought I just left my dirty laundry out, and it magically appears neatly folded in my drawers!

        [url<]https://www.youtube.com/watch?v=SqQgDwA0BNU[/url<]

        • Anovoca
        • 3 years ago

        Eh, I think most people are offended because the joke wasn’t funny.

        • derFunkenstein
        • 3 years ago

        racism?

      • BIF
      • 3 years ago

      Offensiveness doesn’t offend me, but I downvoted you for being unfunny, which really is offensive, but in a different way. 😛

    • SecretMaster
    • 3 years ago

    This seems excessive… couldn’t you just set a phone alarm when you put your laundry in?

      • BIF
      • 3 years ago

      Phones let you talk to them to set an alarm. “Hey Siri, remind me in an hour and a half that the wash is done”.

      “I’m sorry, I didn’t get that.”
      or…
      “Okay, I won’t forget to remind you next month that frogs are fun.”

      Well, on second thought…

    • Shouefref
    • 3 years ago

    He was dumb enough to make this appliances smart by using the cloud.

    • weefatbob
    • 3 years ago

    I did something similar for my cooker and washer dryer, however to avoid using unreliable sensors I opted to use a SCT-013-030 for the washer dryer and a SCT-013-050 for the cooker and attached them over the power cables for each, simple to code for and simple to attach. I just monitor for low power usage for 30 seconds on each. So far it has worked great, just need to work on a better system to notify me, as I use a wireless relay that activates an old electronic door bell that plays a very very annoying tune.

      • willmore
      • 3 years ago

      Why not just tap the power from the timing cam and use an optocoupler to drive a GPIO? There’s way too much effort being spent here to guess what the machine is doing. Why not just tap into the ‘brain’ directly and stop guessing?

      Edited to add that I once designed appliance controls in a past life.

        • weefatbob
        • 3 years ago

        For simplicity. If I was going to go internal and go to such lengths as you mentioned, I would just tap the end light itself as a trigger and avoid all unnecessary hardware connections. My method took 20 seconds to attach externally. It is also hard to go wrong with monitoring the power externally as I do. Has worked perfect for over a year now.

        Also a design engineer, for 25+ years, so simple and safe rules all my decision making processes.

          • willmore
          • 3 years ago

          I think the ‘safe’ is well taken care of by using a wireless link. Hard to get electricuted over one of those. 😉

    • ronch
    • 3 years ago

    Wayne Manion.. Is this a play on Wayne’s Mansion?

    • ronch
    • 3 years ago

    Is that ‘LoLin’ I see there? LOL.

      • derFunkenstein
      • 3 years ago

      They see me LoLin
      And hatin
      And trollin so hard cos I’m washing dirty (clothes)

        • chuckula
        • 3 years ago

        Try to catch me washin’ dirty (laundry).

          • derFunkenstein
          • 3 years ago

          Dammit. Good fix.

    • Rakhmaninov3
    • 3 years ago

    Officially the nerdiest thing I’ve ever seen, well done! 🙂

    • DarkUltra
    • 3 years ago

    Hi!

    I use Nexa decices and Tellstick net with Remotestick and Tasker on my Android phone to control the lights, ovens and blinds in my apartment. When Tasker notices my home wifi is disconnected, it raises the blinds, turn off the ovens and turn off the lights. When I come home vice versa except the blinds.

    • Forge
    • 3 years ago

    I was recently gifted a network controlled power strip. I’ve been considering doing something similar, wiring up my dumb washer and dryer to it and hard-wiring them to start on power on.

    For now I’m content to just keep thinking about it, though.

    • adamlongwalker
    • 3 years ago

    There is a time and a place for things and though this is a cool project this is not my thing as I am a firm believer of certain things not being internet capable and pretty much having a dumb appliance stay a dumb appliance. The less electronics the better in certain situations.

    I have a 1984 washer and dryer that is fully repairable and works very well and the wash/dryer loads are very very large. Last year my dryer decided to try and destroy itself and I was going to just by a basic washer/dryer set until I saw this on youtube.

    [url<]https://www.youtube.com/watch?v=hk2TfF1M4r8[/url<] Luckily my skill set is well diverse enough to tackle repairing equipment. My basic repair cost only $10.00 and that was a repair to the tumbler and 1 tumbler carriage holder. I spent an additional $75.00 on all new felt, belts, and rollers. A whole lot cheaper than buying a new Dryer and the old Dryer runs like new. I will keep my dumb appliances as long as possible, because I can fix them and the parts are readily available. As for this project. I still do my laundry at a certain time of the day on a certain time of the week and this interesting project (yea its rather cool though) does not affect my quality of life. Because that is all that part does. It notifies you when the laundry is done via the internet. Okay... an extra part that breaks down over time and generally speaking today's electronics,... they break down a lot faster due to our consumerist society.

      • Srsly_Bro
      • 3 years ago

      #makeappliancesdumbagain

      • derFunkenstein
      • 3 years ago

      Well it’s not like he can program the washer to just run loads via wifi. This has a specific purpose of sending emails from his in-house server. It’s a pretty useful feature that doesn’t have a lot of downside.

      • barich
      • 3 years ago

      Old dryers are fine, not much has changed there over the years, but new washers are vastly more water and energy efficient than old models and clean clothes as well or better.

        • BIF
        • 3 years ago

        I’ve heard this too. New washers use like a teaspoon of water and a soap packet not much bigger than a sugar cube (remember those?) and they have warp-speed spin cycles. Your clothes are almost dry enough to wear when you take them out of the washer!

    • chuckula
    • 3 years ago

    Thanks for the cool article. This is far more interesting than reading a press release about a random “IoT” appliance.

    Quick question: How concerned are you about long term hardware durability due to vibration & potentially humidity? I personally remember putting together a temperature sensor package with a Raspberry Pi that worked fine for a month or two but eventually flaked out, and some of those environments might be hard on the electronics.

      • derFunkenstein
      • 3 years ago

      Humidity is a good question. I’d be concerned about corrosion.

      • WayneManion
      • 3 years ago

      I will be 3D printing a little enclosure for the NodeMCU. As for the sensors, I have thought about spraying them with Plasti-Dip to prevent short-circuits. I don’t want to put the sensors in boxes, because close coupling to the appliances is critical for vibration detection.

      Really, the little machine only has to last as long as the washer and dryer. The laundry machines are already seven years old. I would imagine in another 5-10 years laundry machines will have this sort of thing built in (for better or for worse).

      I’m not worried about humidity. I’ve had my gaming desktop and my home server in the basement since we moved into the house seven years ago. My dryer vents outside. The basement is ventilated and has essentially the same humidity level as the rest of my house.

      If the machine fails, a new microcontroller is less than $5 and new sensors are almost as cheap. I have some $2 ADXL345 gyro sensors on the way. If they work out, the total cost of the electronics drops to around $10 including a 500mA USB charger.

        • JustAnEngineer
        • 3 years ago

        You can’t necessarily plan on appliances failing quickly to trigger an upgrade. My washer and dryer are over 25 years old and still providing good service.

          • danazar
          • 3 years ago

          I think the Internet of Things will mean you can plan on appliances failing quickly to trigger an upgrade. If folks think it’s bad how an 18-month-old phone no longer gets new UI features or security updates, just wait until your fridge or washer suffers a 0-day exploit and the manufacturer tells you to buy a new model…

          Smart appliances are all going to lack the one feature that will make them last for 10+ years, and that’s the lack of user serviceability. I can replace an Android phone with another Android phone, but I don’t want to have to replace my whole fridge just to replace the IoT module inside.

            • derFunkenstein
            • 3 years ago

            and that is why I won’t buy one.

    • Froz
    • 3 years ago

    That was interesting read. However, I can’t stop laughing, because you aim to do something that my basic washing machine does (signal when it’s finished) and which I hate to the point that sometimes I want to find the beeper in the thing and crash it to pieces.
    It just won’t stop beeping every few minutes until I go there and turn it off (obviously without taking clothes out, that can wait :p). I also don’t think I ever had to re-wash the clothes. They are perfectly fine even if they sit there for a day.

      • DPete27
      • 3 years ago

      Good idea! This sounds like a simple switching protocol.

      Washer starts = power on device
      Washer ends = activate alarm
      Open/close door = deactivate alarm & power off device.

      Of course, if your washer already has a cycle complete beep, that can easily be used to activate a continual alarm until the door is opened.

      • StefanJanoski
      • 3 years ago

      I find that clothes can get a bit smelly if they’re left to sit, washed but wet, for too long, but it usually goes away once they dry. I can only imagine it would be improved with a tumble drier, too, but I don’t have one and they’re not especially common here. Most people hang dry their clothes.

Pin It on Pinterest

Share This