The present invention discloses a method for use in managing at least two sensor nodes within a wireless sensor network, whereby the method comprising the steps of scheduling the active and sleeping time for the sensor node based on the type of traffic at said sensor nodes, determining the traffic based on active period in a current active period, adjusting the next active period based on the current active period, and synchronizing the active state of all sensor nodes with a base station.