I'm building a better mousetrap.
I want to add two wires to a traditional mousetrap: one on the metal bar that snaps when the trap is triggered, and one on the trigger bar that holds the trap in "armed" position until a mouse touches the bait.
The idea being: as long as the trap is set, that circuit will be closed (the cross bar and trigger bar will be touching).
When the trap is tripped, the bar and the trigger bar will no longer be touching, so that will open the circuit.
So, all I have to do is write a Python script that monitors when the GPIO pins find an open circuit, and email me to let me know the trap has been tripped.
Here's the question:
Is this possible to do without adding any other electrical components? Do I need to wire up anything else into the circuit to make this work? From a programming side, I have this handled. From the electricity side, I need guidance.
UPDATE Seems I might be able to do this by treating the mousetrap like a button? https://www.raspberrypi.org/documentation/usage/gpio/python/README.md
Button would always be in a pressed state until the trap is tripped, then it would be released?