This article explores how cost-effective 24GHz presence sensors can be integrated into the decentralized MeshCore mesh network. The objective is to create a system for off-grid communication and monitoring, which can be used, for example, for motion detection in remote areas.
The experiments are based on commercially available 24GHz radar sensors of type LD2410S, which can be sourced from platforms like AliExpress.
Hardware Connection
A Heltec StickLite development board was used for these experiments. Although it is an older model, it is more than adequate for this purpose. However, the underlying code example is flexible and can be adapted to any of the over 100 boards currently supported by MeshCore.
Wiring the LD2410S sensor to the main board is straightforward. Only four connections are required:
Sensor -> Main board
3V3-> any of the 3.3V power pinsGND-> any of the GND pinsOT1-> SerialRXRX-> SerialTX
OT2 pin of the sensor can be connected to a digital input pin on the main board. This can be used as an interrupt for a "wake-up" function to save power in sleep mode.
Firmware Implementation
Integrating specific sensors requires firmware customization. Since the variety of sensors and their behaviors is too vast to offer a universal firmware, dedicated programming is necessary.
To simplify this process, the MeshCore project provides a simple_sensor sketch as a template. For the LD2410S motion sensor, a prepared implementation is already available in a separate repository.
To use this code, clone the repository:
Then, check out the dev branch and open the project in Visual Studio Code with the PlatformIO extension installed. The specific target build is configured for Heltec_StickLite_Sensor.
A detailed overview of the changes (diffs/commits) for this motion sensor code is available at the following link: https://github.com/meshcore-dev/MeshCore/compare/dev...ripplebiz:MeshCore-sensor-playground:dev
The implementation includes a custom MotionSensorManager class, which encapsulates all management of the LD2410S sensor. The querySensors() method collects three telemetry values:
These values are transmitted over the MeshCore network in addition to the board's battery voltage.

Alert Functions
The example firmware also generates alerts when the sensor is "armed" and isMotionDetected() is true. This is implemented in the main.cpp module under /examples/simple_sensor/:
These alerts are managed by the underlying SensorMesh class. It is responsible for dispatching a MeshCore text DM (Direct Message) to all registered users in the ACL (Access Control List) who are subscribed to alerts. Users logging in with the admin password automatically receive this ACL permission.
Recipients will then see an unread message counter and, if configured, receive an alert sound.

As a visual cue, the Ripple firmware (a specific MeshCore firmware variant) renders the Home grid cell with an orange border when the sensor is in the "armed" state, allowing for a quick overview of the sensor status. Additionally, the last telemetry value (in this case, the distance value) is displayed in the cell.
Arming and Disarming the Sensor
The example firmware extends the CLI (Command Line Interface) with specific commands to arm (arm) and disarm (disarm) the sensor. These commands are also handled in the main.cpp module:
Conclusion
This type of node with an integrated motion sensor represents a valuable addition to the MeshCore ecosystem. The ability to operate these sensors in weatherproof enclosures with solar panels opens up numerous applications, such as intruder detection in remote areas. Thanks to MeshCore's open-source approach, further customizations and extensions are flexibly implementable.
