I have successfully designed a circuit that will give a positive pulse when a button is pressed and a negative pulse when a button is released. the duration of the pulse varies with the value of a capacitor. I designed this circuit to give a pulse to Arduino to send one text when door is opened and one text when door is closed. there is a software solution using flags to send one text but I prefer this circuit. I will upload so that it can be reviewed