induction loops are the primary - most reliable method: the coils (usually just several loops of wire) embedded in the road; fed given frequency from a generator, in presence of metal the frequency of the LC circuit changes and the sensor circuitry detects the change of frequency, producing a presence signal. In some cases these may fail to detect bicycles, but they are by far most common as they aren’t affected by weather (or more precisely, the detection circuit tunes in to slow changes of frequency caused by weather) and are immune to accidental false positives. Note the loops can be localized (~2m size) or cover a lengthy part of a lane.
we could use radar for detecting pedestrians .
We should try to use multiple sensors for accuracy.but keeping cost in mind we may need to fabricate our own