DFRobot SEN0609 mmWave Radar
The dfrobot_sen0609 component lets you use the DFRobot SEN0609 and SEN0610 24GHz mmWave radars (C4001 family)
with ESPHome. The radar reports human presence and, in speed and distance mode, the distance, speed and signal energy
of a moving target. The SEN0609 has a detection range of up to 25 m and the SEN0610 up to 12 m.
The component talks to the module’s text command line over UART, so set the module’s communication switch to UART.
A UART is required, with both tx_pin and rx_pin, baud_rate set to 9600, parity set to
NONE and stop_bits set to 1.
uart: tx_pin: GPIOXX rx_pin: GPIOXX baud_rate: 9600
dfrobot_sen0609:
binary_sensor: - platform: dfrobot_sen0609 has_target: name: PresenceHub Component
Section titled “Hub Component”At every boot the hub stops the sensor, writes the run mode, the UART output settings and the LED switches, reads the versions when text sensors are configured, reads the settings that have an entity configured, and starts the sensor again. The run mode, the UART output and the LEDs are applied each time instead of being saved on the module.
The module ignores commands that arrive too quickly, so the hub sends one command at a time and retries a command that is rejected or not answered, up to three times. When the module does not answer at all, the component shows a warning status and tries again after 30 seconds.
Configuration Variables
Section titled “Configuration Variables”-
id (Optional, ID): Manually specify the ID for this component. Necessary if you want to define multiple instances of this component.
-
uart_id (Optional, ID): The ID of the UART to use. Required if you have multiple UARTs configured.
-
model (Optional, string): The radar model, which sets the largest value of the range numbers. Defaults to
SEN0609.SEN0609: Detection range up to 25 m.SEN0610: Detection range up to 12 m.
-
mode (Optional, string): The run mode of the radar. Defaults to
presence.presence: The radar reports whether a person is present.speed_and_distance: The radar reports the distance, speed and energy of a moving target. Needed for the sensors.
Binary Sensor
Section titled “Binary Sensor”binary_sensor: - platform: dfrobot_sen0609 has_target: name: PresenceConfiguration Variables
Section titled “Configuration Variables”- dfrobot_sen0609_id (Optional, ID): The ID of the hub component. Required if you have multiple hubs configured.
- has_target (Optional):
truewhen the radar detects a target. Inpresencemode this is a person being present; inspeed_and_distancemode it is a moving target. All options from Binary Sensor.
Sensor
Section titled “Sensor”The sensors need the hub mode to be speed_and_distance; configuration validation fails otherwise. When no target
is detected, the sensors report an unknown state.
dfrobot_sen0609: mode: speed_and_distance
sensor: - platform: dfrobot_sen0609 target_distance: name: Target Distance target_speed: name: Target SpeedConfiguration Variables
Section titled “Configuration Variables”- dfrobot_sen0609_id (Optional, ID): The ID of the hub component. Required if you have multiple hubs configured.
- target_distance (Optional): The distance to the target in metres. All options from Sensor.
- target_speed (Optional): The speed of the target in metres per second. All options from Sensor.
- target_energy (Optional): The signal energy reflected by the target, without a unit. All options from Sensor.
Text Sensor
Section titled “Text Sensor”The versions are read from the module at boot.
text_sensor: - platform: dfrobot_sen0609 version: name: Software Version hardware_version: name: Hardware VersionConfiguration Variables
Section titled “Configuration Variables”- dfrobot_sen0609_id (Optional, ID): The ID of the hub component. Required if you have multiple hubs configured.
- version (Optional): The software version of the module. All options from Text Sensor.
- hardware_version (Optional): The hardware version of the module. All options from Text Sensor.
Settings
Section titled “Settings”The number, switch and select entities change the settings of the module. The hub
reads their values from the module at boot, so the entities show what the module holds. The query_params
button reads them again.
Changing a setting stops the radar for a moment: the hub stops the sensor, writes the change, saves it to the module’s flash and starts the sensor again. Changes made within a second of each other are saved together. If the module does not accept a change, a warning is logged and the entity shows the module’s value again.
The run_led and out_led switches are the exception: the module forgets them at power off, so they are not read
from the module or saved to its flash. The hub writes them at boot from the switch’s restored state. Changing an LED
also stops and starts the sensor.
Some settings are written in pairs with one command: min_range with max_range, hold_sensitivity with
trigger_sensitivity, and on_latency with off_latency. When only one of a pair has an entity, the other value is
read from the module and written back unchanged.
Number
Section titled “Number”number: - platform: dfrobot_sen0609 max_range: name: Maximum Range off_latency: name: Off LatencyConfiguration Variables
Section titled “Configuration Variables”- dfrobot_sen0609_id (Optional, ID): The ID of the hub component. Required if you have multiple hubs configured.
- min_range (Optional): The shortest distance at which a target is detected, from 0.6 m to the longest range of
the
model. All options from Number. - max_range (Optional): The longest distance at which a target is detected, from 0.6 m to the longest range of
the
model. All options from Number. - trigger_range (Optional): The distance within which a target must come to trigger presence, from 0.6 m to
the longest range of the
model. Once triggered, presence is held up tomax_range. Only inpresencemode. All options from Number. - hold_sensitivity (Optional): The sensitivity, from 0 to 9, used to hold presence once it is triggered. Only
in
presencemode. All options from Number. - trigger_sensitivity (Optional): The sensitivity, from 0 to 9, used to trigger presence. Only in
presencemode. All options from Number. - on_latency (Optional): The delay before presence is reported, from 0 to 2 seconds. Only in
presencemode. All options from Number. - off_latency (Optional): How long presence is held after the target is gone, from 2 to 1500 seconds. Only in
presencemode. All options from Number. - inhibit_time (Optional): How long detection is suppressed after presence ends, from 0.1 to 60 seconds. Only
in
presencemode. All options from Number. - threshold_factor (Optional): The detection threshold, from 0 to 65535. Higher values need a stronger
reflection to detect a target. Only in
speed_and_distancemode. All options from Number.
Configuration validation fails when a number is used in a hub mode it does not support.
Switch
Section titled “Switch”switch: - platform: dfrobot_sen0609 run_led: name: Run LEDThe module forgets the LED states at power off, so the hub writes them at every boot. The LED switches default to a
restore_mode of RESTORE_DEFAULT_ON.
Configuration Variables
Section titled “Configuration Variables”- dfrobot_sen0609_id (Optional, ID): The ID of the hub component. Required if you have multiple hubs configured.
- micro_motion (Optional): Detection of small movements. Only in
speed_and_distancemode; configuration validation fails otherwise. All options from Switch. - run_led (Optional): The module’s run LED. All options from Switch.
- out_led (Optional): The module’s LED that lights while a target is detected. All options from Switch.
Select
Section titled “Select”select: - platform: dfrobot_sen0609 out_pin_level: name: Out Pin LevelConfiguration Variables
Section titled “Configuration Variables”- dfrobot_sen0609_id (Optional, ID): The ID of the hub component. Required if you have multiple hubs configured.
- out_pin_level (Optional): The level of the module’s OUT pin while a target is detected,
loworhigh. All options from Select.
Button
Section titled “Button”button: - platform: dfrobot_sen0609 restart: name: RestartConfiguration Variables
Section titled “Configuration Variables”- dfrobot_sen0609_id (Optional, ID): The ID of the hub component. Required if you have multiple hubs configured.
- restart (Optional): Reboots the module. The module does not answer this command, so the hub waits for it to boot, then writes the run mode, the UART output settings and the LEDs and reads the settings again, as it does at boot. All options from Button.
- factory_reset (Optional): Restores the module’s factory settings, then writes the run mode, the UART output settings and the LEDs and reads the settings again, so the settings entities show the factory values. All options from Button.
- query_params (Optional): Reads the versions and the settings that have an entity configured from the module again. Like a change, this stops the radar for a moment. All options from Button.