Pages: [1] 2   Go Down
Author Topic: X-band motion detector, pulse count  (Read 1692 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Link to this device?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry about the late reply, heres the link:

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24370
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24370
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
signal oscillates with motion
Whatever that means.
I took it to mean the usual simple mixer output.
Logged

"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.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 10, 2013, 05:48:56 pm by SurferTim » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
 
}
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1] 2   Go Up
Jump to: