Knowledge of the battery lifetime of the wireless sensor network is important for many situations, such as in evaluation of the location of nodes or the estimation of the connectivity, along time, between devices. However, experimental evaluation is a very time-consuming task. It depends on many factors, such as the use of the radio transceiver or the distance between nodes. Simulations reduce considerably this time. They allow the evaluation of the network behavior before its deployment. This article presents a simulation tool which helps developers to obtain information about battery state. This simulator extends the well-known TOSSIM simulator. Therefore it is possible to evaluate TinyOS applications using an accurate model of the battery consumption and its relation to the radio power transmission. Although an specific indoor scenario is used in testing of simulation, the simulator is not limited to this environment. It is possible to work in outdoor scenarios too. Experimental results validate the proposed model.