This paper presents a dynamic traffic signal system that adjusts signal timing based on traffic density using IoT technology to alleviate congestion and prioritize emergency vehicles. The system employs lidar sensors and a Wi-Fi module in emergency vehicles to ensure quicker clearance when needed. By optimizing traffic flow and reducing delays, the proposed solution aims to enhance urban traffic management significantly.