The paper presents a two-hop based traffic aware congestion control algorithm (TTACCA) for wireless sensor networks (WSNs) aimed at alleviating congestion and improving quality of service metrics such as throughput, delay, and energy efficiency. The algorithm utilizes a hybrid potential field approach, combining depth and queue length information to dynamically route packets around congestion areas. Simulation results indicate that TTACCA effectively reduces energy consumption by 30% and improves throughput by 20% compared to existing methods, while also lowering the overall delay.