Traffic congestion has become a big problem for most people because it increases noise, air pollution, and wasting time. Current normal traffic light system is not enough to manage the traffic problematic congestions because they operate on a fixed-time length plan. In recent years, internet of things led to introducing new models of intelligent traffic light systems; by utilizing different techniques such as predictive-based model, radiofrequency identification, and ultrasonic-based model. The most essential one of these techniques is depends of image processing and microcontroller communications. In this paper, we propose an intelligent, low cost, and efficient microcontroller circuit-based system for controlling cars in traffic light. This system can manage car traffics smarter than traditional approaches, it is capable to dynamically adjust timings of traffic signal. It can rapidly respond to traffic conditions to reduce traffic congestion. For implementing this system, a server, microcontroller board, cameras, as hardware and wireless network between traffic lights as infrastructure for communication are used. The system uses machine learning technique (i.e.,Yolov3 model and OpenCV) for decision depending on existence of emergency cars and number of cars. The experiment results show higher accuracy in managing traffic lights and recognizing the emergency cars.