A python interface for the HiLink LD2410 presence detection module
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ld2410-1.1.1.tar.gz.
File metadata
- Download URL: ld2410-1.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b27c35d120c8d0bf907eb91d0171bce620a335cb251f9aa75f7cb0efb013761
|
|
| MD5 |
7b383d70999cad0adfeddbab84910541
|
|
| BLAKE2b-256 |
90c74aae9fb346c52b465df52a04e1c1ed60c7cadc9503e4b4186c11f2809594
|
File details
Details for the file ld2410-1.1.1-py3-none-any.whl.
File metadata
- Download URL: ld2410-1.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19856fd3aa31846bced17869d206fa1dfff2b30be1eb8a9024cbe9020ecbf72a
|
|
| MD5 |
529fa14cd30c6b0c70be8bab99a5d321
|
|
| BLAKE2b-256 |
a4ed9894a0da53c87c00704f9fbb18eb72063329fa7e14ade080ffc3a07e9481
|