If you’ve ever seen black, rectangular, or round patterns in the asphalt near traffic lights, you were looking at the answer to this question. In that shape lies a coil of wire. As electricity passes through the wire, it creates a magnetic field. When a car stops over the top of the wire, the metal in the car changes the magnetc field. A small microprocessor, located in the traffic signal cabinet, detects this change and sends a signal to the traffic light that a car is waiting there.
Sometimes cyclists find themselves stranded at a light when their bicycles don’t trigger the sensor to change a light. This happens because their bikes don’t contain enough metal to change the magnetic field to the point where it can be detected by the microprocessor. In some intersections, sensors sensitive enough to detect bicycles have been installed.