24ghz mmwave radar sensor - range

I have a 24 GHz mmWave Human Static Presence Sensor. According to the manufacturer, it has a human detection range of up to 12 meters. My question is it possible to reduce this range to e.g. 3 meters?
If so, how to do it?

I am using this library: GitHub - Seeed-Studio/Seeed_Arduino_24GHz_Radar_Sensor

Neglecting measurements giving more then 3 meters?

1 Like

The website you reference states:
Body perception maximum distance: up to 3 meters

I see, but there is another thing. I found a second libary: Seeed-Studio-MR24FDB1-Sensor, where there is sample code in it called Physical_Parameters_Example. After running this code on the Serial Port Monitor I get the following data:

----------------------------
55 B 0 4 3 6 0 0 F8 41 5E 65 
31.00
SOMEBODY MOVE
----------------------------
55 B 0 4 3 6 0 0 0 40 DC 65 
2.00
SOMEBODY STOP
----------------------------
55 B 0 4 3 6 0 0 90 41 71 A5 
18.00
SOMEBODY MOVE
----------------------------
55 B 0 4 3 6 0 0 B0 41 68 65 
22.00
SOMEBODY MOVE
----------------------------
55 B 0 4 3 6 0 0 18 42 57 A4 
38.00
SOMEBODY MOVE

My question is how should I write the code so that I can control the LED depending on the received data, e.g. if the value is greater than 5, light the LED. From what I can see, the function that determines the value of the variable and the message to be printed is in the file named falldetectionradar.cpp I don't have much experience in programming, so I'm asking for help.

What do all the numbers mean?

If I understand it correctly, that's it data frames sent by the radar. In the previously mentioned cpp file there is a fragment that defines this function:

void FallDetectionRadar::Bodysign_judgment(byte inf[], float Move_min, float Move_max){
  typedef union
  {
    unsigned char Byte[4];
    float Float;
  }Float_Byte;
  if(inf[3] == ACTIVE_REPORT){
    if(inf[5] == BODYSIGN){
        Float_Byte fb;
        fb.Byte[0] = inf[6];
        fb.Byte[1] = inf[7];
        fb.Byte[2] = inf[8];
        fb.Byte[3] = inf[9];
        ShowData(inf);
        Serial.println(fb.Float);
        if(fb.Float >= Move_min && fb.Float < Move_max){
          Serial.println("SOMEBODY STOP");
        }
        else if(fb.Float < Move_min){
          Serial.println("NOBODY");
        }
        else if(fb.Float >= Move_max){
          Serial.println("SOMEBODY MOVE");
        }
        Serial.println("----------------------------");
    }
  }
}

In my code, I'd like to use a value fb.Float

Simple:

if(fb.Float >= 5)
{
	digitalWrite (LED_pin, HIGH) // Turn on LED
}

Yeah I tried it eariler, but I got that error:

exit status 1

Compilation error: 'fb' was not declared in this scope

Show your code

#include <falldetectionradar.h>

#define LED 10

FallDetectionRadar radar;

void setup()
{
  radar.SerialInit();
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  delay(1500);
  Serial.println("Readly");
}


void loop()
{

 radar.recvRadarBytes();                       //Receive radar data and start processing
 if (radar.newData == true) 
 {                  //The data is received and transferred to the new list dataMsg[]
    byte dataMsg[radar.dataLen+1] = {0x00};
    dataMsg[0] = 0x55;                         //Add the header frame as the first element of the array
    for (byte n = 0; n < radar.dataLen; n++)dataMsg[n+1] = radar.Msg[n];  //Frame-by-frame transfer
    radar.newData = false;                     //A complete set of data frames is saved
    
    //radar.ShowData(dataMsg);                 //Serial port prints a set of received data frames
    radar.Bodysign_judgment(dataMsg, 5, 10); //Output of human movement using sign parameters + możliwość ustawienia wartości, które dają dany efekt

    if(fb >= 5)
    {
	    digitalWrite (LED, HIGH) // Turn on LED
    }
    
 }
  
}

This exatcly the same code as in on of the examples which I mentioned earlier

Fb is only defined within void FallDetectionRadar::Bodysign_judgment
You need to put your LED code there.

In cpp. code?

Sorry I misunderstood how you were using the code.
Maybe someone else on the forum who has used the library can help

Actually, I write that function to cpp. and it works. But it turned out that this program can only detect motion, not presence, which means I have to use something else Nevertheless, thank you very much for your help :slight_smile:

The problem is in your selection of the radar sensor. It uses Doppler effect to detect motion, as ALL radar sensors do. You will have to find a radar the does not use Doppler effect.

@Paul_KD7HB It uses FMCW so it can detect stationary objects.

It can detect stationary objects but it looks like the Seeed studio library does not include any functions to do it

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