We built a ‘poopie’ sensor in our men’s toilet

Label A Lab stories - Part 2

Michèle Brüggemann
Label A

--

This story requires a back story. In our Amsterdam office we happen to have separated bathrooms. The women’s bathroom consists of two toilets, whereas the men’s bathroom consists of one toilet and one urinal. At the same time, there are twenty men in our office and five women.

Here’s the problem: the men’s toilet is pretty much always taken. So the guys that have to do their ‘business’ are often forced to walk to the bathroom several times to check if it’s vacant yet.

We jokingly said that we needed a sensor in the bathroom that could tell us whether it is taken or not. Until we realised we should just built this. This is when the poopie sensor was born 💩. And yes, this is in fact the official name for it 🤓.

A while ago we already built some LED-strips into our kitchen that we can remotely control. These lights are attached high enough on the wall so that they are visible from anywhere in the office. We saw the toilet problem as a great opportunity to give these lights a purpose other than just being pretty.

Using sound to detect a ‘pooper’

Without it being too invasive (no camera in the toilet👀) we need to be able to detect whether someone is at the toilet. In the end we used an Ultrasonic Distance Sensor for this.

‘Don’t worry! This is not a camera!’

Basically this sensor is equipped with a tiny speaker and a tiny microphone. The first transmits ultrasonic waves and the other receives them. How it works is: it sends out a high-frequency sound pulse and then times how long it takes for the echo of the sound to reflect back. It uses a mathematical equation (Distance = Time x Speed of Sound divided by 2) to calculate how close the sensor is to an object. And thus measures the distance 😃.

We attached the sensor next to the door and measured the distance from the sensor to the back wall (155 cm). If the sensor measures a distance that is shorter than 155 cm, it means something is between the sensor and the wall. Meaning: we have a pooper💩.

See the red end of our LED-strip? Someone’s pooping!

Through some lines of code we told the end of our LED-strip (which is connected to a Raspberry Pi running Raspbian) to turn red if someone is on the toilet. If it’s vacant, it turns back to green. In this way the men know when to stay seated and when they can finally do their business. Office hacks. Love ’em 💚.

--

--