Introduction: Repair and Upcycle Defective Dryer With Arduino
After reading lots of i'bles from other authors I think it's time to contribute myself. This is about a defective dryer which I repaired a year or so ago before I even knew about Instructables. So sorry for the partially blurry and few photos.
Last year my (cheap) dryer broke after it started smelling more and more. Finally it just blew up the fuse. After dismantling the top it was obvious that the program selector switch was simply toast. The heating in the dryer is about two times about 800 Watts. And the cheap material simply did not last as long as it should have. So I had a look what a spare dial would cost me: around 80€. By far too much for such a piece of plastic scrap. So I thought: that could be a nice piece to learn working with an Arduino.
Now, just switching the heat and turning the motor to and fro was too simple then. So I though about upcycling that cheap device. Adding a humidity sensor to control and finish the drying phase was the least that should be added. A short researched resulted in the DHT-22 sensor which measures humidity and temperature. It communicates with I2C, a lib was available and that time it was below 10€ inclusive delivey directly from China. So I started developing a circuit. Eventually I found a photo of the board prototype which I added above. It has meanwhile been replaced by a nice PCB. Sorry, no photo of that one since it's locked in the dryer and at the moment I don't want to open it again. Maybe once there is another need to open it I'll take a picture.
If you want to follow this repair or if you just want to upcycle your dryer: this involves dealing with high voltage (here in Germany it's 230V AC). Only try that if you know what you are doing. Eventually you can electrocute yourself, the person using the dryer later or you might set fire in the one or other way!
Step 1: Understanding the Principle Operation
Fortunately those simple dryers are easy to understand and most are cabled in the way I show in the above picture. Since the program switch was toast I had to use my multimeter to find out the right cables.
There are two heating resistors in my dryer at each about 800 Watts. They have a common cable and two cables coming back from the other side. Just connecting them to mains would cause them to heat until the integrated heat security switch would turn them off for a moment. So that part was easy. I would later switch either of those resistors with a simple relay.
The motor is cabled similarly. There is one common cable and two other cables for turning the motor the one or other direction. To operate the motor I would go for two relays: one to turn it on/off and the other to alternate the direction.
Finally there are two main switches to locate. One door switch is simply to interrupt mains. As long as the door is open there will be no power. Once the door - and the switch - is closed the main switch can be operated. Usually this is a self-holding relay circuit. When you press the on-button the relay gets powered and closes a switch in parallel to the on-button. So when you release the on-button the relay still closes the circuit and mains is on. Only when you open the door it will open the door-switch. This interrupts mains, the relay releases and you are at start again.
Having figured out the right cables and marked them accordingly I was ready to start developing the control program.
Step 2: Designing the Control Circuit
The design of the circuit was pretty much straight forward from my requirements. There needed to be 4 relays to control motor and heating. The humidity sensor needed I2C. Also a beeper and an error LED were two obvious demands.
My first approach used an Arduino Nano (which could maybe be seen from the blurry photo in the intro which I eventually kept). Also I placed all elements on a stripe board. I had used Fritzing for the design and it basically looked like in the above sketch. However, a bit later I felt that this must be feasible wth a cheaper chip than the Arduino and I could salvage the Nano for other projects. So I made a modified design with an Attiny 85.
Top right you see the power supply. I have so many left over supplies - I simply picked one that could deliver 24V (needed for the relays). An idiot-diode to prevent toasted chips from wrong polarization and a fat capacitor. A 5V voltage regulator is used to supply the micro controller and the sensor. There should be a tantal capacitor on the output side but for me it worked without. No issues since a year.
The sensor itself needs 5V, grounds and the communication line which connects to MOSI (PB0) of the Attiny.
The relays are switched the same way. A transistor operated from a pin of the micro-controller switches a relay. The diode in parallel to the relay is essential to protect the transistor from currents produced by the relay's conductivity. Three of the relays operate as simple switches (heat1, 2 and motor) and the 4th one is a toggle to determine the turn direction of the motor.
The last left pin of the Attiny controls both beeper and error LED. The error LED follows on/off of the pin and indicates communication failures with the sensor (luckily none so far). The beeper will beep only if on/of are at an audible frequency. The LED with light when beeping but that's ok. So I need only one (the last available) pin from the Attiny.
Step 3: Adding the Sensor
I had been thinking about placing the humidity sensor inside the dryer but I was unconcerned about that. So finally I simply placed the sensor outside the machine where the air was blown to the outside.
For the sensor itself I created a little housing made from Plexiglas. This way I can pull it easily out to clean it every now and then (actually it's enough to do it once a year - just blow the dust off). The housing is glued into a PVC drainage tube like it's used for plumbing here in Germany. The smaller one takes the flex outlet from the dryer exactly so it just needs a nylon strip fixing. The larger tube was fitted to go through the outside wall.
The cable between sensor and controller was simply led between top and body of the dryer. No idea whether it's needed but I had a spare ferrite ring which I used at a number of turns.
Step 4: Writing the Control Program
I have attached the sketch and the lib for communicating with the sensor. You can simply put that into a single sketch folder to compile it. There are quite some tutorials on how to program an Attiny using an UNO so I save me from repeating that. It's easy once you know how to do it, but it took me a couple of tries. When using the Attiny there is the extra challenge that the last free pin is reserved for the reset. To make it useable for normal I/O it is necessary to blow a fuse inside the chip. So once you loaded the program and the fuse is blown you can not easily re-use the chip. Only with a HVSP which I eventually also built from another tutorial. Also simple once you know how to. You could use an Arduino Nano instead, like I did in the beginning which makes programming and debugging a whole lot easier.
When I first started with the control program I recorded the humidity during drying. I found out that it's enough to start heating with one heat source. This made humidity go up to 99% for quite a while before decaying slowly. Once it drops below 75% (checkDryEnough: humidity > 750) the 2nd heat source is added. This makes the humidity go up once more (I can't remember the exact figures but think it was about 80%). After that the controller will sense just the heat of the air. Once its getting warmer than 39° C the dryer is stopped, a sound is made and the controller enters idle state until the door is open and everything shuts down.
The controller program is mainly a state machine (like all embedded controllers). Once it's powered up (which is done automatically after closing the door and pressing the start button) a start sound is issued (which also blinks the LED as explained above). The initial delay is need for the sensor which needs a short time after power up to get ready. 2 1/2 seconds is too much, but better be safe than sorry.
There are a couple of independent timers (like clock and nextTurn) which are initialized with the target time. So clock ticks every second and nextTurn whenever it's time to turn the motor into the opposite direction. The sensor is polled every second to update temperature and humidity (pollSensor). During the pre-heat phase the sensor values are not checked. This is done to let the system start up smoothly (and get up over 75% humidity reading). The humidity at the sensor comes up very fast but I left the 5 minutes in checkPreHeated just again to be safe. After that first humidity and then temperature are checked until all is done.
The system parameters were determined for a climate in Germany and eventually in your area you need a different approach to dry efficiently. The parameters as set in the control program produce very goor results. Before the upcycle the laundry was either too dry or too damp as one needed to set a timer (by thumb's rule) and optionally the normal heat/super heat - which is now all done automatically.
Step 5: Dry Your Clothes
The program switch now is out of use. It has the error LED to the left and a small hole with the buzzer behind at the right side. It's just set in place with a bit of hot glue.
This project was endless fun. After the frustration of seeing a device broken because of a tiny thing being malfunctioning, the Arduino approach with measuring the drying process was real fun. And now each time I use the dryer I proudly think of my work and I'm happy it's working even much better than before.
One grain of salt though: the startup beep is very loud - and too long. And I'm too lazy to re-flash. So I just hold my thumb over the buzzer hole ;-)
We have a be nice policy.
Please be positive and constructive.