Statistics show that over 80% of burglars enter through doors or windows. This door and window sensor not only detects if they are opened but also perceives knocking through vibration, notifying users before break-ins. Users can switch off the security temporarily through the bypass button so that they can quickly exit the house. The multi-stage base suits various height differences between doors and frames. Compared with general door and window sensors, it provides the solution of rapid entry and exit scenarios and solves the problem of high and low drop in the installation field.