Doppler Sensor with CDM324 24.125GHz Module and STM32f303Disco

Introduction

I got some CDM324 24.125GHz doppler module last year, and decided to modify it to detect object speed. Despite its complexity to design, CDM324 module has been made incredibly cheap. It basically comprised of a TX antenna, a RX antenna, resonator as frequency source, some power divider and mixer all in a tiny two-layer RF4 board. The IF pin will output AC if radio frequency reflected back to the RX antenna is different from frequency source, apparently due to doppler effect.

The IF signal frequency is proportional to the speed of the object to be detected, where v=deltaF*lambda. For 24GHz, wavelength is about 1/80 meters. If we know IF frequency, speed can be calculated by the above doppler equation, which is about 1.25m/s per 100Hz.

The Schematic

The IF signal from CD324 module is in terms of mini volt. It needs to be amplified and filtered. In the following schematic, the first op-amp was configured as low pass at 660Hz, since I meant to detect human movement and I don’t think any one would walk at the speed of 7m/s. Moreover, the out put power of CD324 is not very high, reliable speed detection range was tested to be less than 3m.

And here is what it looks like when the circuit has been soldered on a breadboard, together with CDM324 module on the right side. (I actually used some ferrite beads in the circuitry to give the analog circuit a cleaner power supply.)

Output of the circuit was connected to PA1 of a stm32f303-Disco board, where I used a OPEN32F3-D board. It is an expanding board a stm32f303Disco sitting on top. One the right side is a LCD for display FFT result and a simple waterfall graph.

Here is a closer look at the display. The 2nd line is calculated speed according to peek frequency in the FFT plot.  It was fun watching the FFT graph when somebody walks near by, and up until now, the maximum speed it has detected is only 2m/s. And there is a small segment in my code to light up the LEDs if speed detected is over 0.8m/s.

The FFT code

My FFT code use some fragment of the stm32f4 FFT example(https://stm32f4-discovery.net/2014/10/stm32f4-fft-example/). The example used CMSIS DSP library,  arm_math.h to be specific.  However, there is a place you should be aware of: DO NOT enable “use MicroLIB” in the compiler, if you are going to use generic CMSIS lib.  

In my code, 10.24KHz sample rate and 512 samples was used. This means the FFT resolution is going to be 10.24e3/512=20Hz, which corresponds to 20Hz per bar in the FFT bar-plot. In a MCU like stm32f3, due to its limited processing ability, a lower sample count such as 512 was used. Higher sample rate means faster respond, since per 512 samples take less time to collect, but it makes the resolution very coarse.

After some Testing, I found out that there is always some low frequency interference, and the first bar in FFT plot is DC power. Thus, for the 1st and 2nd FFT results, I directly cleared them to be zero.  The low frequency interference may be due to stability issue with a module low cost as this. And I didn’t see very apparent 50Hz interference from power line.

Last but not least, the code(keil IDE) can be downloaded here.