PIR Sensor for Laundry Room Reminder

Project Overview

This project creates a smart laundry reminder system that detects when you enter the laundry room and reminds you if there is a load waiting to be transferred from washer to dryer or from dryer to basket. It is perfect for busy households where laundry often gets forgotten.

Difficulty: Intermediate
Estimated time: 2-3 hours
Estimated cost: $25-35

How It Works

A PIR sensor detects when someone enters the laundry room. The system checks the state of the washer and dryer (using vibration sensors) and knows if there is a completed load waiting. If laundry needs attention, it plays a voice reminder through a speaker.

Materials Needed

  • ESP32 (1)
  • HC-SR501 PIR sensor (1)
  • SW-420 vibration sensors for washer and dryer (2)
  • DFPlayer Mini MP3 module (1)
  • MicroSD card with voice reminders
  • Small speaker (3W)
  • OLED display (128×64, I2C) optional
  • LEDs for status indication
  • 220Ω resistors
  • Jumper wires
  • Power supply (5V 2A)

Circuit Diagram

Connection Table

OUT

GPIO 4

OUT

GPIO 5

OUT

GPIO 6

GPIO 16

GPIO 17

GPIO 21

GPIO 22

Anode

GPIO 2

Anode

GPIO 15

Arduino Code

// Laundry Room Reminder System
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

SoftwareSerial mySoftwareSerial(16, 17);
DFRobotDFPlayerMini myDFPlayer;

const int pirPin = 4;
const int washerSensorPin = 5;
const int dryerSensorPin = 6;
const int redLedPin = 2;
const int greenLedPin = 15;

bool washerRunning = false;
bool dryerRunning = false;
bool washerDone = false;
bool dryerDone = false;
unsigned long washerStopTime = 0;
unsigned long dryerStopTime = 0;
unsigned long lastReminderTime = 0;
const unsigned long reminderCooldown = 1800000;

void setup() {
  Serial.begin(115200);
  
  pinMode(pirPin, INPUT);
  pinMode(washerSensorPin, INPUT);
  pinMode(dryerSensorPin, INPUT);
  pinMode(redLedPin, OUTPUT);
  pinMode(greenLedPin, OUTPUT);
  
  digitalWrite(redLedPin, LOW);
  digitalWrite(greenLedPin, LOW);
  
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  
  mySoftwareSerial.begin(9600);
  myDFPlayer.begin(mySoftwareSerial);
  myDFPlayer.volume(25);
  
  displayMessage("Laundry Monitor", "Ready");
  delay(30000);
}

void displayMessage(String line1, String line2) {
  display.clearDisplay();
  display.setCursor(0, 0);
  display.println(line1);
  display.setCursor(0, 20);
  display.println(line2);
  display.display();
}

void checkVibrationSensors() {
  bool washerVibration = digitalRead(washerSensorPin) == HIGH;
  if (washerVibration && !washerRunning) {
    washerRunning = true;
    washerDone = false;
  }
  if (!washerVibration && washerRunning) {
    washerRunning = false;
    washerStopTime = millis();
    washerDone = true;
    digitalWrite(redLedPin, HIGH);
  }
  
  bool dryerVibration = digitalRead(dryerSensorPin) == HIGH;
  if (dryerVibration && !dryerRunning) {
    dryerRunning = true;
    dryerDone = false;
  }
  if (!dryerVibration && dryerRunning) {
    dryerRunning = false;
    dryerStopTime = millis();
    dryerDone = true;
    digitalWrite(greenLedPin, HIGH);
  }
  
  if (washerDone && (millis() - washerStopTime > 3600000)) {
    washerDone = false;
    digitalWrite(redLedPin, LOW);
  }
  if (dryerDone && (millis() - dryerStopTime > 3600000)) {
    dryerDone = false;
    digitalWrite(greenLedPin, LOW);
  }
}

void playReminder() {
  if (washerDone && dryerDone) {
    myDFPlayer.play(1);
    displayMessage("Reminder", "Both loads done");
  } else if (washerDone) {
    myDFPlayer.play(2);
    displayMessage("Reminder", "Move washer load");
  } else if (dryerDone) {
    myDFPlayer.play(3);
    displayMessage("Reminder", "Take out clothes");
  }
}

void loop() {
  checkVibrationSensors();
  
  bool motion = digitalRead(pirPin) == HIGH;
  
  if (motion && (washerDone || dryerDone) && (millis() - lastReminderTime > reminderCooldown)) {
    lastReminderTime = millis();
    playReminder();
  }
  
  if (!motion) {
    String status1 = "Washer: ";
    status1 += washerRunning ? "Running" : (washerDone ? "DONE!" : "Idle");
    String status2 = "Dryer: ";
    status2 += dryerRunning ? "Running" : (dryerDone ? "DONE!" : "Idle");
    displayMessage(status1, status2);
  }
  
  delay(100);
}

Installation Steps

  1. Mount vibration sensors on washer and dryer using magnets
  2. Position PIR sensor at doorway of laundry room at 2m height
  3. Mount speaker where reminder can be heard clearly
  4. Assemble electronics in enclosure
  5. Run washer and dryer cycles to test detection
  6. Adjust vibration sensor sensitivity if needed

Project Extensions

  • Add Wi-Fi notifications to phone
  • Add Google Home integration for voice announcements
  • Add LED strip to show status at a glance
  • Log laundry cycles to track usage
  • Add remote monitoring via web interface

Conclusion

This laundry reminder system eliminates forgotten loads and makes laundry day more efficient with voice reminders.

Leave a Reply

Your email address will not be published. Required fields are marked *

Component Pin ESP32 Pin
PIR Sensor Washer Vibration Dryer Vibration DFPlayer Mini TX DFPlayer Mini RX OLED SDA OLED SCL Red LED (Washer) Green LED (Dryer)