do the above pictures represent your actual project or just something you found that uses sensors to detect cars? Are your sensors just counting cars or are they part of something else such as a gate opener. You need to give far more detail. Like will the cars be stationary at a gate or moving. Are you counting in and out or are you counting for each space. Will there be pedestrians to account for? What number of cars are you counting, how fast will they be going, what surfaces do you have to mount the sensors, is it indoor or outdoor, etc etc.
If it is just the above picture then there is plenty of off the shelf solutions. Google is your friend. ultrasonic/beam break etc could work
No, it's just an image I found on Google image, but I think it's a very good design as also I'm not specialized in these types of projects. I've done some small college projects, but not big ones that works in real life.
And it's a challenge for me to do a project that works in real life situation and also test if the project is prone to errors and failures.
No, just to count cars and display the information on a matrix display.
I'm sorry I should've put some more information in the main post. Let me add some more explanation to my project idea.
count moving cars.
Both in and out.
[quote]Will there be pedestrians to account for?[/quote] No just cars.
Good points, didn't think of these details because I thought it should work ok.
In my project case:
it's outdoors
for college parking
asphalt streets type
main target in the main student parking gate entrance/exitance
cars' speed is the normal parking gate entering/exiting speed; like, 5-20 km/h
mounting the sensors depends on where to mount them, under the asphalt or in those modules in the picture in the main thread post
If cars have one way in and a different way out it is easy. You need 2 sensors for each to detect in/out. These should be positioned far enough apart that both sensors will be blocked by a car but are unlikely to get blocked by, for example, a person. The sensors can be either an ultrasonic distance sensor or a beam break sensor (the later either requires a reflector or the beam/sensor to be on opposite sides of the road). In your code if both sensors are activated at the same time you can assume a car has passed. You may have problems with trailers being counted as a second car. You might need to code some delay between sensing 1 car and another to prevent this.
If cars use the same entrance and exit then you need to detect in your code which sensor was activated first and second to determine the direction of travel but also to only count if both sensors were active at the same time
... or, just count the number of times the entrance gate opens and count the number of times the exit gate opens. These devices account for small vehicles and trailer drawn vehicles.
What is not accounted for is tailgating behind an authorized automobile.
[quote="pmagowan, post:6, topic:1025914, full:true"]
If cars have one way in and a different way out it is easy.[/quote]
Yep, there is a way in and a way out. But I've done a project to count people with one door. As if sensor A triggered then B, in this case the program count it as entering count. And if B triggered then A, this case it's exiting count.
Alright, that's a good point ! That's different than the method I used in people counter project, and it's more proof to ensure than a person doesn't trigger the system.
I got you, so you mean that both sensors must be triggered at the same time to register entrance/exitance.
So do both offer same functionality and efficiency ?
That's an important point in the design, but I don't know about putting another part on the other side, maybe the ultrasonic is better in this regard.
Thanks for the advice to put into consideration.
Yep, I worked with this code and I still have it, of course I have to do some modifications to improve it.
The ultrasonic sensors are cheap and already come with all that is required to get them up and running on an arduino. I would work with one sensor initially on the breadboard and make sure you can get an input from it. Then add the second one. I don't know what you are doing with your count but you will have to decide how you want to read it. It is easy to code it in a variable.
It will be easy to rig up a prototype with some basic hardware. The sensors can be mounted in a junction box and connected by electrical conduit. It depends how close the in and out are as to whether it is easier to use 1 or 2 arduinos. It also depends on what the purpose of the project is. If you wish to display a carpark full/spaces available sign then you must have a way to reset your counter from time to time otherwise any errors in the count could eventually add up over time.
It will be easy to rig up a prototype with some basic hardware.
That's what I want to do before putting it outdoors.
The sensors can be mounted in a junction box and connected by electrical conduit.
The wiring should be done this time with wires, I've thought of using wireless but in the next plan using ESPs.
Or, use high distance wireless modules; like, LoRa.
It depends how close the in and out are as to whether it is easier to use 1 or 2 Arduinos.
I think one Arduino should be enough.
It also depends on what the purpose of the project is. If you wish to display a carpark full/spaces available sign then you must have a way to reset your counter from time to time otherwise any errors in the count could eventually add up over time.
I'm planning to put some control buttons in the control box for the college officials, and put a card of instructions of how to do stuff; like, adjustments, set the system, reset the system, ... etc.
What you think of this method ? I think it's using electromagnetic signals like the ones in some traffic light systems to detect the car existence and give it green light priority instead of waiting if the other traffic sides are empty.
But I think this one is a bit difficult because we have to put holes in the asphalt. Using ultrasonic sensors should work the same and easier to install.