You know those black tubes on the road to count the traffic, those are actually quite easy to make.

You just need a differential pressure sensor (+- 8$) , a rubber tube, and some kind of micro controller, I used an Arduino.

A differential pressure sensor, measures the difference in pressure between the 2 inputs. If you hook up the tube to one of the inputs, and press the tube, the sensor detects the small shock wave in the tube.

With some filtering and calibrating of the output, you can get very good results. You can find the code I used on the github link

check the video for more info:

I used a radio module so I'm able to measure the traffic from a distance, but you could just build in a display to keep track of the count, store it on the Arduino, or keep it connected to a computer.

If you use 2 tubes and sensors, you can also make something to measure the speed. Put the 2 tubes on a known distance, and measure the time between the two detections.