In this paper we consider the problem of binary hypothesis detection in wireless sensor networks under power constraint. The objective is to solve the resource allocation problem for this distributed detection problem and find a suitable operating point for the network. We consider the Neyman-Pearson (NP) criteria and design suitable transmission schemes and a fusion center (FC) detector, so that subject to transmission power constraints, detection probability is optimized. It is shown that the corresponding optimization problem is convex, optimality conditions are derived, and solutions for transmit powers as well as overall detector are obtained. Numerical simulations verify our results.