Measuring Speed of Cars with Pressure Sensor.

I have an idea of a project where I use one pressure sensor to measure the speed of cars. My questions concern the pressure sensor, translating the math into Ardunio code, and ideas for possible protective coating for the electronics for a stint of at least 12 hours. For pressure sensor I need it to withstand a considerable amount of weight, for instance an average car at 3500-4000 pounds and a semi truck weighing 4-5 tons. Furthermore, I don't plan on having a lot of heavy trucks run over my sensors, I just want them suitable if and when they do. And with regards to to the code ... how would I go about telling the difference between automobiles with four tires and those with more than four?

For starters, you would have to know a lot about the road on which you are measuring traffic. Easiest would be a one-way road, one lane wide. Add another lane, or two-way traffic, or both, and you can pretty much forget having any chance of more than a guess at the speed, direction, and number of vehicles.

Consider the distances between wheels. Motorcycle, compact cat, full size car, pickup truck,, semi rig, truck pulling a trailer, and so on. You'd have wheelbases anywhere from 5 feet to over 50 feet, so you can see that even on a one-way, single lane road, accuracy of number and speed of vehicles using a single pressure sensor is a very difficult task.

You should probably start thinking about multiple sensors, in pairs, spread out over a fairly long distance. Two pressure sensors, a few feet apart, will give you direction and speed if there is only one vehicle passing over the sensors at the same time, then a confirming distance and speed as the next set of wheel(s) pass over them again, and so on. Another pair of pressure sensors placed 15 or 20 feet from the first pair would go a long way toward detecting when you are measuring more than one vehicle, and while that scheme won't help when two or more veficles are going the same direction and overlapping, it can help to at leat eliminate some measurements as being invalid.

I wonder if an ultrasonic Ping sensor could be used? If it was aligned with a particular traffic lane it may avoid the complications inherent in several lanes of traffic.

...R

the choice of weight as the criteria may be something required for the project. an empty truck vs a full one. most sensors for traffic only measure the passage at one point, or two to also detect speed.

what are the project requirements ?

Use a rubber air hose, cap one end and put your pressure sensor on the other. Loop it in a "U" shape and keep the sides a fixed distance (~2 feet) apart. You can then detect the pressure changes and measure the time between those changes.

If the open end of the air hose is left open into the same box that houses your electronics you could probably use an inexpensive BMP085 atmospheric pressure sensor.

Counting preasure impulses and trying to measure the time delta between is not going to give you speed, it gives you axle count. You would need to determine vehicle start and end with something like an active inductor (metal detector) or some other proximity detector. and you need a seperate sensor package for each trafic lane. Proximity sense high, vehicle present, so count the pulses and time delta, calculate velocity with interpolated vehicle length and axle count. Proximity sense low, reset counts and wait for next victim. Turned out to be a bit*% of a senior project before there were micro controllers available.