I'm new to Arduino and i'm trying to figure out which Hardware I need for my project.
I want to make a program that counts cars that get inside and out of my jobs parking lot.
Does anyone know which Board and sensors will fit for this kind of project ? (PIR sensor, Ultra sonic, etc..)
Thank you very much and sorry for my bad English
An Infra Red 'Beam Break' type of sensor would be suitable.
Depending on the layout of your car parking lot, you might be able to have one sensor to detect cars going in, and one to detect cars leaving.
Whatever type of sensor you use, be prepared to get false counts when cars are entering and leaving at the same time, or if someone 'tailgates' the car in front.
It might pay you to reset your count whenever the car park gets empty (if it ever does), or at some time, such as the middle of the night when occupancy is likely to be low.
If running long leads to your Arduino , you ought to look at opto isolators on the digital inputs , or some form of signal conditioning and using screened cables to the sensors .
Induction loops are a very common, robust way of detecting and counting cars. No risk of your sensors getting blocked by dirt, grime, rainwater, or other environmental contaminations. It may require some digging, though.
Counting works best if it's done at a one-way location where the vehicles are guaranteed to continue moving in that direction (so no reversing for a count out when it's not done, or even a second count out when the car actually reverses back in).
Optical sensors can easily be confused by people walking through the car entrance. The induction loop ones can only be triggered by large pieces of metal so bicycles and even some motorbikes don't show up as cars.
I've seen other implementations with a sensor above each park. Often an ultrasonic distance detector can be used to detect an obstruction in the parking place, which is as good as saying there's a car parked there.
To do it properly costs money. There are probably many professional companies out there willing to do this for money.
Do need to know if the cars are entering or leaving, or just how many pass through the entrance?
If you can sense from overhead, ultrasonic sensor can tell vehicles as closer than ground.
But an induction loop is going to be the single best detector.
If you have 2 sensors not far apart, you should get direction by which is tripped first and still sensing last.
Another simple option that is quite common is to use 2 air hoses sealed on one end with the other end attached to a pressure sensor. When the hoses get crushed, the pressure spikes. You can read the pressure spikes using an interrupt. Then you can compare which hose got crushed first to determine direction of travel, speed, etc. Just counting spikes is easy. If you did a little more work you could measure the spike and tell what triggered it (ie bike, truck, car).
Just don't buy the cheap pressure sensors. Those will probably fail from abuse fairly quick.
Normally the air hoses are used only for temporary projects - such as counting traffic for a few days or a week at a certain road. Induction loops are used for permanent installations - such as for regulating traffic lights.
The hoses will suffer from the mechanical stress and break down. They are of course much easier to install and remove.
If you put a piezo on a board and tap the board, you can detect that too.