radar 2.0.0.0
Main Page

Radar click

‍Radar Click is a compact add-on board that alerts you to the presence of an intruder via interpreting the infrared radiation that emanates from their body. This board features the MM5D91-00, a presence detection sensor module that integrates 60GHz mmWave technology that counts the number of people entering or exiting an entrance from Jorjin Technologies Inc. It includes the ARM Cortex-M4F based processor system, 1Tx, 3Rx antenna, and integrated regulator, alongside azimuth and elevation field of view of ±45° and ±40°. Its detection goes up to 10m for macro and 5m for micro motion with environmental-factors immunity such as temperature, wind, sunlight, and dust. This Click board™ is suitable for various presence sensing applications, from office and home to commercial buildings and more.

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Mar 2022.
  • Type : UART type

Software Support

We provide a library for the Radar Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

‍This library contains API for Radar Click driver.

Standard key functions :

Example key functions :

  • radar_get_event This function waits for an IN/OUT event or ACK command response.
    err_t radar_get_event ( radar_t *ctx, uint8_t *evt_id, uint8_t *payload, uint8_t *payload_size );
    err_t radar_get_event(radar_t *ctx, uint8_t *evt_id, uint8_t *payload, uint8_t *payload_size)
    Radar get event function.
  • radar_get_temperature This function reads the chip internal temperature.
    err_t radar_get_temperature ( radar_t *ctx, float *temperature );
    err_t radar_get_temperature(radar_t *ctx, float *temperature)
    Radar get temperature function.
  • radar_set_detection_range This function sets the min and max presence detection values.
    err_t radar_set_detection_range ( radar_t *ctx, float min, float max );
    err_t radar_set_detection_range(radar_t *ctx, float min, float max)
    Radar set detection range function.

Example Description

‍This example demonstrates the use of Radar click board by reading and parsing events as well as the module internal temperature.

The demo application is composed of two sections :

Application Init

‍Initializes the driver and logger and performs the click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
radar_cfg_t radar_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
radar_cfg_setup( &radar_cfg );
RADAR_MAP_MIKROBUS( radar_cfg, MIKROBUS_1 );
if ( UART_ERROR == radar_init( &radar, &radar_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( RADAR_ERROR == radar_default_cfg ( &radar ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define RADAR_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition radar.h:144
void application_init(void)
Definition main.c:29
@ RADAR_ERROR
Definition radar.h:221

Application Task

‍Waits for the detection event and then displays on the USB UART the distance of detected object, accuracy, elapsed time since last reset, and the module internal temperature.

void application_task ( void )
{
uint8_t evt_id, evt_payload_size, evt_payload[ 16 ];
if ( RADAR_OK == radar_get_event ( &radar, &evt_id, evt_payload, &evt_payload_size ) )
{
if ( RADAR_CMD_ID_DETECT_IN_EVT == evt_id )
{
log_printf( &logger, " EVENT: IN\r\n" );
memcpy ( distance.b_data, &evt_payload[ 8 ], 4 );
log_printf( &logger, " Target distance: %.3f m\r\n", distance.f_data );
memcpy ( distance.b_data, &evt_payload[ 12 ], 4 );
log_printf( &logger, " Accuracy (+/-): %.3f m\r\n", distance.f_data );
}
else
{
log_printf( &logger, " EVENT: OUT\r\n" );
}
uint32_t evt_time = ( ( uint32_t ) evt_payload[ 3 ] << 24 ) | ( ( uint32_t ) evt_payload[ 2 ] << 16 ) |
( ( uint16_t ) evt_payload[ 1 ] << 8 ) | evt_payload[ 0 ];
log_printf( &logger, " Elapsed time: %.2f s\r\n", evt_time / 1000.0 );
float temperature;
if ( RADAR_OK == radar_get_temperature ( &radar, &temperature ) )
{
log_printf( &logger, " Temperature: %.2f C\r\n\n", temperature );
}
}
}
#define RADAR_CMD_ID_DETECT_IN_EVT
Definition radar.h:79
void radar_float_ieee_to_mchip(float *f_data)
Radar float ieee to mchip function.
void application_task(void)
Definition main.c:65
@ RADAR_OK
Definition radar.h:220
Radar Click float bytes type object.
Definition radar.h:160
float f_data
Definition radar.h:162
uint8_t b_data[4]
Definition radar.h:161

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Radar

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.