Wireless devices are mainly used in mobile systems because they do not need any physical connection for the communication and the energy supply. Therefore, reducing the power consumption of their batteries is a critical task in order to prolong their lifetime. The main aim of this paper is to dynamically adjust both the sleeping time and the transmission power of mobile devices in an IEEE 802.11 wireless network in order to reduce the power consumption. The algorithm runs on the access point that provides the wireless connection to the devices, so no extra circuitry or computation is required to the devices. The proposal is validated through simulations, which show a battery life 20% higher than other state-of-the-art approaches.