In this project, we’ll build a “smart” restroom door system using PNP and NPN transistors, where simple switching logic replaces software. The design avoids apps and Wi-Fi and instead relies on solid engineering fundamentals.
The aim is to design a low-cost, fail-safe solution that detects occupancy, controls indicators, and automates utilities with minimal components. Let’s get started!
The lock
An effective restroom lock does more than secure the door. It also indicates whether the restroom is in use. Unfortunately, many restrooms rely on the classic push-to-close latch, which provides no feedback from the outside.
This may result in awkward encounters or privacy issues. Whether in an office, clinic, co-working space, or even at home, this remains a design flaw hiding in plain sight.
Additionally, some restroom doors use blacked-out or tinted glass, which may look sleek, but provides no practical indication of occupancy. In many cases, the latch type and handle design also leaves no room for mechanical indicators or electronic locks.
So, lets’ resolve the problem using minimal hardware, without modifying the door. We’ll also avoid using microcontrollers or network connectivity. Instead, this approach relies on IR sensors and careful placement.
Hacking the problem, not the door
Rather than over-engineering the solution with motion sensors and Wi-Fi modules, we’re taking a simpler approach. The goal is to clearly indicate when the door’s latch is physically closed, using it as the occupancy signal.
Our initial concept involved using a PIR or capacitive sensor with an ESP32 to wirelessly broadcast the door status to an external display. While this would work, it introduces unnecessary complexity for a binary condition (such as whether the door is latched, which is our main intent). It also increases cost and power consumption without adding meaningful value.
Instead, we use a hardware-based solution with a pair of IR proximity sensors, one NPN and one PNP, to monitor the latch position directly. These sensors drive a pair of indicator LEDs, with red indicating occupied and green indicating vacant.
The hardware
Two sensors, two LEDs, zero code
To implement a simple yet effective occupancy indication system, we must design a circuit using two infrared (IR) sensors, one NPN and one PNP, without the need for a microcontroller. The mechanism is integrated directly with the existing push-to-close latch inside the restroom.
Conversely, the PNP sensor will control a green LED, which illuminates when the latch is released, indicating the “Vacant” state. We’ll position the sensors to detect the physical position of the latch, ensuring reliable status indication based on its movement.
This hardware-only solution provides a low-cost, maintenance-free way to visually indicate restroom occupancy without modifying the door or requiring wireless communication or software.
Keeping it simple
This project shows that not every automation task requires a full IoT stack. In some cases, two well-placed sensors and a pair of LEDs are enough to solve a practical problem.
The system has limitations. It reflects only the state of the latch, not actual occupancy. If the latch is not engaged, it will indicate that the restroom is vacant, even if it’s occupied. Without a controller, it cannot log usage, send notifications, or integrate with building automation systems.
What it lacks in features is offset by reliability, simplicity, and ease of use. This approach works anywhere a push-to-close latch is used, making it a practical solution worth sharing.
You may also like:
Filed Under: Electronic Projects



















Log in to leave a comment:
Lost your password?
Don't have an account? Register here