Laundry Detector

Evelyn Bang

Overview

Bottom of the image shows a white washer which has a dryer on top of it. The washing machine opens on the top side, like a trapdoor. On the right is the Laundry Detector wedged into the corner in between the washer and the dryer. On the left is while foldable drying rack.

The Laundry Detector checks to see if laundry is done at any given moment. It has three inputs: time, distance, and acceleration. These three factors into the open state of the laundry door, the movement of the machine itself, and how long it has been since it last moved.

In the middle of the screen is the open washing machine with the door opening upward. The right side shows the Laundry Detector in the wedge in between washing machine and the dryer.
This is a zoomed out version of the previous photo which shows the washing machine towards the bottom middle of the image. The door of the washing machine is closed with the Laundry Detector wedged in between the dryer (which is on top) and the washing machine. On the right side of the washing machine is a folded up drying rack. On the left side is a door with a mirror hanging on it. On the right side is an opening with an open door.
In the middle of the screen is the Laundry Detector with its green LED on. On the right side is the yellow and red LED in that order around an inch apart. The left side shows part of the washing machine door open with an optical proximity sensor sticking out of the Laundry Detector.
In the middle of the screen is the side of the Laundry Detector, which is open to the left. Each piece of the Laundry Detector is labeled with a yellow tape. Inside of the container is the wires, an Arduino Uno, and a battery.
Evelyn_Bang_Video.mp4

CC:

"Hi, my name is Evelyn Bang, and this is my project, Laundry Detector. The Laundry Detector is a personalized project that was a response to my washing machine not making any sound or light indicator whenever it was finished. As a result, I wanted to make something that would let me know when my laundry needed to be put into the dryer. As shown in this video, the detector is illuminating green for when it is available to load in laundry, red for when it is washing some laundry, and yellow when it has finished the laundry which is coupled with a buzzer that tells me that the laundry has finished."


Extra Notes:

I tried thinking about different ways to approach this project, which ended up being narrowed down to two options, which were to use a movement detector for the movement of the machine itself or a humidity sensor for the water inside of the washing machine. I concluded that using a humidity sensor would be difficult especially if it could be knocked around with the laundry inside, so I decided to go ahead with the movement detector, which was imputed through a 3-axis accelerometer. This would detect the acceleration of the machine to see if it is moving or not. Another input that I had to use was an optical proximity sensor, which would check to see if the machine’s door was open or not as a way to show that the machine is ready for the next load.

Process

In the middle of the image is a white board table with the blueprint of the laundry detector with measurements and labels.

This is the drawing of the box container before going into Fusion360 as a visual reference. I made sure to measure my laundry machine for particular angles and widths that would limit the size of the container.

In the middle of the screen is the Fusion360 open on a black laptop. The 3D model of one of the pieces of the Laundry Detector is in the middle of the screen.

Here is the beginning of what my 3D model looked like. It took around 3 restarts to get the general shape and pieces right, especially because of there been an angular piece on one of the sides.

In the middle of the image is the laser cutter cutting a piece of 3mm thick acrylic sheet that has a beige sticker cover as a protector. The laser cutter arm is on the top right of the sheet of acrylic and is in the process of cutting it.

After finishing the 3D model and making sure it would fit into the corner of my washing machine. This is the laser cutting process. I had to reprint one of the pieces, since it didn't finger joint as side during the modelling process.

On the left bottom is the pieced together Laundry Detector before it has been glued together. It is held together by blue and yellow tape. On the right side is the finished 3D model on Fusion360 on a black laptop.

Here is the comparison of the assembled container and the virtual version. It turned out that I accidentally 3D modelled an inverse version of what I wanted to have, but it turned out that my sketches that I picked out in order to print on the laser cutter made it turn back into the right version.

In the middle of the image is the opened up Laundry Detector with loose parts on the inside. The pieces are labeled with yellow tape. There is also a 9V battery that is loose next to the Arduino Uno.

After super gluing the pieces together, I placed in the pieces into the box and taped some of the pieces down in order to not have any loose pieces.

The Laundry Detector is on with its forward facing side towards the camera. The green LED is on which is on the right middle of the container. The yellow and red LEDs are off with about an inch distance between each light. The side of the Laundry Detector is open with a power cord running outward.

Here is another angle of the same object as on the left. I did have some trouble at first with coding the timing of the buzzer and LEDs, but after trial and error, it responded the way that I intented it to.

Discussion

During class critique, I got two main notes for my prototype that addressed my two concerns. First, I was wondering how I should check to see if the washing machine was still in progress while the water was filling up. Since this process doesn't have any motion being sent to the 3-Axis Accelerometer, I had to implement code that would compensate for those sections of silence by setting up a timer for how long it takes for the machine to fill up. One note for this process, though, is that there is an extra five minutes at the end of the washing machine, which I deemed not that big of a deal personally. Second, I also had trouble with is the angular joints. I do remember being told that angled joints are finnicky, so it should be approached carefully. Consequently, I tried to logically think out where the alignment of the pieces would line up and which side of the 3D model piece needed to be turned into a file for the laser cutter. This worked a lot more smoother than I thought it would, which I am very thankful for.

I am very happy with how the project turned out, especially with the code and design finalizations. The color matches very well with my washing machine as planned, and the code runs smoothly after a lot of testing. I did feel somewhat frustrated with the code in the middle, which made me keep going to the drawing board to lay out the pseudocode of the program multiple times.

It was fun going through the process of realizing that I was doing something wrong and starting over with whatever part of the project I was working on. I had to constantly look back and forth at the bigger picture and then the smaller details, which was also very intriguing. If I were to do something different next time, I would definitely put labels on the wires themselves to see which pin on the Arduino they go to, since the components are snug into the container box, making it difficult to see which wire goes with which part.

