LD2410 Interface for Python
More documentation coming soon. In the meantime, you can read example.py to figure out how to use the module
A python interface to control and get data from a Hi-Link LD2410 module over a serial connection
How to install
Run pip install LD2410 using your package manager of choice
Usage Instructions
An example of how to get full data from the module
from LD2410 import *
import time
radar = LD2410(port="/dev/ttyUSB0") # Replace <port> with your serial port. e.g "COM3" or "/dev/ttyS0" etc.
radar.enable_engineering_mode() # Enable engineering mode to get full data
# You must call call start() before getting data, or you get nothing
radar.start() # Start the radar module
# Get 60 data frames
for _ in range(60):
print(radar.get_data())
time.sleep(1) # Radar module will keep running in the background, but we only retrieve the latest data every 1 second
radar.stop()
How to get the data
Use radar.get_data()
It returns the following:
In standard mode:
([Detection Type, Movement Gate Detection Dist, Movement Gate Energy, Static Gate Detection Dist, Static Gate Energy, Detection Dist], None, None)
| Detection Type | |
|---|---|
| 0 | No Target |
| 1 | Moving Target |
| 2 | Static Target |
| 3 | Moving and Static Targets |
Movement Gate Detection Dist: The distance of the detected moving target from the sensor
Movement Gate Energy: The "energy" level of the detected moving target
Static Gate Detection Dist: The distance of the detected static target from the sensor
Static Gate Energy: The "energy" level of the detected static target
What is a gate? * A Gate is a region of N * 75 to (N + 1 * 75) cm region from the sensor. For example, Gate 2 refers to a region between 1.5m and 2.25m away from the sensor
In engineering mode:
([Same as above], [Moving gate 0 energy...Moving Gate 8 Energy], [Static gate 0 energy...Static Gate 8 Energy])
Moving gate 0 energy...Moving Gate 8 Energy: Get the energy levels of each gate returned as a list of integers
Static gate 0 energy...Static Gate 8 Energy: Get the energy levels of each gate returned as a list of integers
Todo
-
Expand on how to set params
-
Expand on how to change sensitivities
If you are determined to use this module, check out example.py for a more indepth example of how to use this module
Metadata
Release files for LD2410 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ld2410-1.1.1.tar.gz | 7.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ld2410-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.4 kB
Release files / ld2410-1.1.1.tar.gz
| Download URL | ld2410-1.1.1.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b27c35d120c8d0bf907eb91d0171bce620a335cb251f9aa75f7cb0efb013761
|
|
BLAKE2b-256 checksum How to use checksums |
90c74aae9fb346c52b465df52a04e1c1ed60c7cadc9503e4b4186c11f2809594
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Release files / ld2410-1.1.1-py3-none-any.whl
| Download URL | ld2410-1.1.1-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19856fd3aa31846bced17869d206fa1dfff2b30be1eb8a9024cbe9020ecbf72a
|
|
BLAKE2b-256 checksum How to use checksums |
a4ed9894a0da53c87c00704f9fbb18eb72063329fa7e14ade080ffc3a07e9481
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Security for LD2410 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.