Offline
Newbie
Karma: 0
Posts: 9
|
 |
« on: February 03, 2013, 12:36:21 pm » |
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)
Online
Brattain Member
Karma: 271
Posts: 25422
Solder is electric glue
|
 |
« Reply #1 on: February 03, 2013, 02:42:40 pm » |
Link to this device?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #2 on: February 10, 2013, 04:16:27 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19006
I don't think you connected the grounds, Dave.
|
 |
« Reply #3 on: February 10, 2013, 04:27:06 pm » |
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.
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 271
Posts: 25422
Solder is electric glue
|
 |
« Reply #4 on: February 10, 2013, 04:37:19 pm » |
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:- 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
Brattain Member
Karma: 137
Posts: 19006
I don't think you connected the grounds, Dave.
|
 |
« Reply #5 on: February 10, 2013, 04:44:23 pm » |
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.
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 271
Posts: 25422
Solder is electric glue
|
 |
« Reply #6 on: February 10, 2013, 04:50:12 pm » |
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
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #7 on: February 10, 2013, 05:03:51 pm » |
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
Faraday Member
Karma: 50
Posts: 3448
|
 |
« Reply #8 on: February 10, 2013, 05:32:43 pm » |
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
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #9 on: February 10, 2013, 05:55:15 pm » |
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
Faraday Member
Karma: 50
Posts: 3448
|
 |
« Reply #10 on: February 10, 2013, 06:01:00 pm » |
When you get the frequency, solve for the speed (V). V = Fd/(2(Ft/c)cosθ) Hope I did that right.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #11 on: February 10, 2013, 06:08:14 pm » |
right, cheers. Ill have a play with it and if i require any more assistant ill let you guys know. thank you for help. 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #12 on: February 20, 2013, 03:48:37 pm » |
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
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #13 on: April 18, 2013, 02:47:04 pm » |
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)
Online
Brattain Member
Karma: 271
Posts: 25422
Solder is electric glue
|
 |
« Reply #14 on: April 18, 2013, 06:34:39 pm » |
That code dosn't match the formular in reply #10, did you mean it to?
|
|
|
|
|
Logged
|
|
|
|
|
|