Grove-Doppler-Radar: Speed in m/s

Hello

Has anyone managed to convert the output of the module into m/s? After reading the documentation I'm not sure how this could be done.

Thanks for the help.

Sample-Code:

#include "BGT24LTR11.h"

#ifdef __AVR__
    #include <SoftwareSerial.h>
    SoftwareSerial SSerial(2, 3); // RX, TX
    #define COMSerial SSerial
    #define ShowSerial Serial

    BGT24LTR11<SoftwareSerial> BGT;
#endif

#if defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_RP2350) || defined(ARDUINO_ARCH_RENESAS)
    #include <SoftwareSerial.h>
    SoftwareSerial SSerial(D7, D6); // RX, TX
    #define COMSerial SSerial
    #define ShowSerial Serial

    BGT24LTR11<SoftwareSerial> BGT;
#endif

#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32S3)
    #define COMSerial Serial0
    #define ShowSerial Serial

    BGT24LTR11<HardwareSerial> BGT;
#endif

#ifdef SEEED_XIAO_M0
    #define COMSerial Serial1
    #define ShowSerial Serial

    BGT24LTR11<Uart> BGT;
#elif defined(ARDUINO_SAMD_VARIANT_COMPLIANCE)
    #define COMSerial Serial1
    #define ShowSerial SerialUSB

    BGT24LTR11<Uart> BGT;
#endif

#ifdef ARDUINO_ARCH_STM32F4
    #define COMSerial Serial
    #define ShowSerial SerialUSB

    BGT24LTR11<HardwareSerial> BGT;
#endif

#if defined(NRF52840_XXAA)
    #ifdef USE_TINYUSB
    #include <Adafruit_TinyUSB.h>
    #endif
    #define COMSerial Serial1
    #define ShowSerial Serial

    BGT24LTR11<Uart> BGT;
#endif

void setup() {
    // put your setup code here, to run once:
    ShowSerial.begin(9600);
    COMSerial.begin(115200);
    BGT.init(COMSerial);
    while (!ShowSerial);
#ifndef ARDUINO_ARCH_RENESAS
    while (!COMSerial);
#endif
    /*
        MODE 0 -->detection target mode
        MODE 1 -->I/Q ADC mode

    */
    while (!BGT.setMode(0));
}

void loop() {
    // put your main code here, to run repeatedly:
    uint16_t state = 0;
    ShowSerial.print("target speed:");
    ShowSerial.println(BGT.getSpeed());
    state = BGT.getTargetState();
    //2 --> target approach
    //1 --> target leave
    //0 --> Not Found target
    if (state == 2) {
        ShowSerial.println("target approach");
    } else if (state == 1) {
        ShowSerial.println("target leave");
    }
    delay(200);
}

Example output:
tagetspeed: 52

You could use the general approach to calibrating any sensor, described in this excellent tutorial.

Did you see the following, on the page that you gave the link to?

The minimum speed accuracy that the sensor is capable of detecting is 52cm/s, which equals to 0.52m/s, 3.6km/h and 2.23mph. Additionally, the results returned by function getSpeed() are multiples of 52cm/s and are absolute values accordingly.

So:

Example output:
tagetspeed: 52

Target speed = 52 x 0.52m/s = 27.04m/s

Mhh, that cant be possible.

20:27:45.753 -> Target speed: 0
20:27:45.753 -> No target detected.
20:27:45.984 -> Target speed: 0
20:27:45.984 -> No target detected.
20:27:46.249 -> Target speed: 52
20:27:46.249 -> No target detected.
20:27:46.480 -> Target speed: 0
20:27:46.480 -> Target approach detected.
20:27:46.711 -> Target speed: 52
20:27:46.711 -> No target detected.
20:27:46.975 -> Target speed: 0
20:27:46.975 -> No target detected.
20:27:47.206 -> Target speed: 0
20:27:47.206 -> No target detected.
20:27:47.437 -> Target speed: 0
20:27:47.437 -> No target detected.
20:27:47.667 -> Target speed: 0
20:27:47.667 -> No target detected.
20:27:47.931 -> Target speed: 0


20:27:50.110 -> Target leaving detected.
20:27:50.340 -> Target speed: 52
20:27:50.340 -> No target detected.
20:27:50.605 -> Target speed: 0
20:27:50.605 -> No target detected.
20:27:50.836 -> Target speed: 0
20:27:50.836 -> No target detected.
20:27:51.067 -> Target speed: 0
20:27:51.067 -> No target detected.
20:27:51.331 -> Target speed: 0
20:27:51.331 -> Target leaving detected.
20:27:51.562 -> Target speed: 52


52 is like no movement. the values

20:27:51.562 -> Target leaving detected.
20:27:51.793 -> Target speed: 263
20:27:51.793 -> Target leaving detected.
20:27:52.057 -> Target speed: 422
20:27:52.057 -> Target leaving detected.
20:27:52.288 -> Target speed: 422
20:27:52.288 -> No target detected.
20:27:52.552 -> Target speed: 422
20:27:52.552 -> No target detected.
20:27:52.783 -> Target speed: 422
20:27:52.783 -> No target detected.

that is a slow rolling football.

and see Seeed_Arduino_DopplerRadar/src/BGT24LTR11.h at master · Seeed-Studio/Seeed_Arduino_DopplerRadar · GitHub

/****************************************************************
        Function Name: setSpeedScope
        Description: Set the detection speed range.
        Parameters: maxspeed,minspeed 0-65535
        Return: 1:success  0:fail
    ****************************************************************/
    uint8_t setSpeedScope(uint16_t maxspeed, uint16_t minspeed);

and this:

The system is able to detect speeds between 0.1 and 3 m/s for the settings mentioned.

Does this mean?
v= (Output-Value/65535)*3

Answer from grove:
"Just divide speed by 100.0."

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.