I have bought a MR24D11C10 Human Presence mmwave Radar Sensor. On powering up through the Arduino Nano or directly through power supply, it draws 500+ milli watts which means module is working.
The following program was uploaded:
#include <falldetectionradar.h>
FallDetectionRadar radar;
char buff[30];
void setup()
{
radar.SerialInit();
Serial.begin(9600);
delay(1500);
Serial.println("Readly");
}
void loop()
{
//Please fill in the data frame you want to set according to the datasheet(Excluding 2 Byte checksum frames)
unsigned char data[] = {0x55, 0x08, 0x00, 0x05, 0x01, 0x04, 0x03};
unsigned int length = sizeof(data)/sizeof(unsigned char);
unsigned char datas[length + 2];
for (int n = 0; n < length; n++)datas[n] = data[n];
unsigned short int crc_data = radar.us_CalculateCrc16(data, length);
sprintf(buff, "The CRC16 values is: %04x", crc_data);
Serial.println(buff);
datas[length] = (crc_data & 0xff00) >> 8;
datas[length+1] = crc_data & 0xff;
Serial.print("The datas send to the radar: ");
for (int n = 0; n < length + 2; n++){
char buffsend[1];
sprintf(buffsend, "0x%02x ", datas[n]);
Serial.print(buffsend);
}
Serial.println();
delay(6000);
}
the above code gives below output:
Readly
The CRC16 values is: 0c80
The datas send to the radar: 0x55 0x08 0x00 0x05 0x01 0x04 0x03 0x0c 0x80
The CRC16 values is: 0985
The datas send to the radar: 0x00 0x08 0x00 0x05 0x01 0x04 0x03 0x09 0x85
But the example code does not work:
#include <falldetectionradar.h>
FallDetectionRadar radar;
void setup()
{
radar.SerialInit();
Serial.begin(9600);
delay(1500);
Serial.println("Ready");
}
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.Situation_judgment(dataMsg); //Use radar built-in algorithm to output human motion status
}
}
Kindly help.