GithubHelp home page GithubHelp logo

csron / hlk-ld2410b Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 5.82 MB

Python Serial Protocol Implementation and Demo of HLK-LD2410B 24 GHz Radar Sensor

Python 100.00%
radar serial-communication hlk-ld2410

hlk-ld2410b's Introduction

HLK-LD2410B Python Demo

This is a simple Python demo for HLK-LD2410B 24 GHz Radar Sensor (http://www.hlktech.net/index.php?id=1183). You can also try the app from HLK or the official PC demo. This code uses the serial port to communicate with the sensor.

Prerequisites

You need the following hardware to run this demo:

  • Linux PC (tested with Ubuntu 22.04)
  • HLK-LD2410B 24 GHz Radar Sensor
  • USB to TTL Adapter
  • 1.5 mm 5-pin cable

Connect the sensor to the USB to TTL adapter:

  • GND to GND
  • 5V to 5V
  • RX to TX
  • TX to RX

Install the required packages:

pip3 install -r  requirements.txt

Get started

read_serial.py prints out the received data from the sensor (x, y, speed, distance resolution) of three targets:

python3 print_targets.py

Serial Demo

plot_targets.py plots the received data from the sensor (x, y) of three targets:

python3 plot_targets.py

Distance Demo

Troubleshooting

  • Check that the USB to TTL adapter is connected to the correct port:
dmesg | grep tty

Notes and Disclaimer

  • Currently only the serial protocol for basic mode is implemented and not the engineering mode.
  • Not all commands of of the documentation are implemented yet (2.2.3, 2.2.4, 2.2.7, 2.2.8, 2.2.9, 2.2.10, 2.2.11, 2.2.12 and 2.2.13 are missing)
  • Not all messages are received properly via UART. The most significant bit (MSB) is sometimes often set to 1 (e.g. 0x80 instead of 0x00). This is not handled in this implementation and can lead to wrong results or wrongly interpreted responses.
  • There seems to be some outliers in the data which are not filtered in this implementation

hlk-ld2410b's People

Contributors

csron avatar

Stargazers

Gerad Munsch avatar  avatar Jim avatar

Watchers

Gerad Munsch avatar Jim avatar  avatar

Forkers

jimzgchow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.