IocTober Day 7 - Bathroom occupancy display
If you’ve worked in a small office with single restrooms, you know the frustration of going to the bathroom only to find it occupied. If you’ve attended a party in someone else’s home you’ve stood outside the bathroom door wondering “Is it occupied? Should I knock?!”. Cyclists looking for an unoccupied shower before work are also often frustrated.
My own office has two levels, and the bathroom is right at the back of the lower level, so it is impossible to tell if it is occupied until you have walked some distance.
What can we do? Frequent air travellers know to check the occupancy lights for the bathroom before walking the length of a plane to find the bathrooms full, so let’s adopt this idea for the home and office.
What will we need?
- A way to know if a cubicle is occupied or not
- A way to visually indicate occupancy
- A website for beyond-visual-range indication
- One Internet (here’s one we prepared earlier)
How can we measure occupancy? Well a camera or a motion sensor would work, but. That’s. Creepy. AF. Let’s sense the position of the latch.
If you have a typical rack-and-pinion bathroom latch you are in luck, as a non contact sensor or even a simple microswitch can be used to measure the position of the latch. If you are in an office which has standard door handles on its bathrooms, FIX THAT NOW. Nobody enjoys having the latch rattled or a door knock while they are doing their business.
Now we need a way to position sensor to read one-end or the other of our latch tongue. If possible, mount the sensor on the back of the door rather than the door frame, as it’s less likely to be damaged. This is easier if it’s battery powered.
We are going to use bluetooth devices on the door latch sensors as they run essentially forever on a coin cell.
The door sensors will talk to an ESP32 microcontroller positioned at outside the restroom, controlling an occupancy display. This controller also runs a web page. If you have multiple bathrooms, these display devices will all talk to each other, in order to each know the status of all available bathrooms.
Now you know if its futile to head to the bathroom when they are all occupied. How else can we help? How about having the webpage Notify you three minutes after the bathroom becomes free (nobody likes a warm seat).
What should our bathroom occupancy sign look like? I find that natural PLA plastic, with its translucent finish is ideal for illuminated displays. We are going to use a PLA cube, addressable RGB LEDs (aka NeoPixels) and a laser-cut silhouette to make a bathroom symbol.
I am over gender, so our bathrooms will be gender neutral. We’ll use an LED panel to light the silhouette.
Here’s our rough prototype to determine if an infrared sensor can measure the position of a bathroom latch. Ivan suggested inductive sensors, so we’ve ordered in some from ElectronicFansto try.