Abstract—Recently, researchers and engineers began considering the use of WSN in time-sensitive applications. For effective real-time communications, it is important to solve the problem of contention to the communication medium providing an efficient bandwidth allocation mechanism. In this paper we tackle with the problem of performing timely detection of events by a WSN. We propose a realtime bandwidth allocation mechanism for IEEE 802.15.4 that maximizes event detection efficiency and reduces statistical uncertainty under network overload conditions. On-line strategies complement off-line guarantees to enhance the confidence level of the measurements.