When I am building a biped robot, I was always thinking of having some sort of cool gadget that can trace my opponent and do attack moves with it. Bunches of radar/lidar projects already exist here. However, there are some limitations for my purpose:

After searching, this tiny sensor VL53L0X from ST splashed into my eyes. By claiming "World Smallest" time-of-flight ranging sensor, the dimension is only 4.4 x 2.4 x 1.0 mm. Featuring 

All these special features combined enabled me to overcome the problems above, if an array of VL53L0X sensors could work. Originally, I thought this radar would be called solid state radar, but found out that this term was used for something else. Therefore the "Stationary" word in the title means that there are no moving parts in this radar gadget. Also, while LIDAR (light detection and ranging) is the technically correct term for this chip, RADAR is referred here as a more generic term. 

The reason why Programmable I2C address and GPIO output pin are critical to this project is explained later.

Tools

The following tools are required in this project:

Parts

The following parts are used in this project:

Breakout board

The VL53L0X breakout board I used is GY-530. There are also Adafruit version and Pololu version available. If feasible, I do recommend using Adafruit or Pololu's product because they make great products, great tutorials, and great software libraries. I tested on Adafruit's VL53L0X library and used a modified version of Pololu's VL53L0X library

Dupont connectors

The dupont connectors are used for the breadboard. You may use any other types of connection you have in hand.

Screws and 3D Printed Parts

The M2 screws, holders and circular frame are used to place the sensors in a circular arrangement. You may use any other methods, such as using card boards, model woods, clay, or even hot glue them on a can.

Cone of Detection

I used a single module to draw the cone of detection. Using a mostly 3D printed robot as the target. The distance are shown on the led display, and measured roughly. The measured data is recorded into an Microsoft Excel file, and used the curve fitting function. The best fit is a natural logarithm curve, with effective distance from 3 cm to approximately 100 cm. 

At 60 cm, the detection curve for a single sensor is about 22cm. With a 20 cm wide target, a circular separation of 10~15 degrees for the radar array should yield an acceptable scanning resolution. 

I2C Address

While the VL53L0X I2C device address is programmable, full control of the XSHUT pin by the micro-controller is required. The sequence to do so is:

  1. Power is applied to AVDD. 
  2. All VL53L0X chips are brought to Hw Standby (reset) state by driving ALL their XSHUT pins to LOW. 
  3. Each chip is taken out of reset state one at a time. The default I2C address after booting is 0x52. 
  4. The chip address is changed to a new address through a I2C command. For example, 0x52 changed to 0x53. 
  5. Repeat step 3 and 4 for all chips.

Theoretically, maximum 126 units can be drove in the same bus for the 7-bit address range. However, in practical, bus capacitance and sinking current limitation of the micro-controller may/should limit the maximum device number. 

The new I2C address is not stored in the VL53L0X chip against power down or reset. Thus this process has to be done once upon every power up. This means one precious pin is required for every unit in the radar array. This is way too unfriendly to wiring and pin-consumption, for a radar belt with 10+ or 20+ units. 

As mention in STEP1, it is lucky that there is a GPIO1 pin on VL53L0X chip, originally used for interrupt, can do the job. 

GPIO-XSHUTN daisy chain

The GPIO output is in high impedance state upon booting and open drain to low while active. The GPIO and XSHUT pins are pulled high to AVDD on the GY-530 breakout board, as recommended in the datasheet. To reliably put all VL53L0X chips into Hw Standby state (driving XSHUT low), we need a logic NOT gate (inverter) for every XSHUT pin. Then we connect the GPIO output of one chip (the Nth chip), to the XSHUTN (XSHUT-NOT) of the downstream chip(the N+1 chip). 

Upon power on, all GPIO pins (inactive) are pulled up, all subsequent XSHUT pins are drove low by the NOT gate (except the very fist chip where its XSHUTN pin is connected to the micro-controller). The I2C address change and XSHUT release of the downstream chip is done in software, one by one.

If you are using different breakout boards, you need to make sure if the pull-up resistors are in place or not, and make appropriate adjustments.

Adding a LED

In the next step, a small 0805 SMD LED will be added to the breakout board, connected from the XSHUT pad to the GND terminal of an adjacent capacitor. Although LED itself does not affect the operation of the module, it does give us a good visual indication on the XSHUT logic level. 

