I'm thinking of hacking up something simple to check toilet occupancy in an office. Ideally, the system should be unobtrusive and out of the way.

I know you can use a PIR sensor to track moving objects (What sensor to choose to track human presence indoors?) - however, if somebody is sitting still on a cubicle, that will probably not register since they're stationary.

Apparently parking spot sensors use both IR and magnetic fields to detect cars (http://www.nedap.com/business-units/identification-systems/parking-detection-makes-sense/). Obviously the second part of that won't work on people.

I know you can get those IR-based sensors that bounce a beam off a reflector, however, I'm hoping to be able to mount just one sensor on the ceiling, if possible.

Is there another type of IR or ultra-sound sensors that might work here?

Has anybody got any particular parts or approaches they could suggest? Any caveats I should be aware of for this use case?

  • \$\begingroup\$ You could install a cheap wireless webcam and do the image processing on a PC ;-) \$\endgroup\$ – PeterJ Jul 8 '14 at 5:49
  • \$\begingroup\$ Japanese shower toilet seats solve this problem in at least two different ways, depending on make and model: IR sensors, and mechanical switches. \$\endgroup\$ – Kaz Jul 8 '14 at 5:51
  • 1
    \$\begingroup\$ Trivia. In the US (at least on the West Coast), this is addressed through culture. When a person leaves the loo, he/she has to leave the door partially open. That signals that it’s vacant. If the door is shut, that signals the loo is occupied, and the newcomer has to wait or try his luck elsewhere. The tradition in other parts of the world is to keep the door closed at all times. So, people who grew up outside US can cause loo jams at work by setting the signal wrong. \$\endgroup\$ – Nick Alexeev Jul 8 '14 at 5:57
  • 1
    \$\begingroup\$ There are some door locks which show "Occupied" and "Vacant"... You can use that! If you want an "Electronic Solution", You can use a sensor which will register opening of door. When door opens for the first time, Store status as "Occupied". On next door opening, Make the status as "Vacant". Door will be opened twice for every use - First to enter and 2nd time to leave. \$\endgroup\$ – Swanand Jul 8 '14 at 6:26
  • \$\begingroup\$ Place a lever switch that will be actuated by the locking mechanism in the door. \$\endgroup\$ – Gunnish Jul 8 '14 at 10:18

The automatic flush systems used at airports, movie theaters, and restaurants all use active IR technology, not PIR. Active IR uses an IR transmitter and an IR receiver. There is one sensor per toilet.

enter image description here

They are located behind the toilet seat (or on the top of a urinal) and bathe the immediate area with IR light. When a person enters this field, the IR bounces back to the IR receiver and after a few seconds "arms" the unit. When the person leaves, after a couple of seconds the control unit flushes the toilet or urinal.

Commercial units cost hundreds of dollars, but at least at one time you could pick up a complete unit for a home toilet here, supposedly for $24 (I realize you don't need the flusher part, just the sensor).

There are quite a few videos on this subject on YouTube (search for "automatic toilet flush"), including ones centered around the ubiquitous Arduino.


While I don't see anything wrong with Tcrosley's answer, another solution could be to use a Infrared Body Heat Sensor as talked about here. Having it positioned on the wall facing the person would probably be the easiest so you do not capture radiated heat from a toilet seat when someone gets up.

With this solution you would not need to worry about if the object is moving or not which would be the benefit over using a PIR.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.