In this paper, we present the design and implementation of a wireless sensor based piggybacking and tailgating detection system to detect unauthorized attempt to gain access to a secured area. A set of Sun SPOT wireless sensor platform is adopted for acceleration sensor, transmitter, and receiver units for the system. A wireless sensor embedded in a security door collects the signal of door movement constantly and transmits the signal wirelessly to another wireless sensor (base unit), which collects the transmitted signals
and stores them in the memory of the computer system for analysis. The acceleration signal is analyzed in both time and frequency domain to detect and classify single and tailgate entries. The paper focuses on the description of the wireless sensor network and the sensor-based tailgate detection algorithm.