In this tutorial we will learn how to make a RADAR Lidar System using VL53L0X Laser Time-of-Flight sensor.
Watch the video!
Step 1: What You Will Need
- Arduino UNO (or any other Arduino)
- VL53L0X Laser Time-of-Flight sensor
- OLED Display
- Servo motor
- Breadboard
- Jumper wires
- Visuino program: Download Visuino
Step 2: The Circuit
- Connect OLED Display pin[VCC] to Arduino pin[5V]
- Connect OLED Display pin[GND] to Arduino pin[GND]
- Connect OLED Display pin[SDA] to Arduino pin[SDA]
- Connect OLED Display pin[SCL] to Arduino pin[SCL]
- Connect TimeOfFlight Sensor pin[VCC] to Arduino pin[3.3V]
- Connect TimeOfFlight Sensor pin[GND] to Arduino pin[GND]
- Connect TimeOfFlight Sensor pin[SDA] to Arduino pin[SDA]
- Connect TimeOfFlight Sensor pin[SCL] to Arduino pin[SCL]
- Connect Servo motor “Orange” pin to Arduino Digital pin[7]
- Connect Servo motor “Red” pin to Arduino positive pin[5V]
- Connect Servo motor “Brown” pin to Arduino negative pin[GND]
Attach TimeOfFlight Sensor with a duct tape to the servo motor.
Step 3: Start Visuino, and Select the Arduino UNO Board Type
The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.
Start Visuino as shown in the first picture Click on the “Tools” button on the Arduino component (Picture 1) in Visuino When the dialog appears, select “Arduino UNO” as shown on Picture 2
Step 4: In Visuino Add Components
- Add “Time Of Flight Laser Ranger VL53L0X’ component
- Add “Divide Analog By Value’ component
- Add “Analog To Unsigned’ component
- Add “SSD1306/SH1106 OLED Display (I2C)’ component
- Add “Clock Generator” component
- Add “Triangle Analog Generator’ component
- Add “Clock Generator” component
- Add 2X “Compare Analog Value” component
- Add “Map Range Analog” component
- Add “Servo” component
- Add “Inverse Analog (Change Sign)” component
- Add “Analog Multi Source” component
Step 5: In Visuino Set Components
- Select “DivideByValue1” and in the properties window set Value to 2
- Select “ClockGenerator1” and in the properties window set Frequency to 5
- Select “TriangleAnalogGenerator1” and in the properties window set Frequency to 0.1
- Select “CompareValue1” and in the properties window set Compare Type to “ctBiggerOrEqual” and Value to 0.98
- Select “CompareValue2” and in the properties window set Compare Type to “ctSmallerOrEqual” and Value to 0.02
- Select “MapRange1” and in the properties window set “Output Range” > “Max” to 180
- Double click on the DisplayOLED1 and in the Elements window
- Drag “Draw Angled Line” to the left
- In the properties window set “Angle” to -10, “End” to 60, “X” to 64, “Y”to 63
- Click on the “Angle” pin icon and select “FloatSinkPin”
- Click on the “End” pin icon and select “IntegerSinkPin”
- Drag “Fill Screen” to the left side in the elements window
- Close the Elements window
Step 6: In Visuino Connect Components
Connect LaserRanger1 pin Sensor I2C to arduino board pin I2C In
Connect DisplayOLED1 pin I2C Out to arduino board pin I2C In
- Connect LaserRanger1 pin Distance (mm) to DivideByValue1 pin In
- Connect DivideByValue1 pin Out to AnalogToUnsigned1 pin In
- Connect AnalogToUnsigned1 pin Out to DisplayOLED1>Draw Angled Line1 pin End
- Connect ClockGenerator1 pin Out to TriangleAnalogGenerator1 pin Clock
- Connect TriangleAnalogGenerator1 pin Out to CompareValue1 and CompareValue2 pin In
- Connect TriangleAnalogGenerator1 pin Out to MapRange1 and Servo1 pin In
- Connect CompareValue1 and CompareValue2 pin Out to DisplayOLED1>Fill Screen1 pin Clock
- Connect MapRange1 pin Out to AnalogMultiSource1 pin In
- Connect Servo1 pin Out to Arduino digital pin 7
- Connect AnalogMultiSource1 pin [0] to Inverse1 pin In
- Connect AnalogMultiSource1 pin [1] to DisplayOLED1>Draw Angled Line1 pin Clock
- Connect Inverse1 pin Out to DisplayOLED1>Draw Angled Line1 pin Angle
Step 7: Generate, Compile, and Upload the Arduino Code
In Visuino, at the bottom click on the “Build” Tab, make sure the correct port is selected, then click on the “Compile/Build and Upload” button.
Step 8: Play
If you power the Arduino UNO module, the OLED Display will start to show the Radar distance and the servo motor will turn left and right.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.eu
Download Radar-laser1.zip