loading
Picture of Internet Laundry
In a world of increasingly intrusive technologies, one sector hasn't quite wiggled its way into our beloved hive-mind.  That sector, ladies and gentlemen, is laundry.  

Where would we stand as humans in the 21st century without the ability to feverishly check the status of the things we hold closest to our naked bodies - our clothes - while they tumble round and round in seemingly endless ecstasy?  How could we live, unsure of the availability of a washer or dryer for our wet and dirty garments, longing for redemption?

It is with great pleasure that I give to the world: open source Internet Laundry.
 
Remove these adsRemove these ads by Signing Up

Step 1: Materials

  • 2 - AC Optocouplers (Lite-On LTV-418H)
  • 1 - 56K Ohm Resistor
  • 1 - 560 Ohm Resistor
  • 1 - 1uF capacitor
  • 1 - perf board (prototyping circuit board)
  • 1 - Raspberry Pi + accessories (power, ethernet, SD card)
  • a length of 4-conductor cable.
  • 1 - 3 pin 0.1" female header
Optional:
  • male+female polarized connectors for connecting the 4-conductor cable to the perf boards
Tools:
  • Soldering Iron
  • Wire Strippers
  • Screwdriver
  • Volt Meter

Step 2: Circuit Description

Picture of Circuit Description
IMG_7245.JPG
IMG_7991.JPG
Optocouplers are a great way to isolate two circuits from one another.  They operate by powering an LED in close proximity to a phototransistor.  You can think of a phototransistor as a BJT with an optically-coupled base.  Usually both LED and phototransistor are fabricated on the same die.  Some optocouplers, like the one I used, have bi-directional inputs (two back-to-back LEDs).

Here, I used my washing machine's "Door Locked" status LED voltage to optically toggle a pin on my raspberry pi.  Since my dryer doesn't have any fancy status LEDs, I used the dryer motor voltage to optically toggle another pin on my raspberry pi.  I've included the schematic above.

Step 3: Assemble the circuit

Picture of Assemble the circuit
IMG_7208.JPG
IMG_7998.JPG
Grab some perf board or etch your own board, then assemble your circuit.  Each circuit should look something like this when you're done.

The big resistor is the 56k that will connect to the dryer motor and the little resistor is the 560 ohm that will connect to the washer LED.

I made two because I have two washers and two dryers.  I soldered the male 4-pin header directly to the perf board so that it was easy to connect and disconnect the 4-conductor cable from the optocoupler boards.

There's nothing tricky going on under the board.  The two pins to the left of each optocoupler are connected to the holes in the perf board to the left of them.  Those two pins are the inputs to the optocoupler.  You can see that the ground lead for the washer LED is missing from both the boards at this point.

Step 4: Connect the washing machine

Picture of Connect the washing machine
IMG_7994.JPG
IMG_7996.JPG
The washing machine's LED will want substantially more current than we need to turn on the optocoupler.  We'll 'bleed off' or 'steal' only a little current from the LED by putting a (large resistor in series with the optocoupler) in parallel with the washing machine's LED.

