The CJMCU-530 is a breakout module featuring the VL53L0X by ST Microelectronics which is a laser-ranging sensor for distances of up to 200cm. The module works without problems with the ESP8266 which makes it an interesting option for your next IoT project.
Getting Started
This module has much more features than what I will describe here. I will just show how to connect the module to your ESP8266, which library to install and how to run your first measurements within minutes.
- Use four wires to connect the following pins:
- GND with GND
- VCC with V3V
- SLC with D5
- SDA with D6
- Open your Arduino IDE and install the following library from Sketch > Include Library > Manage Libraries: VL53L0X by Polulu
- Select from File > Examples > VL53L0X > Single the Example sketch and change the following line
Wire.begin();
into
Wire.begin(D6, D5);
- Compile your sketch, upload it to the ESP8266 and open the serial console. If everything went well you should see now the millimeters of distance measured by the laser-ranging sensor.
Pitfalls
At first my measurements were really inaccurate and I was disappointed that the values were always off by about 20mm! Then I searched the web and found out that often the sensor is covered by a protection. Remove this protection to get very precise measurements
Accuracy
After removing the protection the measurements were really good. I just tested values below 30cm and the were within 1mm accuracy. This might be a good option for a robotics project to apply SLAM.
Where to buy?
As always I bought this module from my preferred Online Shop: Banggood. With around USD $12.30 it is more expensive than the RCW-0001 but the accuracy is also a lot better.
Summary
The CJMCU-530 is a affordable and accurate laser-based range sensor. The break-out board offers many features (which I haven’t tested yet) but it is always promising to have more features to test after the initial run. Compatibility with the ESP8266 is good and you just need to change one line in the sample code to get it running with our preferred WiFi chip.
Excellent! This is the first post I’ve been able to find about coding for the CJMCU version of VL53V0X. I’m still having trouble tough… Wire.begin(D6, D5) gives me an error as D6 and D5 are not defined within the scope. Is there something else you did to get this running?