Go Down

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

Ndy2uk

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.

weedpharma

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.

Weedpharma

Wawa

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.
Leo..

outsider

#3
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:
http://www.sparkfun.com/products/9117
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.
"A 5 year old child would know that! Will someone fetch a 5 year old child?":  Groucho Marx

Ndy2uk

Thanks all, for your direction(s).

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy