The real-time knowledge of information concerning traffic light junctions represents a valid solution to congestion problems with the main aim to reduce, as much as possible, accidents. The Red Light Running (RLR) is a behavioural phenomenon that occurs when the driver must to choose to cross (or not) the road when the traffic light changes from green to yellow. Most of the time the drivers cross even during transitions from yellow to red and, as a consequence, the possibility of accidents increases. This often occurs because the drivers wait too much in the traffic light queue as a consequence of the fact that the traffic light is not well balanced. In this paper we propose a technique that, based on information gathered through a wireless sensor network, dynamically processes green times in a traffic light of an isolated intersection. The main aim is to optimise the waiting time in the queue and, as a consequence, reduce the RLR phenomenon occurrence.