I measured the voltage across the washing machine's LED to be 2V DC.  If we subtract the forward voltage of the optocoupler's LED (the voltage found across the optocoupler LED when it's in operation) and divide by the operating current (I used 1mA), then we get our resistor value.  I'm using a 560 ohm resistor.

Strip a section of wire on the positive and negative connections to the LED, then connect the optocoupler module by soldering on some long wires.  Polarity doesn't matter since we're using a bidirectional optocoupler.  The two long red wires seen above connect to the inputs of the washer optocoupler.

The 4-conductor cable i'm using is telephone cable. which has red, black, green, and yellow insulated conductors.  I accidentally went against the standard and used red and yellow as my ground leads.  I'll continue to describe how I wired things together, feel free to swap colors to adhere to the standard.
Connect the black conductor to the collector of the optocoupler and the red conductor to the emitter.

Step 5: Connect the Dryer

Picture of Connect the Dryer
IMG_8000.JPG
IMG_7996.JPG
DANGER: HIGH VOLTAGE

Make sure you have completely disconnected the dryer from mains power.  We will be soldering directly across the dryer motor which is connected to 120-240 VAC mains via the timer switch*.

Since dropping 120 or 240V across an optocoupler's LED will heat it up to the point of thermal destruction due to high currents, we'll need a higher-valued resistor to restrict those currents.

I calculated the resistance to be 120V/1mA = 120k.  I didn't have 120K resistors on hand so I used 56K resistors, providing 2mA of optocoupler current.  The resistor values are flexible.

Using the schematics for your dryer, identify the two wires that connect to the dryer motor.  strip a small section of insulation off of each wire, then solder the resistor to one lead and the other optocoupler input pin to the other.  Again, polarity doesn't matter since we're using bidirectional optocouplers (and doubly so, since the signal is AC anyway).

Solder the green wire to the collector of the optocoupler and the yellow wire to the emitter.

If you need to, add insulating tape to prevent any unwanted shorting/arcing.

*this is how my dryer works.  your dryer operation may vary.

Step 6: Strain Relief

Picture of Strain Relief
Tie a knot in the four-conductor cable with enough slack to prevent putting strain on the solder joints.
Feed the cable through a small slot or pre-drilled hole in the washer/dryer's enclosure.

Step 7: Connect to raspberry pi

Picture of Connect to raspberry pi
IMG_7988.JPG
IMG_7990.JPG
Solder a 1uF capacitor between the green and yellow conductors, then solder two-pin .1" pitch female headers between the (black and red) and (green and yellow) conductors.  Now it's as simple as plugging them into the correct GPIO headers and you're done with hardware!

Step 8: Raspberry Pi software overview

We'll use the Python programming language to write a web page that will interact with the laundry sensors. It will show which machines are on and off and how long each machine has been running, and it will email users when their laundry is done.

To interface with the Raspberry Pi's GPIO pins, we'll use the Python library available at http://code.google.com/p/raspberry-gpio-python/.

For the web side of things, we'll use the awesome web.py framework (webpy.org). Since this web page will only be used by a few dozen people, we'll use the built-in web.py development server instead of integrating our script with a professional-grade web server like Apache.

The complete source code is just under 100 lines, and is available at https://github.com/dlaw/laundry/.

Step 9: Install the code

Picture of Install the code
Finally, we have to install our code on the Raspberry Pi.

The first step is to install Python and the two libraries we'll need.
Run the following command as root:

apt-get install python python-webpy python-rpi.gpio


Next, download index.html and server.py from  https://github.com/dlaw/laundry/.
Put them in the same directory on the Pi, and make sure that you set the executable bits on server.py.

If you don't have two washers and two dryers, you will probably want to modify the device definitions in server.py, and correspondingly update the HTML layout in index.html.

If you would like a more detailed understanding of what's going on in these two files, a great place to start is the web.py tutorial (http://webpy.org/docs/0.3/tutorial).

Finally, we'll configure the Pi to start the server on system startup. 
Create a file at /etc/init.d/laundry with the following contents: 

#!/bin/sh
case "$1" in
  start)
    /home/pi/laundry/server.py 80
esac


Make sure the executable bit is set. This file tells the system to run /home/pi/laundry/server.py when it starts. The "80" just instructs web.py to run its server on port 80, which is the standard port for web pages.
Enable the startup script by running "update-rc.d laundry defaults" as root.

Step 10: Check your laundry. everywhere.

Picture of Check your laundry. everywhere.
cell.JPG
Point any browser-capable device to the webpage you just set up and you can check how long your clothes have been spinning around.  Check your laundry on two monitors at once!  Check it on your smart phone!  Check it on your friend's computer!

The checkboxes let you select which machines you care about (if there's more than one launderer) and get e-mail notifications when the cleansing is over.  You can even check your laundry on your dumb phone by submitting your phone number to the e-mail form according to your service provider's guidelines.  

Now go outside and play in the sun!
JorgeM132 months ago

The link https://github.com/dlaw/laundry isn't working.

mfashraf1 year ago
Hi. Just a question. In your schematics, you used two octocouplers right? If I want to use just one, what do I need to modify?
Another question is that instead of putting this at the disassembled dryer, can I modify it to put it at the mains socket instead?
T3h_Muffinator (author)  mfashraf1 year ago
Yes. If you want to put it at the mains socket, you would need to measure the current in the power cord, rather than the voltage between two terminals. If your dryer draws 22Amps of current on average, then you would really want to use a current transformer, which is a coil of wire with many turns (thousands) that can magnetically couple to the current in your power cable.
Hi. I've come to somewhat a problem. I have tried to make a simple circuit with an led and without any optocoupler.

Everything works but the problem is when I touch an gpio pin, it registers as off and when I take it out, it says that it is running. It should be the other way around isnt it?

One more thing, to get things working, I had to write gpio reset to the command. That will then show every port as running even tho there isnt any pins that are connected.

I know the problem lies in the program but I couldn't identify which line to fix. Do help
canida2 years ago
What ever happened to just calling the washer on old analog tepophone?!? Kids these days.
*shakes head*
*drools on the carpet*
GarthBock2 years ago
Our university has that in the dorm laundries. Students can go on the web to see what washer/dryers are available or done with their load. Nice version of this !
T3h_Muffinator (author)  GarthBock2 years ago
Thanks!

Yeah, do you use LaundryView?
Orngrimm2 years ago
Yak shaving??? :)
T3h_Muffinator (author)  Orngrimm2 years ago
ChapDad2 years ago
Nice project. I'm not going to try it, but you win bonus points for heteronormativity
T3h_Muffinator (author)  ChapDad2 years ago
Thanks. We figured that a heteronormative naming scheme would result in the highest probability of laundry machine reproduction. We even made sure to keep machine species separate, as to prevent sterile hybrid offspring.