Handheld XV-11 LIDAR with STM32F429 and MATLAB
Throughout the years though Vacuum Clearner robots have evolved a lot, both in the algorithms gettings better but also in the use of more advanced sensors. Lately the Neato XV-11 All Floor Robotic Vacuum System included a small range (0.2m to 6m) LIDAR with 1 degree precision and a resolution of a couple of centimeters. As this vacuum cleaner only costs around $400 makes it a bargain to get hold of a LIDAR if just you could disassemble the robot and use just the LIDAR.
Luckily for us there was put up a bounty for people “hacking” the XV-11 LIDAR and a new hacking community had begun: http://xv11hacking.wikispaces.com/LIDAR+Sensor
When spinning the XV-11 LIDAR unit itself spits out quite a lot of data on a UART port at 115200 baud. A full rotation, meaning 360 distance measurements, consists of 1980 bytes and is sent out with a refresh rate of 5 Hz. So it’s quite an amount of data is required to be processed in a relatively short amount of time.
Compared to the more expensive LIDAR sensors on the market you will for sure not get same resolution and accuracy with the XV-11 LIDAR, though for hobby and lower cost research this LIDAR will do you just fine.
We purchased one of the XV-11 LIDAR units on eBay, sold as a “replacement unit” for the Neato vacuum cleaner. This was only $100 so quite a good deal for us.
We decided to connect the LIDAR to our STM32F429IDISCOVERY board for processing and display, due to the heavy amount of transmitted data and the use of the built-in Touch Display for display of the distance measurements.
Below you will find a video of the project in action.
The source code for the STM32, including the CoIDE project and of course the MATLAB script for display, can be found at our GitHub at: https://www.github.com/TKJElectronics/XV11Lidar_STM32F429
As many have been requesting a very exact description of the connection layout I will here try to explain it in three simple lines, as the connection is very simply.
The XV-11 LIDAR unit contains two cables, one with 2 wires defined as the MOTOR CABLE and one with 4 defined as the DATA CABLE.
- The RED wire in the MOTOR CABLE should be connected to 3.3V for free running (open loop). Otherwise this should be pulsed with 12V.
- The BLACK wire in the MOTOR CABLE should be connected to ground.
- The RED wire in the DATA CABLE should be connected to 5V or 3.3V. Usually it is 5V in most of the units you can find on the market.
- The BLACK wire in the DATA CABLE should be connected to ground.
- The BROWN wire in the DATA CABLE should be connected to GPIOC.10 on the STM32F4 board, as this is the LIDAR RX being connected to the STM32F4 UART TX.
- The ORANGE wire in the DATA CABLE should be connected to GPIOC.11 on the STM32F4 board, as this is the LIDAR TX being connected to the STM32F4 UART RX.
I hope this clears up all the connection questions.
The next steps of this project is to implement and use the XV-11 sensor on either the Balanduino or an Omniwheel robot
Finally the very future plans is to use the LIDAR coupled together with an Optical Flow Sensor on our Quadcopters to make them completely autonomous:
IMU+GPS+Optical Flow+LIDAR = Autonomous navigation in unknown environments