The Wireless Sensor Networks are widely used to detect and exchange information and in recent years they have been increasingly involved in Intelligent Transportation System applications, especially in dynamic management of signalized intersections. In fact, the real-time knowledge of information concerning traffic light junctions represents a valid solution to congestion problems. In this paper, a wireless network architecture, based on IEEE 802.15.4 or Bluetooth, in order to monitor vehicular traffic flows near to traffic lights, is introduced. Moreover, an innovative algorithm is proposed in order to determine dynamically green times and phase sequence of traffic lights, based on measured values of traffic flows. Several simulations compare IEEE 802.15.4 and Bluetooth protocols in order to identify the more suitable communication protocol for ITS applications. Furthermore, in order to confirm the validity of the proposed algorithm for the dynamic management of traffic lights, some case studies have been considered and several simulations have been performed.