Traffic light wiring
How to control access with a traffic light
A traffic light is sometimes needed in a narrow passage, car park, garage, or loading bay. A typical setup is for the light to stay green by default, but switch to red as soon as another vehicle or a pedestrian is in the passage. Or, conversely, it stays red all the time and switches to green when movement is detected.
A traffic light is really just an LED lamp with coloured lights, which cannot do anything on its own. It simply lights up according to which wire you send power to. Here’s how to automate it using a relay and a pair of photocells.
What will we need?
- Photocells: one pair (or more pairs) of standard relay-output photocells (for example, NICE EPM, or other standard photocells from any manufacturer, with voltage-free switching when the beam is interrupted). Photocells are typically powered by 24V.
- Traffic light (Red / Green): It can have one or two aspects, and can be either a 24V or 230V version. This is entirely up to you; it depends on which power supply you choose and match the power source to. From our range, we recommend, for example, a single-aspect, dual-colour 24V traffic light, or its mains-voltage alternative, a single-aspect, dual-colour 230V traffic light.
- Intermediary (electromechanical relay): A standard interface relay for DIN-rail mounting with a changeover contact (SPDT). The relay coil must be rated for 24V (since it will be switched by the 24V photocells), but its contacts can easily switch either 24V or 230V for the traffic light itself. You can find this relay at any electrical supplies shop.
- Power supply: If you choose a 24V traffic light, one shared 24V power supply will be enough for both the light and the photocells. If you choose a 230V traffic light, connect the light to the 230V mains and use a small 24V adapter for the photocells and relay.
How does it work?
As an example, let’s consider a setup where the light is green by default and switches to red when movement is detected: the key is the changeover contact on our relay. This relay has one common terminal (COM) and two outputs:
- NC (Normally Closed – closed at rest): Connect the GREEN light here.
- NO (Normally Open – open at rest): Connect the RED light here.
While the photocell beam is clear, the relay is at rest and current (24V or 230V) flows to the green light. As soon as a car (or person, dog, etc.) interrupts the beam, the photocell sends a signal, the relay immediately activates with a click, and switches the power to the red light. When the car leaves, the system returns to green.
How to wire our example—green by default, switching to red when movement is detected:
- Step 1: Powering up the photocells and relay Connect the 24V power supply (+ and −) to both the transmitter (TX) and receiver (RX) photocells. Next, prepare the power supply for the traffic light itself (either 24V or 230V, depending on your light) and connect it to the relay’s common contact, usually marked COM.
- Step 2: Connecting the photocell to the relay Use the switching contacts in the receiver (RX) photocell. Wire them so that when the beam is interrupted, the photocell sends a small control current (24V) directly to the coil of the interface relay.
- Step 3: Connecting the GREEN light (Passage clear) Connect the negative terminal of the traffic light (the negative terminal for 24V, or neutral for 230V) directly to the power supply/mains. The wire for the green light is then connected to the relay terminal marked NC. This makes the traffic light stay green whenever the passage is clear and the beam is not interrupted.
- Step 4: Connecting the RED light (Passage occupied) The wire for the red light is connected to the relay terminal marked NO. When someone enters the beam, the relay switches the available voltage (24V or 230V) from NC to NO, and the light immediately changes from green to red.
In theory, the traffic light wires could be connected directly to the photocell contacts, since the photocell also contains a miniature relay. Although this would theoretically work with low-power 24V LED traffic lights, which draw little current, using an external interface relay is much safer. It protects the photocell electronics from current surges or a possible short circuit, for example if moisture gets into the traffic light.
Other detection options: microwave detectors and induction loops
Besides standard photocells, there are other ways to let the traffic light know that something is happening in the passage. The relay wiring principle stays the same; only the device that sends the signal changes:
- Microwave motion detectors: We offer detectors that can distinguish between a person and a car (a moving metal object). This lets you configure the system so the traffic light responds only to vehicles and ignores pedestrians, enabling a range of uses in industrial and private premises.
- Induction loops: The cable is buried directly in the ground and works like a large metal detector. The loop does not respond to people; it switches the relay only when a car (a metal object) is stopped or passing over it.
In summary, there are at least three ways to control a traffic light:
photocells
microwave detector
induction loop
How can you add a safety delay between colour changes?
If you need the light not to switch to green immediately after the passage is clear, but only after a few seconds, you can use a time-delay relay. Set exactly how long the selected traffic light colour should stay on before the system returns to its original state.
Two-way traffic in a single lane (a solution for two traffic lights)
For controlling a passage where vehicles travelling in both directions share the same lane (for example, at roadworks traffic lights, where one side waits while the other moves, with a short pause in between when both sides stop), you can use a standalone controller for two traffic lights.
This system ensures that while one side has a green light, the other has a red light. The controller also automatically enforces a safety interval when both sides have a red light, giving the last cars (and racers :)) time to pass safely before traffic starts moving in the opposite direction. You do not need an external relay for this setup. We offer two versions of the controller, depending on the power supply:
- Controller for 2 traffic lights (24V power supply, IP65)
- Controller for 2 traffic lights (230V power supply, IP65)
As mentioned at the beginning, a traffic light is essentially just a lamp and behaves according to the device sending it signals. In theory, you can devise any scenario and use relays and timers to achieve what you need.
Photocells are usually enough, as they are the most cost-effective option. Their downside, however, is that the relay is triggered whenever the infrared beam is interrupted, so it cannot tell whether a car or an animal passed through the beam, or whether children are playing there.
An induction loop can distinguish this (it detects metal objects), but its major drawback is that it is buried in the ground, so it needs to be planned during construction. Installing one later in a spot with beautiful new concrete is fairly expensive.
A microwave detector has the best technical capabilities: it can distinguish cars from people and detect the direction of movement. It is the most expensive of all the options, but there is no need to run cables underground, and it is the easiest solution to install in an existing building or site. You can also precisely set the detection perimeter.