This paper focuses on the average consensus problem for the wireless sensor networks (WSNs) with fixed and Markovian switching, undirected and connected network topologies in the noise environment. Event-based protocol is applied to each sensor node to reach the consensus. An event triggering strategy is designed based on a Lyapunov function. Under the event trigger condition, some sufficient conditions for average consensus in mean square are obtained. Finally, some numerical simulations are given to illustrate the effectiveness of the results derived in this paper.