yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
SDM18 Laser Ranging Module📖
Module Introduction
  • Module Introduction
1.Preparation before use
  • Preparation before use
2.Get distance information_Linux
  • Get distance information_Linux
3.Get distance information_ROS
  • Get distance information_ROS
4.Multiple master control tutorials
  • 1.Get distance information_MSPM0
  • 2.Get distance information_ESP32
  • 3.Get distance information_Jetson
  • 4.Get distance information_Raspberry Pi
  • 5.Get distance information_RDK
  • 6.Get distance information_STM32
  • 7.Get distance information_MSPM03519new
Download
  • Code
  • DataSheet
  • 3D_Model_File
  • PC_Software
Download ZIP

Welcome to SDM18 Laser Ranging Module repository

6.Get distance information_STM32

4.Get distance information_STM32

4.Get distance information_STM320. SDM18 brief introduction1. Experimental preparation2. Experimental wiring3.Experimental steps4.experimental result 5.Explanation of some important parameters and default values of SDM18

0. SDM18 brief introduction

  • YDLIDAR SDM18 LiDAR is a high-performance single point LiDAR (hereinafter referred to as SDM18). This product is based on the principle of time-of-flight distance measurement and is designed with relevant optics, electronics, and algorithms to achieve high-precision laser distance measurement and output high frame rate point cloud data.
  • Product features ➢ High ranging frequency, high internal sampling rate combined with filtering algorithm, data has high stability ➢ Long detection distance, up to 18 meters ➢ Lightweight, approximately 1.35g ➢ Laser power meets FDA Class I safety standards

 

1. Experimental preparation

  • SDM18 laser ranging module
  • The STM32F103C8T6 experiment in this tutorial for the stm32F1 series

2. Experimental wiring

STM32SDM18
PA3TX
PA2RX
GNDGND
3.3V3.3V

The wiring diagram is shown in the figure image-2024032800002

image-2024032800003

STM32USB to TTL module (no need to purchase it yourself)
RXTX
TXRX
GNDGND
3.3V3.3V
usart1 Function: Communicate with the computer - output the receiving radar's ranging distance, signal strength, and baud rate of 115200 
The PA9 of STM32 is connected to the RXD of the USB to TTL module 
The PA10 of STM32 is connected to the TXD of the USB to TTL module 
GND of STM32 to USB to TTL module 
VCC can be disconnected 

3.Experimental steps

  1. Download the program provided by the routine to stm32
  2. Open the serial assistant and set the baud rate to 115200

4.experimental result

After connecting the wires, under normal communication, the serial assistant can print out the distance measurement information obtained, as shown in the figure image-2024032800001

  • dis:distance In millimeters
  • strength:strength

 

5.Explanation of some important parameters and default values of SDM18

  1. The SDM18 interface is shown in the figure: image-2024032800004
  2. Serial port default configuration SDM18 The default baud rate is 921600 image-2024033800005
  3. Important protocol commands based on serial port (all sent in hexadecimal format) The default mode for powering on SDM18 is idle mode. If you want to perform ranging, you need to start the ranging command first
  • Start ranging:A5 03 20 01 00 00 00 02 6E
  • Stop ranging: A5 03 20 02 00 00 00 46 6E
  • Protocol Analysis for Receiving Distance Measurement
headerEquipment numberEquipment typeCommand typereservedData lengthData segmentVerification code
1 Byte1 Byte1 Byte1 Byte1 Byte2 BytesN Bytes2 Bytes
➢ Packet header: The packet header flag of SDM18 is 0xA5;       
➢ Device number: The message device number flag for SDM18 is 0x03;       
➢ Equipment type: determined by the type of lower computer evaluation board, 0x20;       
➢ Command type: System command code, as shown in Development manual;       
➢ Reserved space: reserved status space for future use;       
➢ Data length: represents the length of response data;       
➢ Data segment: response content under different system commands, feedback of different data content, and their data formats are also different;       
➢ Verification code: The CRC16 verification result of all data, except for the verification code.       

eg: |header| Equipment type| Data length| Data segment| Verification code| |0xA5| 0x03| 0x20| 0x00 0E| ‥‥ |CRC16| Set the response content as:A5 03 20 01 00 00 0E FF FF FF FF FF FF F6 06 42 00 74 26 01 00 0B (transmission mode LSB)

  • Data length = 0x00 0E,The number of bytes in the data segment is 14;
  • Then the data segment is FF FF FF FF FF FF F6 06 42 00 74 26 01 00.
  • 6bit-7bit:Representing distance (F6 06:distance: 0x06F6 = 1782mm)
  • 10bit-11bit:strength (74 26:strength: 0x2674 = 9844)
  1. Calculation of checksum Is this checksum calculated using the CRC-16 modelbus method, which calculates all bytes except for the checksum bit The following figure shows the checksum calculation result of the command Start ranging image-2024033800008

Other protocols will not be explained anymore. Interested parties can refer to the SDM18 development manual

Get distance information_RDK
Get distance information_MSPM03519

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文