I have already delved into how an radar sensor works in my previous post about the Implementation in MicroPython. Since then I have developed, updated and ported the library to Arduino as well, specifically targeting the PSOC6 platform. The core focus of this update is handling "Self-Reflection" and "Leakage" through digital filtering rather than simple thresholding.
Technical BackgroundTo understand how the BGT60 sensor works, it is essential to examine how radar data is read and interpreted. For a more in-depth guide, refer to the MicroPython implementation as well.
Here, I will specifically explore how reflections work and their impact on radar data.
How the Radar WorksIn a standard FMCW (Frequency Modulated Continuous Wave) configuration, using an up-chirp, the radar emits a signal where the frequency increases linearly over time. The returned signal undergoes a slight frequency shift due to the Doppler effect, which occurs when the signal interacts with moving objects. By comparing the frequency of the original signal with that of the returned signal, the sensor can accurately determine the distance, speed, and other characteristics of objects in its surroundings. As observed in raw FFT data, the signal strength is highest at the lowest frequencies. This is not typically an object, but rather leakage. There are two types of leakage:
As observed in raw FFT data, the signal strength is highest at the lowest frequencies. This is not typically an object, but rather leakage. There are two types of leakage:
- Antenna Leakage: The signal travels directly from the transmitter antenna to the receiver antenna without hitting an external object.
- On-board Reflection: Components on the PSOC6 PCB or the sensor housing itself reflect the signal immediately.
Previously, I used a static threshold function to ignore these peaks. However, this is inefficient for dynamic environments.
Anti-Reflection FilterSince the current design only calculates distances to solid objects with known distances, we can leverage this information to design a filter. In normal distance measuring, the sensor does not measure over a broad spectrum. This can be used to create a filter.
First, I implemented a broad moving average filter. The moving average filter calculates a smooth form of the received data, canceling out peaks. However, we need these peaks to detect distances. To address this, I subtract the moving average from the original data, allowing me to detect all peaks. The next step is to calculate the required FIR (Finite-Impulse-Response) or IIR (Infinite-Impulse-Response) filter. In the calculation below, only the input signal is transformed and used. Since we do not need to store the output signal, this is an FIR filter.
We can detect our signals now much easier. In this case we see that we have a object around 50cm away (in this case a radar cube). At 150cm and 180cm it detected the nearby walls as well!
Hardware SetupWhen using the CY8CKIT-062S2-AI board, no additional hardware setup is required.
The Pins used by the CY8CKIT-062S2-AI Board are:
- MOSI (Master Out Slave In): 41
- MISO (Master In Slave Out): 42
- CLK (Clock): 43
- CS (Chip Select): 44
- Reset-Pin: 40
When using a different board be sure to connect the SPI-Interface (MOSI, MISO, CLK) to digital pins with SPI-Capabilities. The Chip-Select and Reset can be put to a regular GPIO-Pin.
Install the Arduino IDE if you haven't already, under 'Preferences/Additional boards manager URLS' enter:
https://github.com/Infineon/arduino-core-psoc6/releases/latest/download/package_psoc6_index.jsonNow the needed libraries for the PSOC board should be installed.
Software SetupInstall the Software directly over the Packet-Manager from Arduino by entering:
arduino-xensiv-radar-sensor-bgt60tr13In the near future, the library can be installed using the Arduino package manager.
Current Development of the Library- Currently, only one of three receiver antennas is configured by the library.
- This means that no angular resolution can be performed. Thus no tracking of objects or position detection can be done. However, the library is actively being improved, and users are encouraged to contribute to its development.
Check out this repo for more information on this project!
If you have any questions or suggestions don't hesitate to leave a comment below.
To understand how the BGT60 sensor works, it is essential to examine how radar data is read and interpreted. For a more in-depth guide, refer to the MicroPython implementation as well. Here, I will specifically explore how reflections work and their impact on radar data.








Comments