I've been tasked in designing logic for dorm rooms. The design of the dorm is that that two rooms share the one bathroom (roomL-door-bathroom-door-roomR). I'm having trouble designing logic for it. Here are the requirements:
- If a person from roomL enters, person from roomR is forbidden to enter.
- A person can't move between rooms through the bathroom.
- (Desired but optional) If a bathroom is occupied by person from roomL no one from roomL can enter.
Each door will have electromagnetic lock (normally open in case of emergency) so I can lock the door through software. I was thinking this:
- Doors are normally unlocked. If a person opens the door from roomL, door from roomR will lock.
- He would have, lets say, 30 seconds to press the occupied push button (timer is there to prevent people from leaving the door open).
- After it's pressed both doors will be locked.
- When the button is pressed again it will unlock the door from which the person came (PLC will remember the last door open).
- When a person exits the room and closes the door it will unlock other room's door (again, 30 sec after pushing the button the doors will be unlocked).
Is this a good design?
UPDATE
So I've revamped the design and the logic that can be seen from the diagram bellow. I don't see any holes in this new design but a fresh pair of eyes couldn't hurt!
Best Answer
I think this procedure works better.
Both doors should stay closed so you need a door closer and alarm if it is stuck open. You should also have a motion sensor inside the bathroom. Handles on both sides of doors should actually be momentary switches.
Issues: