Go Down

Topic: X-band motion detector, pulse count (Read 2 times) previous topic - next topic

fafty111

I am doing a project where i want to measure the speed of an object but before i get anywhere near that i want to know how the x-band motion detector can work with arduino.  I want to know how i can get the arduino to count the pulses from the the x-band when it detects movement.  I am not sure how to do this, please help.  thanks in advance

Grumpy_Mike


fafty111

sorry about the late reply, heres the link:

http://www.active-robots.com/sensors/object-detection/x-band-motion

AWOL

Quote
I want to know how i can get the arduino to count the pulses from the the x-band when it detects movement.
I think you may be confused. The module doesn't output pulses, just the difference (Doppler) frequency of the transmitted and received signals.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Grumpy_Mike

Quote
The module doesn't output pulses, just the difference (Doppler) frequency of the transmitted and received signals.

Are you sure? It looks like it outputs pulses to me.

To use it just connect pin 2 to a digital input and the ground to the arduino ground. When movement occurs then the value you read will change.

The data sheet says:-
Quote
These modules (boards) are not FCC approved. They are designed to comply with FCC Part 15 Rules and Regulations. They are not in a finished product form. They are strictly intended for experimental purposes only. If you wish to use these modules in an actual product (a non-experimental capacity), the module must first be designed into the product then the whole product must be approved by the FCC. Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs of recovering, reprogramming, or reproducing any data stored in or used with Parallax products.


In short that means it is illegal to use them without a license.

AWOL

Quote
signal oscillates with motion

Whatever that means.
I took it to mean the usual simple mixer output.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Grumpy_Mike


Quote
signal oscillates with motion

Whatever that means.
I took it to mean the usual simple mixer output.

I think it just toggles when ever any motion is detected rather like a PIR sensor.

fafty111

Yha, i spoke to my tutor and he said it does give out pulses but im a bit confused on how i can measure the change in frequency, i tried looking up ways to do so but i dont understand what they mean as they are not very beginner friendly.  please can you help me figure out how i can measure the frequency change, thank you

SurferTim

#8
Feb 10, 2013, 11:32 pm Last Edit: Feb 10, 2013, 11:48 pm by SurferTim Reason: 1
Sure. Page 5 of the datasheet has the formula for the output frequency.

Fd = 2V(Ft/c)cos?

Where:
Fd = Difference frequency (sometimes referred to as Doppler frequency)
V = Velocity of the target
Ft = Transmit frequency
c = Speed of light at 3 × 108 m/s
? = Motion direction angle deviation from perpendicular to the antenna PCB.

edit: The speed of light showed up wrong, so I changed it.
Then use an interrupt to determine the time between pulses.

fafty111

right, so after i use interupt to get the time between the pulse, i can work out f? using f=1/T?

SurferTim

When you get the frequency, solve for the speed (V).
V = Fd/(2(Ft/c)cos?)
Hope I did that right.

fafty111

right, cheers.  Ill have a play with it and if i require any more assistant ill let you guys know.  thank you for help. :)

fafty111

hello again, i managed to get the arduino to use the PulseIn operation and made a basic circuit with a resistor and switch to control the high time myself, it displays the correct result, but i cant figure out wat the transmitt frequency is? Does it change depending on the speed or is it constant?

fafty111

Hello, i have mannaged to get it working and display the velocity on the serial minitor but its not very acurate, probably becasue the beam isn't focused but i was wondering if my code is right or not, can someone please see if its my code thats not right because im not sure why its not that accurate.  thank you

Int pin = 7;                   
unsigned long duration;              

void setup()                                                                         
{


  Serial.begin(9600);

  pinMode(pin, INPUT);
}

void loop()
{
  duration = pulseIn(pin, HIGH);

  float f;
  float T;
  float V2;
  float V;
 

  T = duration * 0.000001;
  f = 1/T;
  V2 = (f * 300000000) * (10525 * 1000000);
  V = V2/2;
  Serial.println(V, 2);
 
}

Grumpy_Mike

That code dosn't match the formular in reply #10, did you mean it to?

Go Up