So I’ve used a Sparkcore to build a bathroom status detector at our office. We have 15 employees and one bathroom, so folks have gotten pretty dependent on being able to see if the bathroom is free by checking a webpage (http://staffingrobot.com/bathroom) rather than having to get up only to find it’s occupied.
The way I’ve rigged it is to just have a wire that goes from the 3.3v pin to D0 and the latch on the bathroom door closes the connection. It’s not a proper switch, just two pieces of metal coming together. I have a resistor that goes from D0 to ground to prevent floating voltage on the pin. My problem is that once a month the thing stops working and I have to switch to a different pin because whichever one it was in stops working.
Because of the wiring to the latch, I think maybe I’m getting a spark when the latch closes that drives the voltage to something higher than the safe voltage for the pin.
Anyone have any other thoughts and is there something I can put in the circuit that will prevent this?