Vehicle Detection Project

Hi everyone ! I would like to make a vehicle detection system on the single lane road in front of our house, where I, and my neighbors are to build a mini Traffic light system with CCTV

We would like to place a sensor system, that will work as vehicle detector. If the Traffic light goes red, the vehicle detection system will activate and starts detecting the presence of cars.

However, we lack some budget for high-end vehicle detection sensors. Can we use this magnetometer product from adafruit ?
Thanks

here's the link:

Coincidently i'm working on a car-detection-system myself. But it relies to heavy on a visual system so I chose a raspberry pi with camera and openCV (Low on cost, easy to program with python and C++).

The adafruit board detects magnetic influences. A car itself isn't all that magnetic I would think.

What you could try is placing a strong magnet a few feet from the board (You really have to test it...) and try to detect it's magnetic field. If the car passes and the magnetic field changes, you could detect the car.

But you do need to test it heavily. And fix the magnet firmly or it'll hook onto the first car that passes (but then you'll be able to detect that one car very well ;))

That's great. I just want to clarify, are you still pertaining to the "adafruit board" when you said to test it with the strong magnet?

Yes I am.

The adafruit board can be used to measure and detect a magnetic field. Normally, without an additional magnetic field, it detects the earth's magnetic field and can therefore be used as compass.
But when you add an additional (strong) magnet nearby, it'll detect that magnetic field.
When a metal object like a car passes the strong magnet, the magnetic field would alter and be more focused on the metal object. With the adafruit board you'll be able to detect the change in magnetic field and know an object has passed.

But you'll need a pretty powerful magnet with a efficient magnetic field that could span at least a few feet so you'll be able to detect it, and it needs to be able to be influenced by the object that stands a foot from the pavement.

1 Like

I'm thinking something about doing a series of (adafruit board-to-magnet-lane).

I attached the image below. Will this be effective? I don't think I can find a very strong magnet whose magnetic field will be detected from less than 2 meters.

So I am thinking of monitoring the behaviors these boards to determine a vehicle detection.

1 Like

I don't see why not.

But the proof is in the puddin'... IMHO it'll depend on the strength of the magnetic field.

BTW: the boards are I2C, so you can daisy chain them as long as the individual addresses are different.

EDIT: I now know that the addresses are not changeable on the boards... So you'll need to find a way to connect all 3 boards with the same addresses to the arduino, for example a I2C multiplexer.

1 Like

Thank you for the information ! I will test everything to find out its efficiency.

YW. And please post your findings! Other people can learn from it as well (and i'm very curious myself..)

1 Like

sure ! :slight_smile:

Would it be simpler to use a laser rangefinder? If you're pointing it at the ground just in front of the light, near a stop line, you will get a lower number when a car is present and a higher number when it's just hitting the ground.

I'm curious why so many people are working on traffic systems. This is the third or fourth thread I have seen recently on this subject.

Steverobey:
I'm curious why so many people are working on traffic systems. This is the third or fourth thread I have seen recently on this subject.

My 2C:
Traffic systems and especially traffic SAFETY systems is a continual point of interest. Governments are willingly to pay big for a system that can save lives and decrease the amount of accidents.
So i'm working on a system because I think it'll be "worth something"... Just like I thought of some other systems that have failed in my past ;D

1 Like

I feel like we could reduce car accidents a lot by jamming cellular phones on highways and congested traffic areas, but I'm sure that goes against somebody's rights and I myself would hate it if my phone didn't work during my 45 minute drive to work.

Any number of things can be done to try and reduce accidents, unfortunately there are those drivers who won't pay attention to the signs, the signals or the pedestrians. There's also the matter that people tend to imbibe and then decide they need to drive somewhere..

I wish you good luck though, it will be interesting to see what you come up with.

The only ways to end the vehicular abuse of some people (In my mind at least) is to have a mandatory IQ test with every drivers licence (Unconstitutional unfortunately), fine the pants off of someone when he/she messes up or create a technical solution for the problems. If a car detects it's user is on the phone it should react by putting on some heavy metal music at volume 11 or something like that.

But i'm now getting way off topic on this...

What I am wondering now, is what the end goal of the OP is... The light turns red, the system is active, but what does it detects? A car waiting? A car that runs the red light?
There are a lot of systems already being used for both options. The red-light-reduce method for example. It computes the amount of cars on each side and then calculates the shortest waiting time. So the lane with the most car activity gets the least red light. Very interesting in my opinion.

C-F-K:
The only ways to end the vehicular abuse of some people (In my mind at least) is to have a mandatory IQ test with every drivers licence (Unconstitutional unfortunately), fine the pants off of someone when he/she messes up or create a technical solution for the problems. If a car detects it's user is on the phone it should react by putting on some heavy metal music at volume 11 or something like that.

But i'm now getting way off topic on this...

What I am wondering now, is what the end goal of the OP is... The light turns red, the system is active, but what does it detects? A car waiting? A car that runs the red light?
There are a lot of systems already being used for both options. The red-light-reduce method for example. It computes the amount of cars on each side and then calculates the shortest waiting time. So the lane with the most car activity gets the least red light. Very interesting in my opinion.

digitalWrite(Rant_Mode, HIGH);
car accidents involve two or more cars, and EVERYONE involved is, in some small way, responsible.
if you are involved in a car accident, in any way, shape or form and you lost your license until the first hearing at which point some judge or panel would restore everyone who was not more than, say, 25% responsible. well, that would be a very legal thing to do. license suspension is perfectly legal. it is a license, not a right.
all hearings are 30 days. if not, then everyone accessed at the scene is on probationary license.
any tickets would incur similar penalties. a 'cinderella license' for 7 after the fine is paid.
any second ticket within that time is a 30 day loss of license.
rule that have no penalty are not rules.
in our world, if we do not follow the rules, it crashes, there is no close enough
digitalWrite(Rant_Mode,LOW)

dave-in-nj:
digitalWrite(Rant_Mode, HIGH);
car accidents involve two or more cars, and EVERYONE involved is, in some small way, responsible.
if you are involved in a car accident, in any way, shape or form and you lost your license until the first hearing at which point some judge or panel would restore everyone who was not more than, say, 25% responsible. well, that would be a very legal thing to do. license suspension is perfectly legal. it is a license, not a right.
all hearings are 30 days. if not, then everyone accessed at the scene is on probationary license.

I partially agree... But such a system is very abuse sensitive. If I was parked but relaxing in my car, and my ex would hit me with her car, then I would lose my licence. Because i'm employed and she isn't, it would influence my life a whole lot more than hers. (It's just an example! I may have an ex that stalks these forums I think...) Of course I will eventually get my money if i'm proven to be the victim, but tell that to my Bill lumbergh like boss...
I'd still think of eliminating the human factor in a crash. If the car detects it's user from wanting to do harm, it should intervene. And if the car "predicts" a crash, it should do so as well. Check out that self-driving car from the google-overloads, ALL accidents it was in, where not caused by the car but humans crashing into it with 99% of the fault by the human (The other 1% where the distracting camera's and such on the roof of the car...)

the car sensors I see are huge coils in the road. 3 ft on diameter.

like large loop metal detectors.

these seem easy enough to make, and the circuit is well established.

you could just put one on the ground and use black duct tape to make it stick to try it out.

I think you probably could use some tar to make it more permanent.

the ones I see are deep, they saw into the road and bury them, then fill the holes.

dave-in-nj:
the car sensors I see are huge coils in the road. 3 ft on diameter.

like large loop metal detectors.

these seem easy enough to make, and the circuit is well established.

you could just put one on the ground and use black duct tape to make it stick to try it out.

I think you probably could use some tar to make it more permanent.

the ones I see are deep, they saw into the road and bury them, then fill the holes.

They are part of a tuned circuit. Any large metal object passing over them will alter the tuning, which can be detected.

Hello greetings to know if it served the prototype of magnetic sensor plus magnets to detect mobile cars.

This is a useful link;

Induction loops work well. They might not detect bicycles though. Another problem I have found is that people in low vehicles may stop quite far back from the lights so that they can see the lights and may not trigger the loop.

ardly:
This is a useful link;
How Do Traffic Light Sensors Work? - Auto Mate Systems Ltd.

Induction loops work well. They might not detect bicycles though. Another problem I have found is that people in low vehicles may stop quite far back from the lights so that they can see the lights and may not trigger the loop.

A high reliability system that worked for everything from pedestrians to 18 wheelers could include multiple sensors, eg magnetic, laser, visual, sound, mass and button pressing. Software could differentiate between vehicle types. But for low budget, how about a line of half a dozen break beams a meter or so apart. Then analyze the pattern if two consecutive beams are broken.