Is there any possibilities ? [Speed Sensing with ultrasound]

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys,
Is there any possibilities to create a simple speed sensor from PIR?

So I will put PIR 1 and PIR 2 in a distance,
If an object is passing, I'll calculate the time needed from PIR 1 to PIR 2, from there I can determine the speed because I know the distance between PIR 1 and PIR 2,

Any ideas or experiences will be very appreciated,

Thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

provided you are able to interface the PIR (passive infra-red sensor?) to the uC then the speed calculation is very easy.

What sort of interface does the PIR provide - open collector, SPI, serial....

It might also be worth looking at the beam-width of the sensor. if it is very wide you will need to think about that for the speed calculation.

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AFIK, PIRs are fairly erratic at sensing objects. They obviously work but sometimes quite early.

Think about the domestic porch light. It turns on when you approach your front door, but sometimes when you are 10 metres and other times when you are 2 metres away.

If you can "narrow" the beams, you should be able to calculate a person's speed.

I have a PIR controlled light over a cattle-grid. Sometimes it does not come on until I have already walked over the cattle-grid. Fortunately, I know where it is.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A photodiode would be a better sensor for this application.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
A photodiode would be a better sensor for this application.

JC


any links / references for this application ?
thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bianchi77 wrote:

So I will put PIR 1 and PIR 2 in a distance,
If an object is passing, I'll calculate the time needed from PIR 1 to PIR 2, from there I can determine the speed because I know the distance between PIR 1 and PIR 2,

What objects, sensed at what distance variation, and what speed and errors in speed are you expecting.

PIR often use a charge pump/slow integrator, which can give rather 'elastic' response times.

Reflective beam sensors will be more precise, but they do mostly need a remote reflector
(commonly seen in shop doorways).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As asked above, if you can tell more about what you are trying to measure it will be easier to provide more suggestions.

Measuring a turtle's speed is different from measuring a gun's muzzle velocity.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
As asked above, if you can tell more about what you are trying to measure it will be easier to provide more suggestions.

Measuring a turtle's speed is different from measuring a gun's muzzle velocity.

JC

I want to measure the speed of the car at the traffic light...
Any suggestions ?
Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are we talking about a real car at a real traffic light? I don't think a PIR will work too well. Something like a laser rangefinder will be quite accurate and reliable. Use a scanning one and you can measure a number of cars simultaneously.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I also was thinking primarily of lasers when I mentioned the photodiodes.

Of course for large objects like a car, and low speeds like a car moving through an intersection, one could also use ultrasound.

But my favorite approach would be to process sequential video frames.

Of course the first two methods could be done with an 8-bit AVR.

The last one, I think not.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Are we talking about a real car at a real traffic light? I don't think a PIR will work too well. Something like a laser rangefinder will be quite accurate and reliable. Use a scanning one and you can measure a number of cars simultaneously.

Yes I'm talking about real car and real traffic light.
Any ideas ( parts name ) for laser rangefinder ?
I have doppler sensor in my hand, but not sure if I can use it or not....
Any clues ?

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For ultrasonic sensor,
something like this one ?

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That one, (properly mounted to protect it from the weather), would be a good starting point.

With two of those one could mount them on the sidewalk, aiming in towards the traffic, watching for tires to go past. You want them separated far enough to reduce the error in the speed calculations, but close enough together so that the tires are moving at about the same distance from the sensors, and at about the same speed as they pass both sensors, as one would expect the detection threshold vs off-dead-center angle to vary with the speed of the tires moving past.

Building one or many?

The classic way to count cars is with a hose stretched across the road and a pressure sensor measuring the pressure pulses as tires drive over the hose.

Two hoses across the road could be used for speed measurements, also.

Do you have the ability to dig up the road and put sensors in the road itself?

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
That one, (properly mounted to protect it from the weather), would be a good starting point.

With two of those one could mount them on the sidewalk, aiming in towards the traffic, watching for tires to go past. You want them separated far enough to reduce the error in the speed calculations, but close enough together so that the tires are moving at about the same distance from the sensors, and at about the same speed as they pass both sensors, as one would expect the detection threshold vs off-dead-center angle to vary with the speed of the tires moving past.

Building one or many?

The classic way to count cars is with a hose stretched across the road and a pressure sensor measuring the pressure pulses as tires drive over the hose.

