Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to create a smart restroom indicator using simple hardware-No code, No cloud

By Ayush Jain April 29, 2026

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.

Figure 1. A restroom door with tinted black glass.

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

Figure 2. An IR sensor.

Figure 3. The NPN BC547.

Figure 4. PNP BC557.

Figure 5. A 5-V adaptor.

Figure 6. A red LED.

Figure 7. A green LED.

Figure 8. The hardware connection diagram.

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.

The NPN sensor is configured to activate a red LED, indicating the “Occupied” state when the latch is engaged.

Figure 9. An occupied restroom, indicated by the red signal.

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.

Figure 10. An unoccupied restroom, indicated by the green signal.

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.

Figure 11. Installation of the IR sensors.

Figure 12. The project flow chart.

Installed in minutes

The IR sensors are mounted just inside the door frame near the latch, with detection ranges adjusted to track the latch position precisely. Because they are optically triggered, there’s no mechanical contact and minimal wear over time.

The LED indicators are installed outside the door in a location that is easy to see while remaining unobtrusive.

Power is supplied by a compact 5V regulated source, either a battery pack or a wall adapter. Total current draw is minimal due to efficient LED and sensor selection. Wiring is routed within the frame to maintain a clean appearance, and the system can be installed or removed without permanent modification to the door.

Figure 13. A 5-V adapter, which power the whole system.

Figure 14. Operation of the “smart” restroom door.

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:


  • How to design a DIY “useless box” and learn the…

  • “How do I start and build an electronics project as…

  • How to design a weighing scale using ESP32

  • How to design a hidden touch-based smart lock using a…

  • How to best choose the hardware for cloud-based IoT projects


Filed Under: Electronic Projects
Tagged With: ESP32, Latch, sensors, tutorial
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

Log in to leave a comment:

Lost your password?

Don't have an account? Register here

Submit a Guest Post

submit a guest post

EE TECH TOOLBOX

“ee
Tech Toolbox: Wide Bandgap Semiconductors
Moving from silicon to GaN or SiC feels like a whole new ballgame, doesn’t it? It isn’t just about faster switching; it’s about managing the layout parasitics and thermal realities that come with that speed. This month’s Tech Toolbox features a curated eBook that tackles these design hurdles head-on.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions.

  • Soft-start re-arm for UC1842A
  • Incremental Delta-Sigma
  • Why does nobody talk about the actual cost of a single PCB layout mistake in production?
  • Simulator phantom DC level in Current sense transformer
  • Symmetrical tail inductor simulation in SonnetSuite

RSS Electro-Tech-Online.com Discussions

Featured Tutorials

Learn - AWS IoT Tutorials

  • How to enable device-to-device messaging on AWS IoT Core using MQTT
    How to enable device-to-device messaging on AWS IoT Core using MQTT
  • How to connect Raspberry Pi to Amazon AWS IoT Core using MQTT
    How to connect Raspberry Pi to Amazon AWS IoT Core using MQTT
  • How to connect ESP32 to AWS IoT Core using MQTT
    How to connect ESP32 to AWS IoT Core using MQTT
  • How to connect a computer to AWS IoT Core
    How to connect a computer to AWS IoT Core
  • Arduino compatible coding 02: Getting started with Arduino
    Arduino compatible coding 02: Getting started with Arduino
  • Arduino compatible coding 03: Basics of Arduino sketches and Embedded C
    Arduino compatible coding 03: Basics of Arduino sketches and Embedded C
More Tutorials >

Recent Articles

  • Nuvoton launches Cortex-M23 MCU for measurement
  • Synopsys launches 1.6T ESUN IP solution
  • Samtec introduces 35-pin bus connectors for UxV
  • Infineon launches UWB chip for secure access
  • Sensata launches dual-trigger HV protection device

EE ENGINEERING TRAINING DAYS

engineering
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe