nanoFramework.Iot.Device.Ld2410 1.0.413

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Ld2410 --version 1.0.413
                    
NuGet\Install-Package nanoFramework.Iot.Device.Ld2410 -Version 1.0.413
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Ld2410" Version="1.0.413" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Ld2410" Version="1.0.413" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Ld2410" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.Ld2410 --version 1.0.413
                    
#r "nuget: nanoFramework.Iot.Device.Ld2410, 1.0.413"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package nanoFramework.Iot.Device.Ld2410@1.0.413
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.Ld2410&version=1.0.413
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Ld2410&version=1.0.413
                    
Install as a Cake Tool

HLK-LD2410 24Ghz Human Presence Radar Sensor Module

Documentation


Radar Module


Usage

Initialize the radar module:

var radar = new Radar("COM2");
radar.OnMeasurementReceived += OnMeasurement;
radar.Connect();

The OnMeasurement event handler is responsible for receiving measurement reports from the radar. The report object instance contains distance and energy measurements for targets within the detection range of the radar.

An example on how to print out some of this data to the console through the event handler:

private static void OnMeasurement(object sender, ReportFrame e)
{
    if (e is EngineeringModeReportFrame engineeringModeReportFrame)
    {
        Debug.WriteLine($"Target State (Engineering Mode): {engineeringModeReportFrame.TargetState} | Movement Target Distance (CM): {engineeringModeReportFrame.MovementTargetDistance.Centimeters} | " +
            $"Movement Target Energy: {engineeringModeReportFrame.MovementTargetEnergy} | Stationary Target Distance (CM): {engineeringModeReportFrame.StationaryTargetDistance.Centimeters} | " +
            $"Stationary Target Energy: {engineeringModeReportFrame.StationaryTargetEnergy} | Detection Distance (CM): {engineeringModeReportFrame.DetectionDistance.Centimeters}");

        var gateNumber = 0;
        foreach (var gate in engineeringModeReportFrame.GateData)
        {
            Debug.WriteLine($"Gate: {gateNumber} - Movement Energy: {gate.MovementEnergy} - Static Energy: {gate.StaticEnergy}");
            gateNumber++;
        }
    }
    else if (e is BasicReportFrame basicReportFrame)
    {
        Debug.WriteLine($"Target State: {basicReportFrame.TargetState} | Movement Target Distance (CM): {basicReportFrame.MovementTargetDistance.Centimeters} | " +
            $"Movement Target Energy: {basicReportFrame.MovementTargetEnergy} | Stationary Target Distance (CM): {basicReportFrame.StationaryTargetDistance.Centimeters} | " +
            $"Stationary Target Energy: {basicReportFrame.StationaryTargetEnergy} | Detection Distance (CM): {basicReportFrame.DetectionDistance.Centimeters}");
    }
}

Calling Connect() on an instance of the radar object will initialize a new SerialPort (or use the SerialPort instance passed to the Radar constructor) and open a serial connection with the radar module. The radar will immediately start reporting measurements which are received in the event handler detailed above.

Issuing commands to the radar to read or change configurations requires the radar to be put into Configuration mode. This can be achieved by calling Radar.EnterConfigurationMode(). The following example shows how to enable the engineering mode on the radar to receive target energy levels at every supported distance gate:

radar.EnterConfigurationMode();
radar.SetEngineeringMode(true);
radar.ExitConfigurationMode();

Additionally, when Radar.Connect() is executed successfully, the Radar class will read the current configurations stored on the module. This data will be available through Radar.Configuration and Radar.FirmwareVersion.

To change the configuration on the radar, make the changes directly to Radar.Configuration and then call Radar.CommitConfigurations() to store them on the radar module.

The radar module can be restored to factory settings using Radar.RestoreFactorySettings() and restarted (power-cycled) using Radar.Restart().

For more information on what this radar can do, please refer to the documentation listed above.

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.480 105 7/28/2025
1.0.471 205 4/24/2025
1.0.460 205 4/2/2025
1.0.455 186 4/2/2025
1.0.443 218 3/11/2025
1.0.437 210 3/10/2025
1.0.429 150 3/3/2025
1.0.413 149 2/26/2025
1.0.381 131 2/5/2025
1.0.366 139 2/4/2025
1.0.363 152 2/4/2025
1.0.346 147 1/31/2025
1.0.334 134 1/20/2025
1.0.328 99 1/13/2025
1.0.320 108 1/8/2025
1.0.309 143 12/30/2024
1.0.295 159 12/18/2024
1.0.287 136 12/16/2024
1.0.283 147 12/11/2024
1.0.264 155 10/23/2024
1.0.247 145 10/3/2024
1.0.230 158 9/6/2024
1.0.222 149 8/28/2024
1.0.204 182 8/9/2024
1.0.192 133 7/26/2024
1.0.181 164 7/17/2024
1.0.164 172 6/19/2024
1.0.161 164 6/14/2024
1.0.139 150 5/15/2024
1.0.127 174 4/15/2024
1.0.105 173 3/22/2024
1.0.85 165 2/28/2024
1.0.65 186 1/24/2024
1.0.53 209 1/5/2024
1.0.49 195 12/20/2023
1.0.27 191 11/10/2023
1.0.7 142 11/8/2023
1.0.2 164 11/1/2023