Two hoses across the road could be used for speed measurements, also.

Do you have the ability to dig up the road and put sensors in the road itself?

JC

Yes I saw some pressure sensor on the road,
do you have link or exact name for it ?
May be I can find one in ebay ?

I have HB100, can I use it as well ?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did any manufacturer think of Doppler shift for ultra sonic sensors (they measure position : but they could measure Doippelr shift -a frequency difference- which is proportional to radial speed-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does this need to use a AVR?
In real lift, (and not a permanent solution), I would just place a camera, and see far far a car move pr x frames, using a PC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bianchi77 wrote:
For ultrasonic sensor,
something like this one ?

Check the data.
The Parallax Ping))) one says 18.5ms + some waits, per reading, so call that ~ 25ms, and 50km/h is 13.8889m/s, or 72ms/m if you prefer.

Fired at right angles to the side of a car, that will resolve to 0.347m.

Resolution of Speed may be a issue, 25ms rate would give 2.5% in 1 second, needing a spacing of 13.8m, to drop that to 1%, you need a spacing of close to 35m, which sounding rather large.

What can you tolerate here ?

You could use multiple sensors, spaced just far enough apart to not interact, and phased in their triggering.
A cluster of 3 at each end, would drop the spacing-per-% by a factor of 3, from trigger interleave alone.

Pushing this further, I think you could calibrate all 3, and then take multiple samples, and use the first unit to find the kerb-distance, and then numbers larger than that, but below a 'no car' value, would give a fractional-overlap information, and so interpolation on that 0.347m is probably possible.

Is this a class project ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bdrion,

Doppler shift is a great way to measure velocity, but one needs a very fast processor.

A microwave radar unit may have this ability already built into the module. The HB100 data sheet I saw wasn't much of a data sheet, too little info provided.

One can do this with ultrasound, but not typically with an AVR. The "simplest" method is to sample the receiver ping and measure the frequency of the incoming signal. For a 40 kHz ultrasound crystal and perhaps 20 samples per period that means a sampling rate of 800 kS/Sec, plus the memory to store them, and a fast processor to work with the data.

Note, of course, that with a smart trigger, (PLL'd to the ping rate and the transit time), and a short ping of 5 to 10 periods, the number of data points is minimal.

One could use an AVR, perhaps, if one mixed the incoming signal with a 35 kHz local oscillator to get a difference frequency of 5 kHz, +/- delta F. This could now be directly sampled for the received frequency with an Xmega.

This method, of course, requires a "good" analog front end for the ultrasound receiver transducer, feeding a good mixer, and a good LPF to block the 75 kHz output from the mixer.

This is best built from scratch, not using the pre-fab'd module above. It, in all likelihood, has a simple envelope detector feeding a simple threshold detector. For the above one needs access to the actual incoming signal, not its envelope.

All doable, but not a trivial project.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"One could use an AVR, perhaps, if one mixed the incoming signal with a 35 kHz local oscillator to get a difference frequency of 5 kHz, +/- delta F."

Another solution would be to mix the incoming signal with the outcoming signal (supposing there is no phase shift in a permanent oscillator), getting a difference frequency of +/- deltaF (if rogue drivers drive at 25 m/s -in an arbitrary direction!- near a traffic light, deltaF would be 7 khz (2*25*40K/300) -with a 5khz lag, that would be 12 khz: avr can sample at this speed... xmega surely can). with an xmega, two analog multiplers and two rejectors, one could have two channels (one sin(40Khz*t), the other one cos(40khz*t)). analog multipliers would be for low frequencies, high pass rejector would reject 80 khz -and keep up to 8 khz- :3.3 octaves ; if there is an intermediate frequency, they have to keep up to 12 khz and reject 75 khz -2.6 octave-
It is a pity such an ustrasonic capter does not exist for hobbyists (with microwaves, it is used by the police to gather a lot of money )

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Change thread title to 'Speed Sensing with ultrasound'

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OP looks for a way of speed sensing for cars near a traffic light : he had the idea of
* PIr (seems discarded), got the idea of
*LED,
*ultrasonic (but the use of Doppler shift, which looks straightforward, is not implemented and might be complicated and expensive to build)
* camera with image correlation

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So many good projects, so little time...

JC