A wireless sensor network is vital in various fieldsand entails of a large number of sensor nodes. These nodesperform multiple functions, such as sensing, processing,communication, and power management. In such networks, alarge amount of data is generated and transmitted from sensornodes to the destination. During data transmission, congestionmay occur at the cluster head as well as during communicationbetween sensor nodes. This congestion mainly arises due toinefficient resource allocation and uneven traffic distribution. Themain reason for packet loss and the need for retransmission aredue to traffic imbalance and congestion. To avoid suchcircumstances an efficient flow control and congestion controllingschemes need to be adapted. To manage congestion control, alimited number of wireless sensor networks with differentprotocols are employed. The Deterministic Energy EfficientClustering (DEC) protocol, which relies entirely on residualenergy, is considered to minimize energy consumption. Thisprotocol, along with the leaky bucket algorithm, is used toregulate data flow at the cluster head and effectively controlcongestion in the network. This idea offers a solution to addresstraffic congestion and makes improvements to the situation in theevent that it arises. Simulation results show that the definedmethod can considerably advance increases in lifetime, energyand throughput.