Radar based motion and speed detection module

RichardO

Joined May 4, 2013
2,270
Hi, so that means : a Microphone preamp , a low pass filter folllowed by a microcontroller should solve my purpose. Can u suggest which microcontroller to use.
The microphone preamp is a place to start. You have to make sure that it has enough gain. Ideally, you want to get the signal up to a few tenths of a volt.

Use the microcontroller that you are most familiar with and have tools for. I would use a PIC since that is what I have done for a long time and am set up for.

Because the microcontroller expects a digital signal into its timer you will need an analog voltage comparator between the amplifier output and the timer input. Some microcontrollers have analog comparators built in.
 

Thread Starter

Manjugolu

Joined Jul 31, 2014
16
I have never seen a frequency counter used in this kind of system (too slow). There are two methods of processing that I have seen:
1. Software method - Amplify, digitize and then do a Fast Fourier transform or FIR filtering.
2. Hardware method - Filter banks with threshold detection.
Hi, Can you elaborate the software method.
 

RichardO

Joined May 4, 2013
2,270
Hi, Can you elaborate the software method.
The software I am familiar with is quite simple.

1. Measure the period of the signal.

2. Convert measured period to k/h.

3. Display k/h.


Using the timer hardware in the microcontroller should make the period measurement easier and more precise/accurate.
 

Thread Starter

Manjugolu

Joined Jul 31, 2014
16
The software I am familiar with is quite simple.

1. Measure the period of the signal.

2. Convert measured period to k/h.

3. Display k/h.


Using the timer hardware in the microcontroller should make the period measurement easier and more precise/accurate.
Hi, instead of using a separate analog comparator why not utilise ADC of microcontroller. I have atmega168 which has ADC.
 

Thread Starter

Manjugolu

Joined Jul 31, 2014
16
Hi, instead of using a separate analog comparator why not utilise ADC of microcontroller. I have atmega168 which has ADC.
But the frequency is quite low (less than 5 KhZ). Do you think I should use a zero crossing detector and then input the resulting square wave to a microcontroller to get frequency and speed.
 

jpanhalt

Joined Jan 18, 2008
11,087
Not sure why you want to use the ADC. As for measuring the period, consider using the CCP module that many Microchip devices have. That will capture a 16-bit count (Timer1), so the range of frequencies that you need to measure should not be an obstacle.

John
 
But the frequency is quite low (less than 5 KhZ). Do you think I should use a zero crossing detector and then input the resulting square wave to a microcontroller to get frequency and speed.
Show us some code from one of your prevoius projects.
This will help people to help you. We need to know where you are at.
 

Thread Starter

Manjugolu

Joined Jul 31, 2014
16
Not sure why you want to use the ADC. As for measuring the period, consider using the CCP module that many Microchip devices have. That will capture a 16-bit count (Timer1), so the range of frequencies that you need to measure should not be an obstacle.

John
Hi, I have never worked with PIC before and as I came to know CCP feature exists in PIC. But I think of a different solution now: convert incoming sinusoidal wave coming from preamplifier circuit to square wave using zero crossing detector circuit. Then send the square pulse to a microcontroller to count the no. of pulses to give resulting frequency.
As highest frequency that needs to be detected is less than 5 KHz, so I think I could go with 8051 microcontroller. What do you say?
 

jpanhalt

Joined Jan 18, 2008
11,087
I am not familiar with the 8051. Apparently, it has 16-bit timer(s). The concern I raise about the timer is based on the range of frequencies you may see. Say, that range is 5 Hz to 5 KHz, and you have 255 counts at 5 Hz for a single high period. At 5 KHz you wouldn't get a single count.

With 16 bits, you should be able to have a reasonable number of counts for the high frequency and not overflow the counter at the low frequency. What level of precision do you need for the high frequency signal? You can deal with overflows and changing presets and so forth to cover the range. I am just thinking of the simplest approach.

How much time will you have to measure the signal? There are a couple of these threads circulating right now. According to the responses, almost all such detectors use FFT.

John
 

Thread Starter

Manjugolu

Joined Jul 31, 2014
16
I am not familiar with the 8051. Apparently, it has 16-bit timer(s). The concern I raise about the timer is based on the range of frequencies you may see. Say, that range is 5 Hz to 5 KHz, and you have 255 counts at 5 Hz for a single high period. At 5 KHz you wouldn't get a single count.

