Using limit switches to alert us if the windows and doors are open and PIR sensor to sense motion and give signals to PIC16F877A which on lamps if the door or windows are open or start security alert if there is motion.