I used a traffic loop detector as part of an industrial control system once (it was one of many things to determine whether the big object underneath the chute was in fact a truck). The controller’s sensitivity was adjustable. At its most sensitive, it could pick up the metal in my steel toed boots. If you really want to detect a bicycle, it can do it. For traffic applications, the sensitivity is intentionally turned down so that a motorcycle will trip it but a bicycle won’t. If the motorcycle didn’t trip it, then it was adjusted wrong.
There are also pressure plate type sensors mounted in the road. You don’t see these around too much any more but they used to be fairly common. They’re pretty obvious when you see one, since it has a strip of steel about a foot wide going across the road.
The inductive loop will pick up a car over a wider area. The pressure plate relies on a car approaching the light to run over it. You don’t have to stop exactly on it. Same with the inductive loop, as long as you pass over the loop the traffic controller knows you are there.
Another type is microwave transmitters, which work like radar. They are mounted up by the light and periodically send a radio wave down towards the road. If it gets an echo, it triggers the light. I’m not sure how often these are used. I haven’t seen any in my area. You get basically the same thing when you go into the grocery store. The automatic door opener (the little black box above the door) works on the same principle.
Older traffic light controllers were very simple devices. The timer was just a motorized wheel which spun around and closed different switch contacts. Modern controllers are little mini computers which are programmable. They can be programmed to change how they switch the lights at different times of day. They are usually programmed to periodically cycle the lights even if no one comes by, just in case a motorcycle does stop in front of the light and doesn’t manage to trigger the switch. They shouldn’t get stuck there forever. Sometimes the controllers can all talk to each other in sort of a network topology. This allows multiple lights to be synchronized, which is important if you are trying to control the flow of traffic in a busy downtown area, for example.
There used to be a hill in Pittsburgh which had a radar speed detector attached to the controllers. Late at night, if you went down the road under the speed limit, you’d get green lights all the way down. If you went over the speed limit, you’d hit red lights all the way down. I don’t know if it still operates that way or not.