Over the last few years, energy optimization in Wireless Sensor Networks (WSNs) has drawn the attention of both the research community and actual users.Sensor nodes are powered by attached batteries that are considered as a critical aspect of sensor nodes design.Besides, the constraint of the limited battery capacity is associated with the concern on how to reduce the energy consumption of nodes to extend the network lifetime. In this context, the purpose of this study is to implement an adaptive Medium Access Control (MAC) for energy saving and traffic control enhancement. This program was designed to arrange nodes into two priority groups according to their traffic rate and data transmission packet delay. This fuzzy algorithm depends on their queue length where it is implemented into the Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) algorithm.However, other types of nodes should send their data during the Contention Free Period (CFP) with a GTS reallocation scheme. Those nodes are classified as low priority access to the medium and their data transmission is scheduled using time division multiple access methods. Moreover, this proposed scheme dynamically adjusts the Contention Access Period (CAP) length to ensure that nodes can complete their data transmission during the same super-frame. Simulation results are done using the Network Simulator tool (NS-2) and it has improved efficiency regarding the IEEE-802.15.4 standard.