Trying to make a circuit for a door sensor. The objective is send a RF signal when door opens, another one when door closes (in the simulation, all RF part is simulated as a 1k resistor and door open/close is simulated as a switch: door open = switch off, door close=switch on).
In order to save energy, RF module will be powered only immediately after door is open and until a few seconds after door closed (to allow RF module to send the pending messages).
The first try is following circuit:
(simulation is here)
Problems:
1) There are a delay between open door and RF power on (mosfet open). This is not acceptable, because it means a fast door open-close could be not registered by the system.
2) Mosfet is in cut when door is closed, this is ok, and in linear mode when door is open, it could be better in saturation.
Could someone suggest some changes to reach these objectives?
Thanks.