If I were to do another iteration of this project, I would definitely try 3D printing the case instead of laser cutting it. That would allow smoother edges and an easier process of making movable joints for the opening of the container into the electronics. I could also try to design it such that it hang on the laundry machine without any extra help of duct tape or other adhesives.

Technical Information

This is a block diagram of the parts in this project. On the left are the optical proximity sensor and the 3-axis accelerometer which is connected to the Arduino Uno in the middle. On the right is are the active buzzer and three LEDs.
This is the schematic of the project. On the top is the 9V battery. The middle shows the Arduino Uno, which is connected to the optical proximity sensor on the left side on pin A0. There is a 220 Ohm and 5.6k ohm resistor that is also connected to it. On the bottom left is the 3-axis accelerometer which is connected to pin A1 and A2. On the right side is the active buzzer connected to pin 8. There are also three LEDs connected to pin 9, 10, and 11.

/*

  Laundry Detector

  Evelyn Bang


  Laundry Detector uses a 3-Axis Accelerometer, Optical Proximity Sensor, Active Buzzer, 3 LEDs, and a Battery in order to check to see if the laundry has finished. This project is to address a personal problem in which the laundry washer would not produce any indication that it was finished washing except by an absence of sound, which is difficult to notice.


  PIN MAPPING:

  pin   |  mode   | description

  --------- 3-Axis Accelerometer ---------

  A1    |  INPUT  | X-axis motion detector pin

  A2    |  INPUT  | Y-axis motion detector pin

  ------- Optical Proximity Sensor -------

  A0    |  INPUT  | distance detector pin

  ---------------- Buzzer ----------------

  8     |  OUTPUT | buzzer pin

  ----------------- LED -----------------

  9     |  OUTPUT | red LED (washing currently)      | closed lid + moving

  10    |  OUTPUT | yellow LED (washer is finished)  | closed lid + not moving

  11    |  OUTPUT | green LED (washer is empty)      | open lid + not moving - don't even need to detect movement (just check if open)

  --------------- Battery ---------------

  power |  INPUT  | powering the Arduino without laptop with a battery



  NOTE:

  - Z-axis Acceleration not needed because not moving up and down

*/


// GLOBAL VARIABLES

// 3-Axis Accelerometer (movement detection)

const int xMovePin = A1;

const int yMovePin = A2;

int moveLast = 0;  // Last time moved

int xPos = 0;

int yPos = 0;

int xPrev;

int yPrev;

bool moving;

// Optical Proximity Sensor (distance/lid open state)

const int distPin = A0;

bool lidClosed;

// Active Buzzer

const int buzzerPin = 8;

// LED

const int redLED = 9;

const int yellowLED = 10;

const int greenLED = 11;

// Other Vars

unsigned int accelWaitTime = 300000;  // 5 min timer

unsigned int prevTimeMove = 0;


// SET UP

void setup() {

  pinMode(buzzerPin, OUTPUT);

  pinMode(distPin, INPUT);

  pinMode(xMovePin, INPUT);

  pinMode(yMovePin, INPUT);

  pinMode(redLED, OUTPUT);

  pinMode(yellowLED, OUTPUT);

  pinMode(greenLED, OUTPUT);

  moving = false;

  lidClosed = false;

  Serial.begin(9600);

}


// LOOP

void loop() {

  /*

    --------------------------------- Lid State ---------------------------------

  */

  // check if lid is open

  int dist = analogRead(distPin);

  if (dist > 250) {

    //check unit of measurement

    lidClosed = true;

  } else {

    lidClosed = false;

  }

  /*

    ---------------------------- 3-Axic Acelerometer ----------------------------

  */

  // Check to see if moving

  //    X-axis aceleration difference

  xPrev = xPos;

  xPos = analogRead(xMovePin);

  int xDiff = abs(xPrev - xPos);

  //    Y-axis aceleration difference

  yPrev = yPos;

  yPos = analogRead(yMovePin);

  int yDiff = abs(yPrev - yPos);

  //    Check which one is greater

  int greater = yDiff;

  if (xDiff > greater) {

    greater = xDiff;

  }

  // If moving then make moving true + update moved time

  if (greater > 10) { // Accel greater than 10 => moving

    prevTimeMove = millis();

    moving = true;

  }

  // If not moved after 5 min, then moving = false

  unsigned int sinceLast = millis() - prevTimeMove;

  if (sinceLast >= accelWaitTime) {

    moving = false;

    /*

      -------------------------------- LED & Buzzer --------------------------------

    */

    // FINISHED AND READY TO DUMP

    // Yellow LED: Check if not moving + closed

    if (lidClosed) {

      digitalWrite(greenLED, LOW);

      digitalWrite(redLED, LOW);

      digitalWrite(yellowLED, HIGH);

      // Sound on

      digitalWrite(buzzerPin, HIGH);

    }

  // If moved within 5 min

  } else {

    /*

      -------------------------------- LED & Buzzer --------------------------------

    */

    // STILL WASHING

    // Red LED: Check if moving + closed

    if (lidClosed) {

      digitalWrite(greenLED, LOW);

      digitalWrite(redLED, HIGH);

      digitalWrite(yellowLED, LOW);

      // Sound off

      digitalWrite(buzzerPin, LOW);

    }

  }

  /*

    -------------------------------- LED & Buzzer --------------------------------

  */

  // READY TO LOAD

  // Green LED: Check if not moving + open

  if (moving == false && lidClosed == false) {

    digitalWrite(greenLED, HIGH);

    digitalWrite(redLED, LOW);

    digitalWrite(yellowLED, LOW);

    // Sound off

    digitalWrite(buzzerPin, LOW);

  }

}