A Wireless Sensor Network (WSN) is a network of many nodes. These nodes are equipped with sensors which communicate wirelessly using techniques for radio frequency transmission. This network helps to measure and record the physical environment variables and to forward these results to a central location known as a sink. As WSN nodes are only supplied by a battery, the primary challenge is to reduce the energy consumption. The MAC layer is responsible for the establishment of a reliable and efficient communication link between WSN nodes and is responsible for energy waste. The newly proposed MAC protocol in this paper uses an improved variant of CSMA which implements weak signal detection (WSD). This technique enables dividing collisions from weak signals and takes appropriate decisions to reduce energy consumption. The CSMA/WSD protocol is presented as a flowchart and implemented in OMNeT++ by using the MiXiM framework structure. Implementation tests are performed to prove the validity of the implemented protocol in different scenarios. Different simulation scenarios show that this protocol offers a higher throughput, a smaller mean backoff time, and less average delay in critical environments.