Learning to design and build a 24GHz FMCW Radar from first principles
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
I had all the components with me and it was time to start placing them down.
I very rarely get boards made externally infact it was probably a few years ago I had got one made externally, the reason being is predominately cost, but as well I have not done anything too complex in terms of placement and to be honest, I quite enjoy the manual labor.
I had only ordered five boards and decided to do my usual thing of making my DIY stencil jig.
The thermal paste used was nothing too extravagant. I just use whatever is able to be kept at room temperature. I had found out even past expiry it was still good to use! I suppose the flux had not dried out of it. Using any old card as a squeegee you want a nice even layer across the stencil, it is key you have this secured down and not move it whilst applying the paste, you get this awful squiggy looking texture and uneveness, it will usually result in a bit more rework.
Thus it was time to start placing down 127 components..
After 1 hour and 45 minutes roughly, quite poor timing I think from myself, It was time to solder!
As you can see I am missing U7 and this was because I had messed up on the footprint of it, this led to quite a bit of headache for the rework. A wise man once said that a good design is characterised by a good library. I should have really checked it!
Besides that, the hotplate was also throwing error of it unable to detect the hot plate, whilst having a rattling sound which is never good. Instead of trying to fix it, I had decided to use the hot air gun.
After another 10 - 20 min of hot air and a cup of tea the board was completed, well nearly. I could not find my silicone mat I usually use, so I decided to use an old board that was scrap. Just so I did not burn a hole in my desk, which I have done multiple times..
The overall board was complete and it was time to test it! I had originally thought I was going to build two, but the amount of errors on the board I thought it would be better to save components and use them to build rev B.
The rest of the components are on the way, so I will be documenting the build process.
During the design of the PCB the same rules applied to any other and that was keeping areas seperate on the board where you can and short traces. I certainly was a bit nervous when routing this as the analog portion does not have much wiggle room and the radar output is already quite close to the noise floor.
I have tried to keep the traces as short as possible so they enter the op amp stages as soon as they exit the radar, though looking back I think some optimisation on placement could have been done.
I did project on gas sensing once in a previous role which was quite interesting and the same concerns were had there with such a tiny mV signal coming out of the sensor the same concept of trying to keep things nice and tidy together was important. Highlighted in green is the radar output. You want to make sure that keeping that trace short as possible and entering your op amp gain stages quickly as possible.
On my ADC section I had replicated the layout so when I do find a mistake of course at least it will be easy to fix on all four ADCs. Nifty tool from Altium, PCB layout replication. I had also opted to only fit ADCs needed for one receive antenna, otherwise I thought I may run into more issues getting ahead of myself. Once the signal was amplified I was still cautious to not route it against any clocks or things that will ring. Even though the signal is amplified it is still an analogue signal to be cautious, that is not to say digital ones you do not need to be worry of. A good solid ground plane also helps underneath.
The power section had kept on the other side of the board and rather segregated from anything else. The only other portion of circuitry next to it is my DAC which I will use to generate the chirp which is circled gracefully in red. Again, keeping things seperate from my analogue and digital side the DAC was constantly going to be firing out things, and we saw this in the prototyping of breakout boards that we could see the DAC harmonic being shown on our USB ADC. We are avoiding that this time.
One thing I could have done actually and have forgotten is stitching vias, it is handy to have a checklist and all good, but seems I did not even use it..
You will also notice I had placed lots of test points everywhere, these are your friends, even if you do not expect to use them.
Since we have a solid ground plane underneath with enough 0V vias to tie things together, I do not expect issues of floating copper. Speaking of copper, one of the things I am not doing much nowadays is pouring copper on the top and bottom layers. Yes it does get etched away and perhaps you could argue well it could cause issues maybe its better practice to place a top and bottom copper pour, though Mr. Peterson will do a better job explain than me here.
It has been a while since I last updated this log, with a project but having finally done the schematic and bits of the PCB design now is a good time. Still not too sure what is going on with being unable to place pictures.. I have attached a link to the schematics at the bottom.
Starting off with a block diagram to go through the overall working of the board. I always find it is incredibly useful to do these even how "simple" a project might be. It is useful as well to take down notes, potential components you might use and what was your original design intent.
Working through our way down starting with power. There was a bit of a struggle in selecting what was needed. I wanted to make sure there was enough power budget, ease to bring into the field for trials, and of course something that just made sense. A lot of times when going back and forth you get the feel of intention, and that means the solution is right for the job and ticks all your boxes (or most of them, its compromises after all!) The first hurdle was getting enough power but as well cleanly. 5V is what I had planned to use for the radar module, but USB is notoriously noisy! Even with a power bank, we do not know what sort of switching is going in there. I wanted to filter it out just in case but still opting against the unknown I thought it was unwise to do so, there had to be a better solution. I wanted to give this project the best chance of success and wanted to be flexible with it. I came across this USB-C to barrel jack cable which I thought was quite neat. This gave me a nice input voltage I can work with to step down and pass through multiple LDOs for both the radar and other peripherals. This is nowhere near a production solution but it is the solution that was the quickest to work with and test. Cost is also something to bear in mind as always.
As from previous project logs, the radar outputs tens of mV. This required suitable amplification to read into an ADC, this was also stated in an application note by the manufacturer. There was also a slight DC offset in the scope measurements so that was required to be removed as well. The goals for this were:
I chose the gain to swing around 2.4V ideally, thought it was well within the ADC range and avoided any clipping. This gain will most likely be changed out during testing and board bring up to see how well it responds.
The goal is to receive a clean waveform and easy to debug and make modifications.
Next to look at was the ADC, I had opted for a 16-bit ADC. I could have used the onboard ADC on the micro, which I will talk about my microcontroller selection choice in a bit. Though I wanted the higher resolution and speed. As well the ADC interfaces runs over SPI which I do not envisage is too difficult to communicate and get running. A differential ADC allows taking the bipolar signal out of the radar and turning into a unipolar signal to be read, setting a mid point bias. Had I used the onboard ADC I would still need to do the same thing except with further discrete components.
The DAC is used to generate a chirp for the VCO. For this section it was required to generate up to 5V, as this is what the radar module VCO tuning range was. Compared to the ESP32 that was used previously, we have a 16-bit DAC and this allows us to obtain a higher resolution frequency, which gives a smoother chirp thus a better range accuracy. Since our logic is 3.3V driving the DAC directly at 5V would have given us a direct output but a level shifter would have been needed, so it was decided instead to run it at 3.3V and have an op amp on the output.
I had used previously an ESP32 for what I had on hand, I decided it was a toss up between an STM32 variant or a Pi Pico variant. I had decided to use the Pi Pico 2W which houses a RP2035 and to keep cost...
Read more »IMAGES ARE NOT WORKING FOR SOME REASON.
The next part of the trial was to look at applying a ramp to the radar and turning this from a CW Radar to a FMCW Radar.
The ESP32 was chosen for this trial because it had an integrated 8-bit DAC.
To produce a chirp, a DAC is required to interface with the VCO_in pin on the radar module. The waveform generated is a sawtooth wave.
We adjust these parameters in the min value we set, the max value we want to set and the duration of the ramp. A gpio is also toggelled to indicate the start of each new chirp. Useful when debugging.
Several issues became very present upon attempting to get this to read. The first was the initial script in viewing the response. We had quite a strong 250Hz peak, a strong peak around the 12500Hz mark and a few others. Upon first sight it is easy to think that “Oh maybe these are picking up reflections everywhere and this is it!” quite wrong.
Initially starting out with a 20ms chirp which was not very effective as our approximate beat was given as 42Hz per meter. This was getting lost in the noise and other random artifacts. It becomes apparent over the hardware you chose to get something up and running to prove an idea. The 12.8kHz spike is the DAC it perfectly coincides as:
Fupdate = 256 (steps) / 0.02 (chirp duration) = 12800Hz
The DAC has very minimal filter a simple rc lowpass filter which probably does not help.
We know that our response range is below the 2kHz so we can adjust the graph to take a closer look at what is happening.
Though even before that, what was our signal coming out of our radar in FMCW mode? Absolutely miniature!
This was sitting 50mV and upon movement oscillations had only gone up to 70mV max. This was obviously getting drowned out somewhere in the plotting. The audio interface was most likely just picking up a majority of noise. It does help to read the application notes and datasheet.
Averaging was certainly not the way to go for trying to see “peaks” A moving target introduces Doppler and phase changes from chirp to chirp, by averaging we are almost smushing the data or even part cancelling what we need. What we needed was a waterfall/spectrogram again or a peak tracker.
Chirp aligning was also an issue prior we did not have it before so our FFT was taking arbitrary slices, which causes smearing. Due to lack of hardware chirp aligning was done via software by doing some boundary detects (through the reset transition) Later, it will be added a hardware wire to our USB audio interface for a more deterministic approach. This will reduce segmentation jitter, improve on sharper peaks. Chirp sync is what allows the software FFT slices to line up in time, frequency, and phase.
This waterfall graph showcases how frequency content changes over time. It is a sequence of short-time Fourier transforms stacked vertically. Our signal moves, amplitude changes and the averaging was not a good idea. This normal type of spectrum view is good if we know where to look and it is a station signal.
The bright bands show static reflectors at a fixed range and these bands appear when an object is moved across the radar's view. If the band shifts slightly, this indicates a change in range/velocity.
The waterfall representation was essential because FMCW beat signals are weak and time-varying. Single averaged spectra were dominated by noise and analog slope, stacking spectra over time revealed coherent frequency ridges corresponding to real targets and their motion.
The captured I/Q data already contained both range (FMCW beat frequency) and velocity (Doppler-induced phase/frequency variation) information. However, due to low IF signal amplitude and the use of single-chirp spectral analysis, only qualitative detection was initially possible. Quantitative extraction of range and velocity requires improved SNR via IF amplification and subsequent range–Doppler processing across...
Read more »As a reminder, this is what our basic block diagram looks like:
To start off , the radar is set to continuous wave (CW). Many times than not we forget that we must start off simply and build our way up. Whether this is even as simple as making a LED blink with a microcontroller. Setting this to continuous wave means we can see if our module works and decreasing the amount of parts in this trial.
For context, the VCO pin on the module allows you set a ramp. This ramp allows you to control the chirp, thus making a frequency modulated radar.
The datasheet of our radar module stated a minimum of +3.2V is needed. There were issues in reading the radar output, the current consumption was also below the 90mA specified in the datasheet. The datasheet is treated as gospel usually, at least I used to, though we should really verify these instead of trusting blindly. After steadily ramping the input voltage to +4V data was able to be seen.
With +4V applied to the VCO pin of the radar as well, there is no ramp, a set frequency is applied and this set frequency could be 24.125GHz for example, the radar will transmit that.
Taking a slight step back on how we selected our equipment for this trial, our USB audio converter. Based on Nyquist we can safely sample to roughly 20kHz with a 48kHz sample rate. Our maximum beat frequency in this case must be below 20kHz.
Beat frequency grows in range and slope, and a faster chirp means a higher beat frequency. This is something to know.
That said, how do we know what our beat frequency is or the worst case to design for?
We to estimate the beat freuqency produced by a target at 10 meters using an FMCW radar with: Bandwidth: 150MHz
Chirp Duration: 5ms
Target Range: 10m
Speed of Light: 3 × 10⁸ m/s
Step 1:
Chirp Slope, S (Hz/s)
This tells us how fast the transmit frequency increases.
S = B / T
Where S = Chirp Slope
B = Bandwidth (Hz)
T = Time (S)
S = 150 x 10^6 / 5 x 10^-3
S = 3 x 10 ^ 10
The transmit frequency rises at 30GHz per second.
Step 2:
Round trip delay T
The radar signal must travel to the target, reflect and then travel back.
A target at range R causes a round trip delay:
T = 2R / e
Where R is the distance, in this case 10 meters
E is the speed of light: 3 x 10^8
Substitute that in and you get 6.667 x 10 ^-8s
or
66.7nS
Step 3:
Beat Frequency
In a FMCW radar we mix the current transmit signal and delayed received signal and because the chirp is linear, a time delay becomes a frequency offset.
For a stationary target ignoring Doppler the beat frequency is:
Fb = S x T
Where,
Fb = Beat frequency
S = Chirp slope
T = Round trip time delay
These values we had calculated at S = 3 x 10^10 , T = 6.667 x 10^-8
This gives us a beat frequency of 2kHz.
So at 10 meters, with 150Mhz over 5mS the beat frequency is 2kHz.
Hopefully that example gave some further understanding.
Back to our USB audio converter, it did not require any drivers and such which was delightful. It did require some fiddling however with the settings within Audacity and some PC specific settings such as setting it to stereo and setting the quality as 48kHz.
When plugging everything in, it is to note that it does not matter which channel you use for the input channels on the USB audio converter but for consistency sake and this is actually important that you decide which channel is used for the Q parameter and which channel is used for the I parameter. Data could come in swapped if you mix it up. In this trial I had used the right input for the Q parameter and the left input for the I parameter.
As mentioned before, Audacity was used and this is a great tool that is free to use. Using Audacity lets us see if the data streams through.
It is always good to remember the goal of your project or test, do not let scope creep be a thing. Remember for this trial the condition is “Does my hardware work and can I see a waveform?” or otherwords, “Does...
Read more »The goal of this trial was to have a starting ground for software development and to gain a practical understanding of how a radar functions. Off-the-shelf components were used in this trial to decrease the itimidation of toying around with the dark arts of RF.
The primary goal in this was to extract information off a comercial radar module, digest its output information and being able to plot it on a useful graph of some kind.
First step in anything is the requirements, what does the build need to achieve?
Some of these things we may not be able to acheive in our first trial, but it is good to have something to aim towards that is concrete.
The range we had determined for this test was 24GHz. Why 24GHz?
It is useful to know on what you are going to detect, range, velocity, proximity to other objects, clarity of the object you are going to detect.
When we consider frequencies, higher frequencies do come with benefits. A smaller wavelength, in the case of 24GHz we have a wavelength of 12.5mm. This is small enough to interact with small objects and humans but as well large enough that noise. Errors in alignment and tolerances can be a bit more forgiving in PCB design, manufacturing and antenna calibration. Antennas are generally smaller.
For reference at 2.4GHz we have a wavelength of 12.5cm. Motion detection could be more difficult to characterise with a weaker Doppler.
For a FMCW Radar, we need to look at the bandwidth. This is the ramp start frequency to the stop frequency. This is important to what sort of range resolution we can achieve.
The range resolution is the minimum distance at which two targets need to be seperated to be considered as two seperate targets.
ΔR=c*2B
Where,
c= Speed of light (3×108m/s)
B = Bandwidth of the signal
For 24GHz we approximately get 60cm of range resolution.
Unfortunately one of the drawbacks into our decision is the accessibility of hardware, as we go up the frequency ladder things get progressively expensive and fast. Settling in the 24GHz gives us a nice level field in which things are not too expensive and can be acheived with consumer friendly items.
It is also important to note that it is not permissible to operate in any frequency band one desires. There is allocated frequency bands which are free. Another free band would be 2.4GHz which most of us are familiar with (Bluetooth and WiFi!). Transmit power is also limited, these things we need to take care of and not to overstep our bounds.
Searching the realms of Digikey I had landed on this radar module:
K-LC7-RFB-00H
Radar Transceiver Module 24GHz ~ 24.25GHz Integrated, Ceramic Patch Through Hole
The module was small, low cost, had I/Q outputs, integrated VCO which has an input to modify chirp, two receive antennas and was in our target frequency.
We need something to help intake the data outputted by the radar module. Since it was an analog output, I had opted for an USB Audio Interface. I had landed with this Behringer UCA222 off amazon, as it was afordable and could do what I needed it to do.
Having bought extra RCA cables as well I had stripped them and put a 2.54mm dupont end cable.
The assembly looked like so:
With this our basic setup was complete and we were ready to start testing.
The next part of this project was to understand what exactly is a FMCW Radar?
In a Frequency-Modulated Continuous Wave (FMCW) Radar, a signal is transmitted in which its frequency increases with time, this is known as "chirp"
“Chirpiness” is the rate of change of the instantaneous frequency.
The same concept applies and the signal is reflected off a target and comes back delayed.
Both signals are compared against each other the transmitted and received. This is done using a mixer. The difference between the two is called the “beat frequency”
This is done because frequency is changing with time, and the two frequencies the one transmitted and received are slightly different. This beat frequency lets you compute range.
The closer the target is the lower the beat frequency, and the farther the target is, the higher the beat frequency.
What do we do with this?
Fast Fourier Transform (FFT) transfers this data from the time domain into the frequency domain. This is done on the radar. The beat frequency is sampled, runs an FFT, and each FFT bin corresponds to a distance.
This produces a range of spectrum:
Peaks = targets
Peak position = distance
With motion as we discussed before, this gives rise to the Doppler effect. When the target is moving the beat frequency shifts slightly, this gives the velocity. Doing so and we process these multiple chirps as the radar is doing, the distance is derived and so the velocity from phase change over time.
I/Q signal preserve direction and phase.
This is what the radar outputs:
I (in-phase)
Q (quadrature)
In a radar system they are 90 degrees out from each other. These are fundamental components that are used to capture amplitude, phase and frequency of the radar echo.
In-phase (I) signal
This represents the amplitude of the received signal that is in phase with the original transmitted carrier signal. Convection is a cosine wave.
Quadrature (Q) signal
This represents the amplitude of the received signal that is 90 degrees (π / 2) radians out of phase with the original carrier signal (by convection, sine wave)
Together I and Q signals come together and allow the radars digital signal processor to treat it as a complex number.
A FMCW radar turns time delay into frequency, then frequency into distance.
An FMCW radar transmits a frequency-swept signal, compares the received echo with the current transmit signal, and converts the time delay of the echo into a measurable low-frequency tone. The frequency of this tone gives distance, and changes in its phase over time give velocity.
Once this base knowledge has been established we can utilise off the shelf components and are able to start trialling and building a basic radar before proceeding to hardware development. As much as it is really exciting to start drawing out a schematic and such, it is important to validate first and know what you are actually going to design.
I have been wanting to dabble in the world of RF, I have not done an RF design before and thought it would be an interesting way of understanding more with a practical application. The best way to do something is always by trial and application.
There is a certain amount of base knowledge I knew that was required before diving straight into a design and that was well what is a radar? A google search yields "A system for detecting the presence, direction, distance, and speed of aircrafts, ships, and other objects, by sending out pulses of radio waves which are reflected off the object back to the source"
There had to be a start to break down the parts of a radar. Looking at Continuous Wave (CW) radars, these transmit a constant frequency signal and simultaneously receive the refelected echo scattered from objects continuously. These types are typically used in compact, short-range, low-cost applications. CW Radars can utilise any part of the Radio Frequency (RF) electromagnetic spectrum.
An Unmodulated CW Radar continuously transmits a pure tone such as a sine wave, which is the carrier. The echo is the received scattered from objects. All simultaneously.
By doing so, we measure the Doppler Shift from a moving object.
Doppler shift is the change in a wave's frequency and wavelength due to relative motion between the waves source and observer.
An example of this is an ambulance's siren, the pitch rises as it approaches and falls as it moves away. When moving toward's you, the waves compress (higher frequency) and when moving away they stretch (lower frequency).
If a target / object is static, the frequency of the echo signal is unchanged from that transmitted. If the target / object is moving the frequency of the echo is altered due to the Doppler effect. This Doppler frequency is how the object's motion can be determined.
The faster the object moves in a given direction, the larger the Doppler frequency.
FD = 2Vr/λ
where,
Vr = Radial velocity of the object (m/s)
λ = Wavelength of the CW signal (m)
FD = Doppler frequency (Hz)
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates
About Us Contact Hackaday.io Give Feedback Terms of Use Privacy Policy Hackaday API Do not sell or share my personal information
Martin
Dan Kisling
doctek
Jesse R