Toilettes door wireless indicators

Hi there!

Bit of a project description here, see what you guys think.

The problem we have now in the office is that the toilettes are behind a door and people walk to them only to find them busy. We've thought we could connect sensors to the doors and turn some lights on/off on the studio side of the main door, similar to how plane / train toilettes work.

The doors are in a small-ish space, say 3.5x2 meters.

My idea is adding wireless door sensors to them (433mhz, i guess), then have one single Arduino within range to receive the notifications and get the Arduino to control 3 individual lights that indicate whether each toilette is busy or not.

Ideally, I'd like to avoid wiring the door sensors to the Arduino, but then I'm not sure how can I tell which door sensor is sending the notification? Is there a way where I can easily tell which of the sensors is it?

Comments and ideas more than welcome!

Cheers,

Juan

You're going to need to power the door sensors, so IMO the most obvious solution would be to just put a wired switch on the door to each cubicle. I suppose you will have some scheme to ensure the doors are only closed when the cubicles are in use. If you only want to turn the indicator on when any door is open then you could do that by using normally closed switches (which open when the door is closed, if you see what I mean) and wire them all in parallel. This will complete the circuit when any door is open, and you can use that to operate a relay to illuminate the indicator. (I assume you don't want the full load going through all your door switches.)

Given that this is going to be installed in a wet room, I'd be inclined to use a low voltage for the sensors and have that switching the mains voltage relay for the indicator. You'd just need a transformer/rectifier to bring the AC down to a safe low voltage level, a relay and a few switches plus whatever indicator you have in mind - no electronics required.

To differentiate between doors, you could use an encoder on the transmitter side that offers a unique signature. Then have them broadcast their status ocassionally while just listening on the 433MHz reciever for any incoming signal. Then decode it into the proper door indicator. An encoder that would work well is a PT2262 which is designed for those simple remote switches, but there are other options.

Thanks both for chiming in. Few comments:

@PeteH

"You're going to need to power the door sensors"

Can you elaborate on that? I'm assuming that the battery powered 433 wifi door sensors I've been looking at would have a lifetime of months, but maybe you are right, that's just not good enough.

"no electronics required"

There are a few reasons to involve Arduinos / electronics:

a) we want to be able to display anywhere in the office the state of the toilettes. By anywhere I mean things like an indicator in your computer, a mobile app, etc. Say for example you are in floor 1 and toilettes are busy, you probably want to know whether to toilettes are available one floor above without having to walk all the way there (we have 3 floors).

b) we want data. This is part of a bigger project for which we would be collecting data of how we use the office. Things like temperature, how many times the beer fridge is opened, how many times the toilettes are used and for how long... anonymous data, by the way : ) anyway, we plan to collect a bunch of data and then study it to see if patters emerge, or simply display it.

@Retroplayer

"To differentiate between doors, you could use an encoder on the transmitter side that offers a unique signature"

Is this something you can easily do on cheap sensors? Wouldn't know how to start hacking a door sensor, tbh. Any links appreciated.

Thanks!

Juan

Well, there are two ways (well, honestly, there are several ways.) Either connect your door sensors output to an Arduino and have it become the encoder:
For this option, if they are all routed to one Arduino, you would just send a byte where each bit was a flag of door status (0 = closed, 1 = open) and have it transmit at some interval to update. Having a "signature" byte precede this would help filter out noise and interference. On the receiver side of things, you would read in the bytes and convert them into indicators showing the status of each door.

Or buy an encoder IC and hardwire them with a different 'device' address for each door: Same basic concept, but you would also need a timer of sorts which would transmit at certain intervals. When a custom circuit is all said and done, though, it probably wouldn't be all that cheaper than using an arduino. And the Arduino would give you more control for tweaking it as well as doing zigbee, wifi, or whatever radio method you devise.

If you want the status to be accessible on a computer, you are probably better off using wifi and have a little server running on the arduino. And have an application on the computers that checks the server for status.

In all cases, if the doors are in a central location, you would just need one transmitter and wire all of the door sensors up to it. The transmitter would not need to be inside the bathrooms themselves. Best orientation would be to have the controller on the other side of the wall facing the office area so it has one less wall to transmit through and that would also allow you to have a indicators hard-wired to it at that point as well for people walking around to see the status before leaving the office area.

The bonus here is that this type of thing, at least with wifi, is a fairly common project for the arduino. I don't have any links to offer at the moment, but I have seen many projects where people have used the arduino to create a server showing the status of switches connected to it.

@Retroplayer

Ummm, when I was talking about a wiring the sensors to the Arduino I didn't want to have an Arudino per door, more like 3 sensors connected to a single Arduino.

But I've looked at the doors and sadly the sensors would need to go on the INSIDE of the door. That pushes me towards wireless sensors talking to a single Arduino (since I rather not have to drill the walls), but that brings me to the problem of working out which sensor is sending the signal.

You mention an encoder IC, which I'm guessing it allows adding some kind ID / device address specific to each sensor. How standard is that? Can that be easily done on any sensor? I was thinking of buying something like this:

http://www.dhgate.com/window-sensor315mhz-433mhz-door-sensor-wireless/p-ff80808131ae161e0131c7a739971606.html

But I'm completely lost about modifying the code that runs in off-the-shelf sensors, to be honest. Happy to try with some guidance though!

Cheers,

J

Well, you are in luck. It looks like these use exactly the encoder that I was recommending (PT-2262).

You do not need to modify anything in the sensors. There is no code in them.

What you need is an Arduino running the RC-Switch library with a 315 or 433MHz receiver module attached to it. Those door sensors have a jumper selecting the device address, so you would set each one as unique.

Using the Arduino and RCSwitch library, you create a base station that listens for the sensors and updates the status when something changes.

For reference look for and read the datasheet for the PT2262 and search the forum about the RC-Switch library.

What you do with the received singals after they reach the Arduino is entirely up to you and how complicated you want to make it.

You only need these door sensors, not the base station. Your Arduino becomes the base station.

HIGH FIVE

Thanks a lot, I'll have a good read around and probably come back with more lame questions in a while.

Cheers,

Juan

Any news here? I bought such Wireless Switch, but these things send only, when the magnet moves away from the device. Not when it gets back.
How did you solve this?

Hi there,

We finally went for wired magnet sensors. Much, much simpler to connect to the Arduino and you also forget about the battery problem.

Luckily for us we have an extraordinarily skilled handy man that IMO did an outstanding work fitting the sensors "within" the doors.

We've just installed the alpha version, but once we have the whole thing neatly set up I'll post some pics.

Juan