Wireless sensor networks are being considered for application within buildings to control various equipment in different working environments. As wireless sensors are powered by commercially available batteries, battery performance will directly affect the entire network performance. Battery performance is affected by ambient temperature as temperature can modify the microstructure of the batteries. Thus the lifetime of the battery can change depending upon ambient conditions. It is hard to find any published data that quantitatively analyze the battery lifetime for a sensor node operating under different ambient temperature settings. In this paper, we deploy wireless sensors subject to variations of ambient temperature, study the temperature effects on battery lifetime, and investigate how the variations of ambient temperature influence data delivery performance in a low power communication network. Our work consists of commercially available sensor nodes conforming to the IEEE 802.15.4 protocol, commercial alkaline batteries, and a suite of techniques for measuring battery lifetime under different working temperatures. In view of these experimental results, we quantitatively show that temperature not only affects battery lifetime, but directly affects the communication quality between sensor nodes. We expect our results to serve as a basis for future research in designing better wireless sensor networks for building applications.