PIR Sensor for Smart Bathrooms: Occupancy and Automation

Introduction

Smart bathrooms use sensors to automate lighting, ventilation, and even hygiene features. PIR sensors play a key role in detecting occupancy and triggering these functions.

Applications in Bathrooms

Occupancy Detection

Detect when someone enters the bathroom. Used for:

  • Turning on lights automatically.
  • Activating ventilation fans.
  • Displaying “occupied” sign outside.

Lighting Control

Lights turn on when motion detected, turn off after period of inactivity (with sufficient delay to avoid turning off while using toilet).

Ventilation Control

Fan turns on when occupancy detected and runs for set time after exit to remove odors and moisture.

Hygiene Monitoring

Detect if soap dispenser or towel dispenser is accessed; trigger alerts when supplies low.

Sensor Placement

  • Ceiling-mounted: Best coverage for entire room.
  • Wall-mounted near door: Detect entry/exit.
  • Inside shower stall: Waterproof sensor required.

Special Considerations for Bathrooms

Humidity and Steam

Bathrooms have high humidity and steam, which can:

  • Condense on lens, blocking IR.
  • Corrode electronics.

Use sensors with conformal coating or IP-rated enclosures. Consider heated lenses to prevent condensation.

False Triggers from Water Flow

Running water (shower, sink) can cause temperature changes that may trigger sensor. Proper placement away from direct water spray helps.

Privacy

PIR sensors are privacy-preserving – they don’t capture images, making them ideal for bathrooms.

Integration with Building Automation

PIR sensors can connect to building management systems via:

  • Wired digital inputs.
  • Wireless protocols (Zigbee, Z-Wave, Bluetooth).
  • KNX or BACnet systems.

Case Study: Hotel Smart Bathroom

A hotel chain installed PIR sensors in bathroom ceilings. When a guest entered, lights turned on and fan started. After 5 minutes of no motion, lights dimmed to night-light level. Energy savings: 40% compared to always-on lighting.

Code Example: Bathroom Automation with Arduino

int pirPin = 2;
int lightRelay = 3;
int fanRelay = 4;
unsigned long lastMotion = 0;
const unsigned long lightTimeout = 300000; // 5 minutes
const unsigned long fanTimeout = 600000;   // 10 minutes
bool occupied = false;

void loop() {
    if (digitalRead(pirPin) == HIGH) {
        lastMotion = millis();
        if (!occupied) {
            occupied = true;
            digitalWrite(lightRelay, HIGH);
            digitalWrite(fanRelay, HIGH);
        }
    }
    
    if (occupied && (millis() - lastMotion > lightTimeout)) {
        digitalWrite(lightRelay, LOW); // Lights off after timeout
    }
    
    if (occupied && (millis() - lastMotion > fanTimeout)) {
        digitalWrite(fanRelay, LOW);   // Fan off after longer timeout
        occupied = false;               // Reset occupancy
    }
}

Conclusion

PIR sensors make bathrooms smarter, more energy-efficient, and more hygienic. With proper environmental protection, they work reliably in this challenging environment.

Leave a Reply

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