You need to buy a microprocessor (I used an
Arduino) and you'll need some resistors, micro LEDs, fine wire and solder and with a drill and soldering iron. A breadboard recommended to get the circuit working before you solder it all together.
You can code a basic programme on the processor that will set the LED sequence. This you do on a computer and with the right USB cable you download the file to the mircoprocessor.
Here was what it looked like before it was put inside the LEGO.
Microprocessor stored away under the road but you could also make a service box on the footpath or place it in a nearby building with wires hidden (1x1 technic brick with hole useful for 'cabling' ducts).
Drill was used to drill a small hole in the stud on a 2x2 jumper plate which fixes the traffic light to the footpath and to make holes in 2 of the 3 1x1 bricks with stud on one side which house the LEDs.