How to detect whether a bathroom stall is closed

arduinosensor

I've got a bathroom stall with a sliding bolt and would like to detect when the door is closed and locked. I'll receive the state of the door with an Arduino Uno

Not sure what's the best way to go about this, would I use a hall effect sensor?

Best Answer

I'm thinking photointerrupter triggered by the bolt as it crosses into the strike, just at the strike opening so a half-locked bolt still registers as "locked".