This paper focuses on the design of a power management algorithm that can improve the performance and service lifetime of small satellites. Along with a highly efficient power distribution scheme, the onboard power management system plays a vital role in the operations of a satellite. Small satellites are primarily powered by solar cells. The constraints on the size and mass of a nanosatellite limit its power generation and storage ability. The harnessed energy is stored in rechargeable batteries to ensure a constant supply of power during the eclipse phase. The algorithm enforces a fixed threshold on the battery DoD and switches the satellite to a low power state on exceeding it. The power generated is estimated every orbit since it changes due to the variation in relative positions of the sun and the earth over time. The satellite turns on its payload and transmission only above very specific locations on the Earth. This allows a deeper discharge when running loads like the payload or the communication and smaller discharge when performing other low power tasks so that the average discharge remains below the threshold. Several power modes have been defined keeping in mind the inter-dependencies between the different satellite subsystems for smooth operation. The switching of these modes depends on the task to be performed by the satellite. The results show a significant improvement in power performance over an implementation without an adaptive threshold. The paper also includes the power calculations involving the solar panels, the battery and the various loads.