In this project, we will be looking at sending an email from a clothes dryer.
Once the clothes are determined to be dry, an email will be sent to alert the clothes are ready to wear.
This is what we are trying to achieve:
New dryers have an automatic cycle these days, so this project does not apply.
However, this project might come handy if the automatic cycle in these appliances is not properly working anymore, or in the case of old dryers.
The storyThe reading of this section is optional. If you are in a rush or just prefer to skip it, please go ahead and jump to the next section.
Nobody can deny that a clothes dryer is helpful. You wash your clothes, load them in the dryer, start the drying cycle and walk away. You come back and the clothes are dry. Period.
For those of you living near the Equator, drying your clothes outside is certainly not an issue. Hence, you wouldn't need a dryer.
However, when latitude starts to increase and you live farther away from the Equator and closer to the South or North Poles, things start to change. With temperatures below freezing levels, if you were to hang your clothes outside they would freeze in a matter of minutes. What is even worse, if freezing rain falls, probably your clotheslines will succumb to the extra weight. Not many things stay up during a heavy freezing rain, proof of this is what happened in Montreal, Canada in 1998. Power lines, trees, everything came down. A real mess.
Another option would be to hang your clothes inside your house, all over the place. Good luck receiving visit on laundry days.
So for all of us living far away from the Equator, a dryer is very helpful, even mandatory. Imagine the magnitude of the problem when your dryer hits turbulence.
Some time ago, our dryer certainly hit some.
The problemThe issue with our dryer was that when we came back expecting dry clothes, we found them wet. We called the service, they came to check it and they found that the sensor that controlled the automatic cycle was dead. Even worse, there was no replacement for it. After all, we are talking about a 5-year-old relic!
Ouch.
The problem with replacing a dryer comes from the fact that dryers are frequently matched with washers, they come in beautiful, shinny pairs. To make things more difficult, chances are that your dryer is already discontinued like mine and getting the same one is impossible. So to replace one, most of the time you end up replacing the pair.
After accepting the fact that we needed to replace it, we started shopping for a new one. Since our dryer was discontinued, we were looking for similar ones so they could match the washer we had. No luck. Discouraged, we decided that we will get a new pair when the time comes for the washer too, not earlier.
The home-made solutionSo what can you do when the automatic cycle of your dryer breaks? You guesstimate how long it would take for your clothes to dry and you run the cycle for a fixed period of time.
If your guesstimate falls short, your clothes will still be damp when you come back. So you will have to guesstimate a new cycle, and come back later.
On the contrary, if your guesstimate is too long, or you overcompensate because you are tired of coming back and finding the clothes damp, your clothes might start to get toasted since they were dry for the last half hour. Waste of energy? Nahh.
The IoT solutionWhat would be do without the power of IoT these days? In this case, spend more than a thousand dollars to replace almost perfectly working appliances.
With the power of IoT, we can now spend much less than that to fix this particular issue.
Let's find out how.
The IoT algorithmTo detect when the clothes are dry, we will be using the temperature and the humidity readings.
At the start of a normal drying cycle, the clothes are wet. This translates in the humidity being high. The temperature will be around the ambient temperature or even very low, since your clothes might have been washed with cold water.
During the drying cycle, the temperature will continuously go up and the humidity will go down, as the heat generated by our dryer forces the water in the clothes to evacuate via the duct.
Our desired algorithm will need to detect when the temperature goes over a certain threshold and the humidity goes under another certain value.
After playing with different types of loads, this is what I observed to be the best values:
- temperature over 50 degrees Celsius
- humidity under 10 percent
In the Particle software, this translates in this line of code:
if ( dryer_on and ( humid < 10) and ( temp > 50 ) ) {
We can better observe this behavior with a trend chart:
If you like your clothes drier (ie: more dry), then you would have to adjust the humidity threshold to a lower value, perhaps in the range of 5 to 8 percent, or if you want them crispy, you would lower the value to 2 to 4 percent. Automatic dryers have a setting for this, since I can find "More dry, dry and less dry" settings in the front of my dryer.
The IoT hardwareWe are going to use a DHT22 to sense temperature and humidity, and a Particle dev kit for the processing. If you have never played with a Particle, go buy one right now. It's an arduino compatible microcontroller that includes WIFI out of the box. You can flash it from a browser over the internet. It comes with a free cloud. And so many other perks! It's INCREDIBLE.
The mandatory warningELECTRIC HAZARD: BE EXTREMELY CAREFUL WHEN DEALING WITH ANY ELECTRIC EQUIPMENT
ELECTRICITY CAN KILL YOU
FIRE HAZARD: BE EXTREMELY CAREFUL WHEN WIRING THIS SENSOR INSIDE YOUR DRYER. YOU CAN POTENTIALLY BURN YOUR HOUSE TO ASHES
Please be careful when placing the sensor and wiring it to the Particle as proposed in this project. The wire CANNOT get close to the heating elements inside the dryer.
Ready? Are you sure?
No? Close this page right now.
Yes? here we go...
The IoT sensorWe have to install the DHT22 inside the dryer. I can't tell you where you can install it, since different dryers have different shapes, but I can show where I installed it.
Looks at this series of photos:
As you can see, I placed the sensor on the outside of the lint screen. In other words, the lint coming out of the clothes hits the screen first. This is to protect the sensor from filling up with lint and not sensing properly.
An alternative place to place the sensor could be the dryer duct but I haven't explored this.
Now wire the sensor to the Particle as specified in the schematics. Remember that it cannot come close to any heating element inside your dryer, or else you risk flaming your house. Really, be safe and think before you wire it.
The IoT softwareGet the code from the software section below (you only need the dryer.ino file) and flash it in your Particle. You would need to add the fantastic PietteTech_DHT library when in Particle Build.
The IoT notificationsI chose to send emails to my phone whenever the dryer would be done, and this is how it looks:
The email originates when the Particle senses that the humidity is low, meaning that the clothes are dry, according to our algorithm (please check the section The IoT algorithm above). This information is published to the Particle Cloud, where we have installed a webhook.
The webhook in time sends an HTTP POST request to the AWS API Gateway, which in turn calls the AWS SNS service. Finally, the AWS SNS service is configured to send me an email.
Let's try to illustrate that with some pictures:
The steps for making the email notifications work with Amazon Web Services are countless. I have spent over a week trying to make it work - not full time mind you, remember this is a hobby of mine, but still. The AWS are huge and extremely powerful. While I find the documentation spotless - it's really amazing - end to end scenarios in general are missing explanation and you have to connect so many services and figure out everything on your own that it takes a lot of time.
The walkthroughs are great. However only few scenarios are covered, and maybe none of them are end to end. Of course this is reasonable due to the number of applications running in the AWS. Murphy's Law also ensures that your use case (for instance: sending emails from my Particle) is not covered anywhere, or maybe it's just me who did not find it.
At the beginning of The AWS IoT Mega Contest! I thought Amazon was doing it because they wanted to promote the new AWS IoT service.
I now believe that not only they wanted to promote it, but they wanted people to write tutorials and projects on how to use it so more end to end scenarios and real world use cases are documented, and this coming from hackers and makers around the globe.
In my opinion, the AWS offer you a super powerful cloud, and seems you can do anything with it. Anything. And I don't think that is a bad thing. Just mind the ramp up in the technology, since it's pretty steep.
However I can't complain. The contest forced me to learn about AWS and now I'm pretty happy with what I know, even though I have only scratched the surface.
To simplify the reading and the flow of this project (and avoid overloading your browser), I decided to write all steps in a separate article about "Particle-AWS Email notifications" and you can find it here.
SavingsMy savings over this project are:
- more than a thousand dollars in a new pair of washer and dryer appliances
- few bucks on saved energy every month since I don't toast my clothes anymore
On average, our guesstimate for the dryer was 15, even 30 minutes too long.
We use the dryer five times a week, so we are saving a bit every week.
The investment on hardware was $20 for the photon, $4 for the DHT22 (I've ordered like 4 some time ago on ebay) and $5 for the breadboard. Oh, one buck I spent on the wire I used. All that for a grand total of $30. A bargain!
ImprovementsInstead of getting an email, we could make the Particle shut off the dryer.
This will require either to add a nice (and big) relay to interrupt the electricity that feeds the dryer. This could get costly since the dryer is both a high voltage and high current appliance. Mine is 220 volts and like 20 amperes if I did the math right.
Alternatively, one could open the control console of the dryer and operate the stop button on the front with an optocoupler (check this project out for an example on how to achieve this) or a cheap low current relay like I used in my Garage Commander project.
Final wordsThat's it.
I saved a big chunk of money when I avoided replacing my appliances and I save now a little bit every month, all thanks to the power of IoT. Isn't it amazing?
Feel free to leave me your comments below, or visit my other projects.
Gustavo.
Psst: please find my other projects here.
HelpIf you require professional help with your projects, don't hesitate to write me a line about your needs at gusgonnet@gmail.com. Thank you!
Comments