The Arduino code that you can use to build a scale model two road intersection with traffic lights and pedestrian crossing warning signs.
There are six traffic signals in the code. Two are for overhead signals and four are street level mounted.

You can use this code in different ways. If you wish to have only two traffic signals and a pedestrian crossing, load the entire code but hook up only those LEDs that you need.
Materials Required To Install These Traffic Signals
This project uses two daisy chained shift registers. Using them makes the code shorter, easier to change signal timing and ,because of the high current output capacity of shift registers, by powering the shift registers independently, you can use a large number of LEDS on any one pin.
The materials covered here are to make the circuit. They do not include the light fixtures. Those you can make or buy online.
You may use a Nano. You may, of course, use a Uno or Mega.
Prototype Board –
Pin Headers. –
Two shift registers –
Resistors – 560 to 1000 ohm are fine. To make traffic lights without over lane lights, you will need .
28 gauge wire – a short strip of telephone wire is fine.
Video Demonstration

This video shows you how the code works and what you can do with it.
The Arduino Sketch For Traffic Signals With Pedestrian Crossing Lights.
The code is in PasreBin at this link. You can review it and download it. When downloaded it will come to you in ASCII format so you can load it directly into your IDE.
Get The Components That You Need
It is best to get proven and tested parts. Additionally you save shipping costs and time by getting everything that you need at once. Go to Kits.
Wiring Instructions
The first step is to daisy chain your shift registers. Then it is a matter of connection them to resistor ladders.
Note that in this case we power the shift registers from an external 5 v power source. This takes advantage of the large amount of current that shift register pins can carry.
Shown here are connections to single LEDs. Actually each LED represents 4 to 8 LEDS. You can see that in the image below that shows an actual control board
Make Modules For Lights Of Each Purpose.
The image below shows the module for the pedestrian crossing lights. You can see a separation of the jumper wires in the center of the pin header. On section controls lights on the main traffic lane and the other on the crossing lane.
As you see, one led pin on the shift register controls 4 LEDs.
View Of The Modules
I make each group of traffic lights as a separate module and then fix them down on a piece of acrylic. I made provisions to add over traffic lane lights on the main road. All I have to do is plug in the LEDs.
Get The Components That You Need
It is best to get proven and tested parts. Additionally you save shipping costs and time by getting everything that you need at once. Go to Kits.
This tutorial is part of our series Arduino Projects. There is a video playlist at Playlist