Go Down

Topic: Door opening or closing? (Read 253 times) previous topic - next topic


Hey all! Newby here with a question - apart from using 2 or more switches / sensors, how can I tell if a door is opening or closing?
I was thinking of 2 (or 3!) reed switches and assigning them numbers - say, '1' near the hinge and '2' nearer the edge.
If '1' is activated BEFORE '2', then the door is closing and if '2' before '1' the door is opening.
I was going to use this to activate a fan, in a bathroom.
Currently, I use a Danfos PIR, but that picks up movement through a wall, so the fan switches on when no-one is in the room.
Any help would be greatfully received.


One switch to operate when door open.

Your program can read the switch and work out what is happening.

When door is closed the contacts are closed. When the door is opening, the contacts open. Why do you need to know which direction the door is moving? You simply need to know if the action occurred rather than while it occurs.

When door opens then closes turn fan on (use a timer so it does not stay on forever).
If the fan has operated, and door opens and closes the person is leaving.

Use logic rather than hardware.



Can't you make the "field of view" of your PIR sensor smaller.
e.g. with a few pieces of black tape on the sides of the fresnel lens.


Dec 14, 2015, 03:27 pm Last Edit: Dec 14, 2015, 03:33 pm by outsider
You could use a small rotary encoder such as this:
Mounted on the door frame with the shaft in alignment with the hinge pin, make a lever out of stiff wire like coat hanger wire and attach loosely to door with a small plastic wire staple or such, then you could count pulses to determine if the door is open, closed and how much. And keep the door closed magnet switch for a reference point.


Thanks all, for your direction(s).

Go Up