Friday, December 20, 2024

Wi-Fi Enabled standalone Lidar

EFY Tested DIY

Lidar plays a key role in cartography, mapping, localisation, ADAS, environment scanning, and more. It is widely used in robots, autonomous vehicles, and for intruder monitoring.

However, many systems are wired, making them cumbersome for prototyping and testing, particularly in autonomous driving, where mounting and connecting a lidar can be difficult.

Here, we present a Wi-Fi-enabled standalone lidar that scans and delivers real-time data wirelessly. Simply connect it to a battery, and it is ready to use—no wiring required.

- Advertisement -

POC Video in English

This device enables flexible lidar deployment for mapping, monitoring, and similar tasks. We combined the IndusBoard with a lidar unit to scan surroundings, generate data, and create real-time wireless maps displayed on a web page.

Fig. 1 shows the IndusBoard fixed to the lidar. The components for the project are listed in Table 1. Fig. 2 shows the lidar used during testing.

- Advertisement -
Fixing IndusBoard onto the lidar
Fig. 1: Fixing IndusBoard onto the lidar
YD X2 lidar
Fig. 2: YD X2 lidar
Table 1: Bill of Materials
ComponentsDescriptionQuantity
IndusBoard3cm sized development board1
360-degree lidarYD X2 lidar1
5V batteryPower source1
3.3V voltage regulatorDC-DC 5V to 3.3V regulator1

You can select any lidar model; in this project, we used the YD X2 lidar. According to the datasheet, it can scan 360 degrees and measure up to 8 metres, but other lidars can measure up to 1km. Choose based on your requirements.

Let’s review the lidar datasheet. The YD X2 lidar provides rotation angle and distance data via serial peripherals at a baud rate of 115200. It includes a connector board for USB connection to a PC (see Fig. 3 and Table 2).

Lidar connector pins
Fig. 3: Lidar connector pins (Source: YD X2 lidar datasheet)
Table 2: Pin mapping
PinTypeDescriptionDefaultsRangeRemarks
VCCPower supplyPositive5V4.8V-5.2V/
TxOutputSystem serial port output//Data stream: Lidar to peripherals
GNDPower supplyNegative0V0V/
M_CTRInputMotor speed control terminal1.8V0V-3.3VVoltage speed regulation or PWM speed regulation

As shown in Table 3, the lidar senses distances from 0.12 to 8 metres, scanning 360 degrees at 3000Hz. With this data, we can now connect the lidar to the IndusBoard. You can power both components with a 5V battery or an adaptor.

For a portable solution, use the battery; otherwise, the 5V adaptor works well. Fig. 3 shows the lidar connector pins.

Table 3: Lidar datasheet
ItemMinTypicalMaxUnitRemarks
Ranging frequency/3000/HzRanging 3000 times per second
Motor frequency568HzNeed to connect to PWM signal, recommended to use the speed of 6Hz
Ranging distance0.12/8mIndoor environment with 80% reflectivity
Field of view/0-360/Deg/
Systematic error/2/cmRange≤1m
Relative error/3.5%//1m<Range≤6m
Tilt angle0.2511.75Deg/
Angle resolution0.60 (frequency @5Hz)0.72 (frequency @6Hz)0.96 (frequency @8Hz)DegDifferent motor frequency
Note: (1) It is factory FQC standard value, 80% reflectivity material object. (2) The relative error value indicates the accuracy of the lidar measurement.

Circuit Diagram

Fig. 4 shows the circuit diagram for the IndusBoard based standalone IoT lidar radar. The device is powered by a 5V battery, with the lidar controlled via PWM signals through the RX pin. Output is sent to the serial port.

IoT Lidar Radar Circuit
Fig. 4: Circuit diagram

Software

Depending on the lidar version, you can use the appropriate Arduino library. Here, a library compatible with the YD X2 lidar to retrieve data was utilised.

First, configure the Wi-Fi SSID and password in the code. You can connect the lidar to an existing Wi-Fi network or set it as a Wi-Fi access point (AP). In this project, we set the lidar as an AP. Fig. 5 shows the code snippet for configuring the AP.

configuring AP SSID and password
Fig. 5: Code snippet for configuring the AP SSID and password

Next, define the serial pins, ports, and PWM motor control pin in the code. Write the web page using HTML, CSS, and JavaScript to display the map and data in real time over Wi-Fi. Fig. 6 shows the web page’s code snippet.

IoT Lidar Radar Code
Fig. 6: Web page’s code snippet

Construction and Testing

After uploading the source code, complete the wiring as per Fig. 4. Connect the lidar motor control pin to any PWM-enabled pin on the IndusBoard. The serial data pin can also be connected to any pin, but in this case, RX pin 43 was used.

Lidar pin connection and lidar connector
Fig. 7: Lidar pin connection and lidar connector
Lidar pin USB connector module marked with pin numbers
Fig. 8: Lidar pin USB connector module marked with pin numbers

For testing, connect the lidar’s connector either via a header pin or by soldering directly to the board. Mount the IndusBoard and lidar as shown in Fig. 7. The IndusBoard, being small enough, fits behind the lidar. Fig. 8 shows the lidar pin USB connector module, with pin numbers marked.

Standalone IoT based Lidar Radar Data
Fig. 9: Lidar scan data

After assembly, power on the lidar and establish a Wi-Fi connection. Open a web browser and navigate to the IndusBoard’s default IP address: 192.168.4.1. The web page will display the real-time map and provide distance and angle data. Fig. 9 shows the lidar scan data plotted on the web page.


Ashwini Kumar Sinha, an IoT and AI enthusiast, is a tech journalist at EFY

Ashwini Sinha
Ashwini Sinha
A tech journalist at EFY, with hands-on expertise in electronics DIY. He has an extraordinary passion for AI, IoT, and electronics. Holder of two design records and two times winner of US-China Makers Award.

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Truly Innovative Electronics

Electronics News

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics