Traffic speed monitoring

Thread Starter

dansteely

Joined Feb 26, 2017
37
Hi All,

Our road is a rat run that has increasing numbers of high speed rats. (The 'Fast & Furious' producers have a lot to answer for..)

I want to approach our local council with some empirical rather than anecdotal data. To that end I'd like to gather a month or two of speed data utilizing some home brewed electronics. The data i'm after would be speed of vehicle and time stamp.

My street frontage is a solid wall of hedge. I could place a couple of sensors 'looking' across the road, say 5m apart, with matching reflectors in my neighbours garden opposite.

I have a shed close to the hedge that could house the electronics (a PC?) with cables going out to the sensors.

I'd appreciate any thoughts or pointers on this.

Many thanks.
 

MrSoftware

Joined Oct 29, 2013
2,273
Your challenge is 2-way traffic. If two cars going in opposite directions pass your IR beams at the same time, you can get some whacky readings. If your road is 1-way or one lane then you're OK here. How much do you want to invest? You can get a strait up radar gun on Amazon for just over $100 these days, but someone will have to sit with it for a while beaming people:

https://www.amazon.com/s?k=radar+gun&ref=nb_sb_noss_1

I'm not sure how much you're comfortable with, but if you can get some of those rubber hoses and pressure sensors, stretch them across only 1 lane and tack them down, that might be the easiest method, and most people will probably think it's the city doing it anyway. Just be aware of your liability if the off chance an issue occurs near them.
 

djsfantasi

Joined Apr 11, 2010
9,237
Use an ultrasonic distance sensor and a real-time clock on a microprocessor.

Ignore any results greater than a pre-determined distance, isolating your results to a single lane of traffic.

Take two measurements a constant time apart. Call that time “deltaTime”.

Convert each distance measurement into an x (distance along road) and y (distance from shoulder to vehicle). Basic trig will work here.

Discard the y measurement.

Divide x by deltaTime. This is the velocity.

Use an SD card, or wireless network connection to log a date/time stamp and the velocity.

Your neighbor has a similar setup to monitor traffic in the other direction.
 

Thread Starter

dansteely

Joined Feb 26, 2017
37
Many thanks all,

The road has two way traffic. It's a fairly quiet road from a volume POV. Some of the surrounding larger roads are horribly clogged at peak times which causes driver frustration which results in people ripping down our road.

Two cars traveling in opposite directions outside our house at the same time would indeed produce aberrant data, but these could be filtered in post processing. I was envisaging using Excel to analyse and present the data graphicly.
 

MisterBill2

Joined Jan 23, 2018
28,062
Years ago I designed a velocity measuring package at the company I was working for. It used two led laser beams 4 inches apart to read velocity in one direction only. breaking the first beam would start a counter and breaking the second beam would stop that counter. Software calculated the speed based on the number of counts, with a resolution of 0.01MPH, because it was a fast frequency being counter, 1` MHZ. For use in both directions you would need two counters , one for each direction. So really the speed measuring system would not be that hard to build, nor would the software be that complex.The really tricky part would be having the two beams exactly 4.000 inches apart for the entire distance, across the road and back to the sensors. And the oscillator will need to be crystal controlled and very stable. And if there is ever a two-vehicle event it will be very obvious that no car was going well over 100MPH.
 

Reloadron

Joined Jan 15, 2015
7,908
While not quite fully automated Bushnel markets a speed radar gun which retails for about $99 USD and is a plug and play. The downside is less any hacks it requires someone to sit there and use it. So 10 neighbors all upset with speed on their street each kick in $10 USD and then the block watch can take turns logging speeds.

Product description

Model: VELOCITY (10-1911CM)
Measuring range:
Ball: 16-177 km / h 10-110 miles per hour
Car: 16-320 km / h 10-200 miles per hour
Effect of distance:
The ball: 0-22.5 M
The car: 0-390 M
The measurement accuracy: +/-1.0MPH +/-2.0KPH
Display unit: km / h (KPH) or miles per hour (MPH)
Weight: 539 g
Specification: 109x213x512mm

I have never used one but would venture with some hacking efforts things could be automated.

As to sensor solutions using chronograph methods or like the old rubber hose gas station bell. I would think knowing the width of the road would help. My residential street traffic runs both ways overlapping center unless they are passing each other. No on street parking. Velocity = Distance / Time so really all that is needed is a relatively good clock. A gate signal opens the gate and clock pulses counted till a gate signal closes the gate. The number of pulse during open gate time are counted. Maybe a few garage door safety switches to start and stop the timing? You would still get bum numbers with occasional bi-directional traffic.

Ron
 

MisterBill2

Joined Jan 23, 2018
28,062
The fix with that speed gun is a camera that snaps a picture of both speed and time with a digital clock in the picture as well. Then you don't need any hacks, just one light beam to trigger the camera. And RR has the math about right for calculating speed, but those hoses are not nearly good enough. And all somebody has to do is go fast and lock the brakes as they go over the hose, and the hose is damaged to leak. The 2 hose system is really only OK for direction.
 

MrSalts

Joined Apr 2, 2020
2,767
Get a $100 LidarLite from Garmin. It can take lidar measurements 5x per second and you can pull data via i2C as distance or velocity (vs previous measurement). Store the data to a PC.
 

MrSoftware

Joined Oct 29, 2013
2,273
Lidar-Lite that @MrSalts mentioned:

v3 -- https://www.sparkfun.com/products/14032
v3 HP (in IPX7 waterproof case) -- https://www.sparkfun.com/products/14599

Notice the links to the hookup guide and an existing Arduino library, so in theory a lot of the work is done for you already. For your use case, the biggest improvement to the HP model is the IPX7 waterproof case.

Maybe you can mount it on your mailbox post or a stick ALMOST parallel to the road, such that it only picks up one lane. Just pick an angle that makes the location where the beam would intersect the second lane far beyond the 40m range. Lidar isn't as sure a thing as lower tech as it relies on reflectivity, but on paper it should work, and if it does then it would be one of the simpler methods to implement I think. Heavy rain or a dirty lens might cause temporary issues, but if you check on it daily then my guess is it will be good-enough. Logging on an Arduino would be cake. Add an SD card or get a fancier model Arduino with SD slot built in and you can easily take it to your PC for analysis. Or add a wireless connection if you've got the time. :)
 

MisterBill2

Joined Jan 23, 2018
28,062
Two cameras, one getting the speed gun display and the time, and the other getting a photo of the license tag on the car, would certainly be useful for making a case. The logistics of the setup may be a challenge, so the whole project depends on the degree of motivation,
 
Top