Hooking the LED in series with the pull-up resistor (10k in my case) on the XSHUT pin will introduce a voltage drop. Instead of high logic level of 3.3v, the forward voltage drop for a red 0805 LED is measured 1.6v. Although this voltage is higher than the high logic level (1.12v) in datasheet, blue LED is better for this hack. The forward voltage drop for blue LED is measured about 2.4v, which is safely above the chip's logic level.

Adding the N-MOS Inverter (Logic NOT Gate)

A small SOT-23 N-channel MOSFET is stacked on the LED we have added. Two terminals (D, S) need to be soldered on the breakout board, and the remaining terminal (G) is connected to the upstream board GPIO pin using #26 wire. 

Notes on Adding SMD Components

Soldering SMD components on a breakout board not designed for, is not a easy task. If you haven't heard of 0805, SMD, SOT-23 yet, the chances are that you haven't solder those tiny little components before. While handling those tiny components by hand, it is very common that:

If you still want to make this radar, you can:

Soldering the 0805 SMD LED

Soldering a 0805 LED by hand, on a breakout board not designed for SMD, is not an easy task at all. The following steps is my recommendation to solder the LED.

  1. Use the helper hand to hold your breakout board. 
  2. Put some soldering paste on the edge of the SMD capacitor and the "XSHUT" pad. 
  3. Use the soldering iron to put some additional solder on the capacitor edge. 
  4. Put some soldering paste on both ends of the 0805 LED. 
  5. Use the soldering iron to put some tin on both ends of the 0805 LED. 
  6. Use the tweezers to place the LED as shown in the photo.The cathode end normally has a marked line. In my example, there is a green line on the cathode end. Place the cathode end to the capacitor end. 
  7. Use the tweezers to add light pressure on the LED towards the capacitor, and solder the LED to the capacitor end, by adding heat to the capacitor end at the same time. Do not press to hard on the LED. Its cover may break under heat and excessive pressure. After soldering, add gentle pressure on the LED sideways, to test if the LED is soldered in place. 
  8. Now solder the LED at the XSHUT dip pad. This step should be easier.

Note: The capacitor end shown in the picture is the ground terminal on this breakout board. And the dip pad XSHUT is pulled-up by a resistor.

Testing the LED

The LED should light up when you apply power (e.x. 5V) and ground to the breakout board.

Soldering the AO3400 N-Channel MOSFET

This MOSFET is in SOT-23 package. We need to "stack" it on the LED, and add a wire as well:

  1. Put some soldering paste and tin all three terminals. 
  2. Use tweezers to place the MOSFET on top of the 0805 LED. The S terminal should touch the top of the capacitor 
  3. Solder the S terminal with the capacitor end, as shown in the photo. 
  4. Cut a small section AWG #30 single core wire, and remove the coating about 1cm. 
  5. Use the soldering iron to melt the solder in the XSHUT hole from below, and insert the #30 wire from above, as shown in the photo. 
  6. Soldering the upper end of the wire to the MOSFET D terminal. 
  7. Cut off extra wire.

Note: The MOSFET S terminal is connected to the capacitor end as shown in the picture. This end is the ground terminal. The MOSFET D terminal is connected to the original XSHUT pin.

Terminal G is not connected at this moment. Its position is just above some pull-up resistors. Make sure there is a gap between them (N-MOS and resistor) and does not contact with each other.

Common Bus Wiring

Common bus includes:

These four lines are common lines. Cut appropriate length of wires and soldering them in parallel, to all sensor modules. I used 20 cm from arduino to the first sensor, and 5 cm each thereafter. 

XSHUTN and GPIO Wiring

The 20 cm white wire is from arduino control pin, to the XSHUTN pin of the first sensor. This is the control line required to bring the first VL53L0X chip out of reset and change the I2C address. 

