The BGT60LTR11 Radar Shield2Go is a compact and versatile radar sensor from Infineon, designed for a wide range of applications requiring motion detection and direction sensing. This guide will walk you through its features, setup, and integration with an ESP32 microcontroller, providing a solid foundation for developing AI applications such as home automation, security systems, and smart devices.
Overview of the BGT60LTR11 Radar Shield2Go
The BGT60LTR11 is a 60GHz radar sensor that employs Doppler radar technology. Unlike frequency-modulated continuous-wave (FMCW) radars, which can detect both the distance and speed of an object, the BGT60LTR11 is a non-frequency-modulated Doppler radar. This limitation means the radar can only provide binary information: whether there is motion and the direction of that motion (approaching or departing).
Key Features and Specifications:
Programming Compatibility: Can be programmed using Arduino IDE, with libraries provided by Infineon.
Detection Range: 0.5 m to 7 m, extendable to 14 m with an additional XMC1302 controller.
Adjustable Settings: Potentiometers and switches (QS1-QS4) allow manual adjustment of radar settings.
Compact Design: Small form factor of approximately 5 cm x 2.5 cm.
Core Components: Features a 60GHz transceiver BGT60LTR11AIP MMIC with one transmitter and one receiver.
Functional Overview
The BGT60LTR11 detects motion through the Doppler effect, where it measures the frequency shift of the reflected signal caused by a moving object. It provides binary information about the motion status (motion detected or not) and the direction of movement (approaching or departing).
Limitations:
Distance Measurement: Cannot determine the exact distance to an object.
Velocity Measurement: Limited to detecting the presence and direction of motion.
Hardware Setup
For this tutorial, we will connect the BGT60LTR11 Radar Shield2Go to an ESP32 microcontroller and use an SSD1306 0.96-inch OLED display for visual output. This setup will allow us to detect motion and display the detected data.
Connecting the Radar Shield2Go to ESP32
The radar shield requires specific pin connections for proper operation. Below are the required connections:
Shield2Go Pin | ESP32 Pin |
TD | GPIO 17 |
PD | GPIO 16 |
GND | GND |
Vin | VCC (3.3V) |
Connecting the OLED Display to ESP32
The OLED display communicates with the ESP32 using the I2C protocol. The connections are as follows:
OLED Pin | ESP32 Pin |
SCL | GPIO 21 |
SDA | GPIO 22 |
GND | GND |
VCC | VCC (3.3V) |
Detailed Sensor Configuration
The radar module can be configured using the quad state signal (QS) switches. These allow fine-tuning of the sensor's performance characteristics.
QS1 (Mode Selection):
Left: Autonomous mode
Right: SPI mode (sensor communicates via SPI interface) QS2 (Sensitivity/Range Adjustment):
Sets detection range from 0.45 m to 7.66 m.
Example settings: 0.45 m (leftmost), 5.8 m (middle), 7.66 m (rightmost).
QS3 (Hold Time Adjustment):
Defines the duration for which the detection signal remains active.
Example settings: 1 second (rightmost), 2 minutes (middle), 15 minutes (leftmost). QS4 (Frequency Selection):
Sets the radar's operating frequency.
3 Positions: 61.1 GHz (left), 61.2 GHz (middle), 61.4 GHz (right).
Important: Always adjust these settings with the radar powered off to avoid damaging the sensor.
Example Code for Motion and Direction Detection
The following Arduino code initializes the radar and OLED display, then continuously monitors for motion and direction, displaying the results on the OLED screen.
/*!
* \name motionANDdirectionDetection_Display
* \brief This example detects the motion and direction of an object
* \details This example demonstrates how to detect a moving object and its direction while the
* BGT60LTR11AIP shield is connected to an ESP32 board.
*
* Connection details:
* --------------------------------------------------
* Pin on shield Connected to pin on ESP32
* --------------------------------------------------
* TD 17
* PD 16
* GND GND
* Vin VCC (3.3V )
* --------------------------------------------------
*
* Decoding on-board LED output of BGT60LTR11AIP shield:
*
* - Red LED indicates the output of direction of motion once target is detected (PD)
* ---------------------------------------------
* LED State Output explanation
* ---------------------------------------------
* Red ON Departing target
* OFF Approaching target
* ---------------------------------------------
*
* - Green LED indicates the output of target in motion detection (TD)
* ---------------------------------------------
* LED State Output explanation
* ---------------------------------------------
* Green ON Moving target detected
* OFF No target detected
* ---------------------------------------------
*/
#include <Arduino.h>
#include <bgt60-ino.hpp>
#include <bgt60-platf-ino.hpp>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
/* TD : Target Detect Pin
* PD : Phase Detect Pin */
#ifndef TD
#define TD 17
#endif
#ifndef PD
#define PD 16
#endif
Bgt60Ino radarShield(TD, PD);
/* OLED */
#define SCREEN_WIDTH 128 // OLED width, in pixels
#define SCREEN_HEIGHT 64 // OLED height, in pixels
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
Serial.begin(9600);
Error_t init_status = radarShield.init();
if (OK != init_status) {
Serial.println("Init failed.");
} else {
Serial.println("Init successful.");
}
if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("Failed to start SSD1306 OLED"));
while (1);
}
delay(2000); // wait two seconds for initializing
oled.clearDisplay();
oled.setTextColor(WHITE);
oled.display();
}
void loop() {
oled.clearDisplay();
oled.drawRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, WHITE);
oled.setTextSize(1);
oled.setCursor(26, 5);
oled.println("BGT60 - Radar");
oled.drawLine(0, 15, SCREEN_WIDTH, 15, WHITE);
/* Initialize the variable to NO_MOTION */
Bgt60::Motion_t motion = Bgt60::NO_MOTION;
/* Initialize the variable to NO_DIR */
Bgt60::Direction_t direction = Bgt60::NO_DIR;
/* The getMotion() API does two things:
1. Returns the success or failure to detect the moving or the direction of an object as a message of type Error_t.
Any value other than OK indicates failure
2. Sets recent event in "motion" and "direction" variable, respectively. Events can be: NO_MOTION or MOTION
and APPROACHING, DEPARTING or NO_DIR, respectively */
Error_t err1 = radarShield.getMotion(motion);
Error_t err2 = radarShield.getDirection(direction);
/* Check if API execution is successful */
if (err1 == OK && err2 == OK) {
/* Combined cases based on value set in motion and direction variables */
switch (motion) {
case Bgt60::MOTION:
Serial.print("Target in motion detected and ");
oled.setTextSize(1);
oled.setCursor(16,25);
oled.println("Motion Detected!");
switch (direction) {
case Bgt60::APPROACHING:
Serial.println("is approaching!");
oled.setTextSize(1);
oled.setCursor(28, 40);
oled.print("Approaching ");
oled.write(30);
break;
case Bgt60::DEPARTING:
Serial.println("is departing!");
oled.setTextSize(1);
oled.setCursor(33, 40);
oled.print("Departing ");
oled.write(31);
break;
case Bgt60::NO_DIR:
Serial.println("direction cannot be determined.");
oled.setTextSize(1);
oled.setCursor(34, 40);
oled.println("Unknown");
break;
}
break;
case Bgt60::NO_MOTION:
Serial.println("No target in motion detected.");
oled.setTextSize(1);
oled.setCursor(35, 35);
oled.println("No Motion");
break;
}
} else {
/* API execution returned error */
Serial.println("Error occurred!");
oled.setTextSize(1);
oled.setCursor(35, 41);
oled.println("Error occurred!");
}
/* Reducing the frequency of the measurements */
oled.display();
delay(2000);
}
Additional Considerations and Project Ideas
Presence Detection: Although the sensor does not directly detect presence (only motion), setting it to maximum sensitivity can make it highly responsive to slight movements, effectively simulating presence detection.
LED Indicators: The radar module has onboard LEDs for basic status indication:
Green LED (PWR): Indicates power status.
Blue LED: Lights up when motion is detected.
Red LED: Indicates the direction of motion—on for departing, off for approaching.
Project Ideas:
Smart Lighting: Integrate the radar sensor to turn lights on/off based on motion detection.
Security Systems: Use the sensor to detect unauthorized movements in restricted areas.
Interactive Displays: Create touchless interaction systems for public information kiosks.
For more inspiration and detailed project implementations, visit Hackster.io's projects on BGT60LTR11AIP.
This guide covers the essential setup and usage of the BGT60LTR11 Radar Shield2Go with an ESP32 microcontroller. By following these instructions, you can begin experimenting with radar-based motion and direction sensing for various AI applications.
コメント