We propose a MAC protocol based on node residual energy and the number of channel conflict(EC-SMAC) according to WSN's characteristic that energy is constrained and competition window is fixed when backoff. The proposed protocol improves competition backoff mechanism of SMAC, it dynamically adjusts competition window according to node residual energy and the number of channel conflict, thus reducing conflict between transmission nodes and balancing network load and extending lifetime of network. Simulation results show that our proposed protocol extends 7% lifetime of network under the premise of ensuring network throughput and stable delay.