Skip to content

Example 50: Radar Sensor Module ​

Supports RCWL-0516 microwave radar, 5.8GHz human presence/motion radar, and other modules with OUT digital output. FastBee has a built-in RADAR_SENSOR peripheral type with type ID 49, and the read result is 1/0.

Wiring ​

Using RCWL-0516 as an example:

Module PinESP32/ESP32-S3Description
3V33.3VModule 3.3V output or power pin, wire per actual labeling
GNDGNDCommon ground required
OUTGPIO16 exampleDefault outputs HIGH when target detected
VIN4-28VNote power range when using VIN supply
CDSOptionalCan connect photoresistor control, per module documentation

For 5.8GHz radar modules with only VCC/GND/OUT, connect OUT to an input GPIO.

Peripheral Execution Read ​

Add a new peripheral execution rule, select Sensor Read:

json
{
  "periphId": "radar_01",
  "sensorCategory": "radar",
  "dataField": "presence",
  "sensorLabel": "Radar Presence",
  "unit": "",
  "decimalPlaces": 0
}

After execution, data source ds:radar_01_presence is written:

ValueMeaning
1Motion or presence detected
0Not detected

Linkage Example ​

Turn on relay when someone is present:

  1. Create a timer-triggered rule to perform radar read every 1-2 seconds.
  2. Create an event-triggered rule, event select ds:radar_01_presence, condition = 1.
  3. Select relay peripheral for action, set HIGH or LOW depending on relay active level.

Debug Interface ​

http
GET /api/peripherals/status?id=radar_01

The detected and value fields in the response can be used to confirm module output.

Installation Tips ​

  • Do not cover the radar antenna area with metal enclosure. Point the sensing surface toward the detection area during installation.
  • RCWL-0516 default detection range is several meters. Output stays HIGH for a period before pulling LOW — this is the module's own behavior.
  • If the module outputs LOW to indicate detection, uncheck "OUT HIGH indicates detection".
  • Radar penetrates thin plastic and cardboard more easily than PIR, and is more affected by installation environment. Perform final threshold and delay testing after fixed installation.

FastBee | fastbee.cn