This was developed to tackle the typical parking problem at a University. We wanted a way to (cheaply) count the cars that enter and exit the parking lot. In our case, we have 1 main parking lot, however, our situation was complicated by the fact that there are 3 entrances and 3 exits. The challenge was to develop a device which could sense a car's extry or exit and report it to a centralized server. All other sensors would do the same. The server would then keep a tally and would report back how many cars it thought were in the lot at any given time.
The RPi and HAT are contained in a box. The box can be of any convenient size. A 1mm ID (1/16" may work well too; but 1.5mm is too loose) tube is extended from the sensor to the chassis where a 1mm-to-1/4 inch adapter is mounted (a 1/16"-to-1/4" may be acceptable as well). 1/4" Santoprene tubing is then extended from the chassis and across the road (as perpendicular as possible). The far end of the tube is tied off.
Software must be developed to interpret the air pulses that vehicles generate as the cross the tube. With dual tubes laid out at a known distance apart, measurements of vehicle speed and vehicle type (distance between axles) can be made. These algorithms are well-known and can be optimized based on the expected speeds of the road (or parking lot entrance/exit).
We are using the Honeywell HSC series with SPI digital output.
Other Parts Needed: