Nowadays Wireless Sensor Networks (WSN) has been widely used because of its adaptability, mobility and scalability. The MAC protocol is one of the most important network protocols which guarantee the WSN communication efficiency. The major concern of this paper is the typical contention-based MAC protocol in WSN—the S-MAC protocol. Considering the backoff algorithm of S-MAC protocol cannot resolve the fairness problem for nodes communication, the BDQR (Backoff Depends on Queue and Retry) backoff algorithm was presented in this paper. The experimental results demonstrated that by using this algorithm, nodes communication fairness was improved, channel collisions were reduced while network lifespan was prolonged.