occ-loo-piedDec 2024 - Feb 2025

Problem

My apartment roommate (For anonymity purposes lets call him "Max") and I share a bathroom in our apartment. However, Max's room and the bathroom are on opposite sides of the apartment. On top of that, he doesn't have a direct line of sight from his room to the bathroom, so he can't just peek his head out the door to see if its in use.

Solution

I built a physical button that lives next to our bathroom entrance. When someone enters the bathroom, they tap the button to signal that the bathroom is occupied. After doing their thing, they tap the button again on their way out to signal that the bathroom is free again.

I set up a locally-hosted notification server so that when the button is pressed, a push notification is sent to our phones to notify us that the bathroom's occupancy has changed. I'm also hosting a website where you can check the bathroom's current status.

The website also has some extra features:

  • There's an admin page, which lets me delete entries for accidental button presses, or clear just the end time for when someone forgets to press the button a second time.
  • The stats page contains some cool visualizations of our bathroom data. The main attraction is a heat chart (similar to GitHub's commit chart) of the number of bathroom usages per day. We can also see the longest bathroom session, as well as the average bathroom session. I have so many more ideas for ways we can analyze this data.

The build

The button is a simple circuit that I soldered together. It consists of three parts:

  • Wemos D1 Mini microcontroller
  • LED ring
  • TTP223 (capacitive touch sensor)

When you touch the touch sensor, it sends a signal to the microcontroller, which then:

  1. Sends a request to my occ-loo-pied server to toggle to bathroom's occupancy status.
  2. Tells the LED ring to change color to match the occupation status.

Here are some progress photos while I was working on the button:

Testing on a breadboard!All soldered together!
testing the button on a breadboardin progress photo of occ-loo-pied button
tags:
c++
golang
svelte