With 16 bits, you should be able to have a reasonable number of counts for the high frequency and not overflow the counter at the low frequency. What level of precision do you need for the high frequency signal? You can deal with overflows and changing presets and so forth to cover the range. I am just thinking of the simplest approach.

How much time will you have to measure the signal? There are a couple of these threads circulating right now. According to the responses, almost all such detectors use FFT.

John
Hi, I read about the FFt method. It seems quite complex to solve my purpose. So, I think to use CCP feature of timer. My guide has avr atmega16 microcontroller and I am asked to it. Apparently it has this capture feature. Through it I can directly get to know frequency of input signal. But what about the speed of target. I know how the relation between speed and frequency. But how to perform it on AVR or any uC when using CCP feature to calculate frequency. Any advice is highly appreciable.
 

jpanhalt

Joined Jan 18, 2008
11,087
There are library math routines for every microcontroller I have read about. Just set up the equations you want to use, maybe adjust or modify to fit the controller and language you are using, and then try your code.

One decision you will probably need to make is whether to use floating point or integer math. Maybe you should post the equations you need to use here.

You mention your "guide." Is this a school assignment or a real project you need to solve? If it is for school, what other limitations have been placed on the solution? Is this for real construction or just simulation?

John
 

Thread Starter

Manjugolu

Joined Jul 31, 2014
16
There are library math routines for every microcontroller I have read about. Just set up the equations you want to use, maybe adjust or modify to fit the controller and language you are using, and then try your code.

One decision you will probably need to make is whether to use floating point or integer math. Maybe you should post the equations you need to use here.

You mention your "guide." Is this a school assignment or a real project you need to solve? If it is for school, what other limitations have been placed on the solution? Is this for real construction or just simulation?

John
Hi,the equation I use is:
fd = (2* fo* v)/c
where fd= doppler shifted frequency
f0= transmitted frequency
v= velocity of moving object
c0= speed of light
I think by using Compare/capture feature of timer, I could get value of fd and then use this equation to find v.
 

jpanhalt

Joined Jan 18, 2008
11,087
If you enter the constants and simplify the equation, you may have a simpler time. As shown in an almost identical post on another site for a radar frequency of 24 GHz:

Capture.PNG

In other words, if fd = 300 Hz, the component of speed directly toward you is 6.8 km/h .

How much precision do you need for the speed? Is ±1 km/h enough? You might consider just a look-up table instead of doing the calculation.

John

Edit: That equation is given on page 7 of the link provided in Post #10 of this thread.
 
Last edited:

Thread Starter

Manjugolu

Joined Jul 31, 2014
16
If you enter the constants and simplify the equation, you may have a simpler time. As shown in an almost identical post on another site for a radar frequency of 24 GHz:

View attachment 71544

In other words, if fd = 300 Hz, the component of speed directly toward you is 6.8 km/h .

How much precision do you need for the speed? Is ±1 km/h enough? You might consider just a look-up table instead of doing the calculation.

John
Hey, ±1 km/hr is good enough. The range of frequency is high :from a slow pedestrain to a fast moving vehicle. So I dont think lookup could be a good idea.
 

jpanhalt

Joined Jan 18, 2008
11,087
There are a variety of ways to approach that in a table look-up. Think about how you can take several fd's and come up with a single number in a sequence for them. Then all you need is a table with 100 entries, i.e., ≤1-100; or you could have a table with 1000 entries and so forth. For example, with a simple, 100-item table, all of the fd's that equate to 5.50 km/hr (242 Hz at 24 GHz)) to 6.49 km/hr (286 Hz at 24 GHz) have to give the same look-up value.

If you make an Excel spreadsheet of every possible value (velocity and fd), it might help.

John

Edit: I forget whether you are using Assembly or C. If Assembly, you may find Peter Anderson's approach to using a double table for large tables useful:

http://www.phanderson.com/PIC/16C84/mult_string.html

This thesis implements that method for a character set:

View attachment Ganti Deepika.pdf
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
Hi,the equation I use is:
fd = (2* fo* v)/c
where fd= doppler shifted frequency
f0= transmitted frequency
v= velocity of moving object
c0= speed of light
...
If that formula is right, and you are transmitting a fixed frequency, then everything is constant apart from velocity and doppler freq, which are directly proportional.

So you just need a single scaling factor and a very simple calc;
fd = v * scale
transposes to;
v = fd / scale

so that is just one division with a constant scaling value; "scale".
 
Top