The 5 cm white wire between each module is the daisy chain control line. The upstream chip (for example, chip #3) GPIO pad, is connected to the downstream (for example, chip #4) XSHUTN leg (N-Channel MOSFET G terminal).

Be careful not to make the G terminal contact with the resistor below. You may add a insulation tape in the gap. The protection liner usually supplied with the VL53L0X chip can be used here.

Use the heat gun to stick the control wire.

Hot Glue

As you can see in the photo, there is a blob of hot glue on the white control wire, near the N-MOS G terminal. This step is very important and absolutely necessary. A floating soldering directly to the SMD component's leg is very weak. Even a small pressure on the wire may break the leg. Do this step gently.

Testing the LED

When you apply power (ex. 3.3v-5v) and ground to the sensor array, the LED on the first module should respond with the XSHUTN wire logic level. If you connect the XSHUTN to logic high (ex. 3.3v-5v), the LED should be off. If you connect the XSHUTN wire to low (ground), the LED on the first module should be on.

For all subsequent modules, the LED should be off.

This test is conducted before connecting to the arduino.

Daisy Chain Testing

Now we want test if the I2C address change works for all the sensors in the array. As mentioned, the first chip is controlled by the arduino. The second chip is controlled by the first chip, and so on.

  1. Setup the bread board. 5V and Ground rail are directly connected from adriano 5V and ground. Current consumption for each sensor is rated 19ma in datasheet. 
  2. Add a capacitor on the power rail to help stabilizing the Vin. 
  3. Connect Vin and Ground from the sensor array to the power rail. 
  4. Connect SDA to arduino Nano pin A4 (may be different for other micro-controllers). 
  5. Connect SCL to arduino Nano pin A5 (may be different for other micro-controllers). 
  6. Connect the XSHUTN wire to arduino Nano pin D2. (This can be changed in sketch). 
  7. Go to github https://github.com/FuzzyNoodle/Fuzzy-Radar and download the library. 
  8. Open the "Daisy_Chain_Testing" example and upload the sketch.

If everything works, you should see the status LEDs light up one by one, similar to the video clip above.

You may also open the Serial Window, and see the initialization progress. The output would appear like this:

Assemble the Holder and Frame

  1. Carefully place each GY-530 module on the holder with the M2x10 screw. Do not press the MOSFET or pull the XSHUTN wires. 
  2. Place each holder into the circular frame. Use some hot glue to bond the parts.

Again, the M2 screws, holders and circular frame are used to place the sensors in a circular arrangement. You may use any other methods, such as using card boards, model woods, clay, or even hot glue them on a can.

The 3D printed files I used are provided below. The circular frame has 9 modules, and separated by 10 degrees each. If you have a sharp eye, there were 10 modules in previous photos. The reason? Explained below...

Remove the Protective Liner

If you followed the steps from the beginning, it is a good time now to remove the protective liner on the VL53L0X chip. On my previous photos, they are already removed because I have to test the modules and make sure the concept works before posting this instructables. 

About the protective liner, datasheet states: "It must be removed by the customer just before mounting the cover glass". The two tiny holes (emitter and receiver) on the VL53L0X chip are vulnerable to pollution, such as dust, grease, hot glue, etc... 

Once polluted, the range may be reduced, and the readings may be off by an obvious amount. One of my test module is accidentally polluted by glue clay, range is reduced to 40cm, and the distance reading is erroneously enlarged by 50%. So, be careful!

*.stl files for 3D printed parts used in this project can be downloaded in the files section.

Using the Raw_Data_Serial_Output example

Now we really like to see the data from our sensor array. In the arduino library on GitHub: 

There is an example called Raw_Data_Serial_Output. This example demonstrates the raw data output from the sensor array. The output values are in millimeters.

After the sensors are initialized, should see something like this in the serial window when you wave your hand through the sensors:

Refer to the video clip for a live demonstration.

Using the Fuzzy_Radar_Serial_Output example

The next step is to get useful data out of these distance readings. What we wanted from a RADAR are the target object's distance and angle. 

Some filtering algorithm are applied in the library:

In the Raw_Data_Serial_Output, the raw distance readings are converted into distance and angle value. Once you uploaded the sketch, you may open the serial window to see the result similar to this:

So now, you have a RADAR (LIDAR):

In the following steps, we will show you some cool demonstrations!

This is one example of using the Stationary Radar we have built from previous steps. This step is not written in detail, as this is a demonstrator of the Radar. In general, you need these additional items to built this demonstration project:

The code can be downloaded here.

Please see the video provided.

Demonstration of using radar away to track object location and distance.

Schematic and Gerber files for PCB can be downloaded in the files section of this project.