Silicon ChipVL6180X Rangefinding Module - July 2023 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: We will continue to offer printed and online magazines
  4. Feature: Charging Electric Vehicles by Dr David Maddison
  5. Feature: VL6180X Rangefinding Module by Jim Rowe
  6. Project: Dynamic NFC/RFID Tag by Tim Blythman
  7. Feature: Electronics Magazines in Aus. by Jim Rowe
  8. Project: Reciprocal Frequency Counter by Charles Kosina
  9. Project: Pi Pico Thermal Camera by Kenneth Horton
  10. Project: Railway Carriage Uncoupler by Les Kerr
  11. Subscriptions
  12. Vintage Radio: Replacing Vibrators, Pt2 by Dr Hugo Holden
  13. PartShop
  14. Serviceman's Log: Can’t stop servicing, even on holiday! by Dave Thompson
  15. Market Centre
  16. Advertising Index
  17. Notes & Errata: Loudspeaker Testing Jig, June 2023; Vintage Radio, Astor APN, May 2023
  18. Outer Back Cover

This is only a preview of the July 2023 issue of Silicon Chip.

You can view 38 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Items relevant to "Dynamic NFC/RFID Tag":
  • Large Dynamic RFID Tag PCB [06101232] (AUD $4.00)
  • Small Dynamic RFID tag PCB [06101231] (AUD $1.50)
  • Small Dynamic RFID Tag kit (Component, AUD $5.00)
  • Credit card size Dynamic RFID Tag kit (Component, AUD $7.50)
  • Dynamic NFC/RFID Tag programming software (Free)
  • Dynamic NFC/RFID Tag PCB patterns [06101231/2] (Free)
Articles in this series:
  • History of Silicon Chip, Part 1 (August 2022)
  • History of Silicon Chip, Part 1 (August 2022)
  • History of Silicon Chip, Part 2 (September 2022)
  • History of Silicon Chip, Part 2 (September 2022)
  • Electronics Magazines in Aus. (July 2023)
  • Electronics Magazines in Aus. (July 2023)
Items relevant to "Reciprocal Frequency Counter":
  • Reciprocal Frequency Counter main PCB (CSE230101C) (AUD $5.00)
  • 0.96in cyan OLED with SSD1306 controller (Component, AUD $10.00)
  • Short-form kit for the Reciprocal Frequency Counter (Component, AUD $60.00)
  • Reciprocal Frequency Counter front panel PCB (CSE230102) (AUD $5.00)
  • Reciprocal Frequency Counter firmware (Software, Free)
  • Reciprocal Frequency Counter main PCB pattern (PDF download) [CSE230101C] (Free)
  • Reciprocal Frequency Counter front panel artwork (PDF download) (Free)
Items relevant to "Pi Pico Thermal Camera":
  • Raspberry Pi Thermal Camera PCB [04105231] (AUD $5.00)
  • Raspberry Pi-based Thermal Camera software & 3D printer files (Free)
  • Pi Pico Thermal Camera PCB pattern (PDF download) [04105231] (Free)
Items relevant to "Railway Carriage Uncoupler":
  • Model Railway Uncoupler PCB [09105231] (AUD $2.50)
  • PIC12F617-I/P programmed for the Model Railway Uncoupler [0910523A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Model Railway Uncoupler firmware [0910523A.HEX] (Software, Free)
  • Model Railway Uncoupler PCB pattern (PDF download) [09105231] (Free)
Items relevant to "Replacing Vibrators, Pt2":
  • Oscillator-Based Vibrator Mosfet replacement PCB [18106231] (AUD $2.50)
  • Oscillator-based Mosfet Vibrator Replacement PCB pattern (PDF download) [18106231] (Free)
Articles in this series:
  • Servicing Vibrators, Pt1 (June 2023)
  • Servicing Vibrators, Pt1 (June 2023)
  • Replacing Vibrators, Pt2 (July 2023)
  • Replacing Vibrators, Pt2 (July 2023)
  • Replacing Vibrators, Pt3 (August 2023)
  • Replacing Vibrators, Pt3 (August 2023)

Purchase a printed copy of this issue for $11.50.

Using Electronic Modules with Jim Rowe Quason VL6180X - Laser rangefinder - Light level sensor This module should be of particular interest if you want to build robotic devices. It uses infrared (IR) light to accurately sense the proximity of objects from 0mm to well over 100mm. It’s based on a technology known as FlightSense, patented by ST Microelectronics. T he Quason VL6180X range-­ sensing module comes on a tiny 17.8 × 20.3mm PCB with a handful of SMD components on it. As you can see from the photos, it includes three SOT23-3 devices and one 12-lead SMD IC, itself only 4.8 × 2.8 × 1mm. The secret is all inside that innocent-­ looking 12-lead IC in the centre of the PCB. There’s a lot more in that tiny package than you might expect. It’s a complete optical ranging system with a tiny IR (infrared) laser, two optical sensors (one for IR, the other for ambient light sensing), plus a microcontroller unit (MCU) with internal memory. This IC is the heart of the VL6180X sensing module – the rest of the components are there just to support it. Inside the VL6180X The IR laser driver section is shown in the centre, with the range detection section just above the MCU. To make a ranging measurement, the MCU first sends a command pulse to the IR laser driver to send out a short IR light pulse at a wavelength of 850nm. Then, it measures the time until the ranging detection section reports that a reflected IR pulse has been received. The MCU can then calculate the current distance to the object that reflected the IR pulse, by taking into account the speed of light in air and the time taken for the out-and-back journey. The speed of light in air is close to 299,702,458m/s (metres per second), which equates to 299.702m per microsecond or 0.2997m per nanosecond. Fig.1: the block diagram for the VL6180X rangefinder IC. The internals appear quite simple, with a separate section for the light sensing, IR emitter and ranging. However, very precise timing is required to make calculations down to the millimetre resolution, so the actual circuitry is more complicated than you might think. It’s made by European semiconductor manufacturer ST Microelectronics and uses its patented FlightSense technology. Unlike optical sensors that attempt to detect distance by measuring the proportion of light sent to an object that is reflected back from it, ST’s technology accurately measures the time the light takes to travel to the nearest object and reflect back to its sensor, which ST calls the ‘time of flight’. In short, it’s a kind of light-based radar or ‘LIDAR’. Fig.1 shows what’s inside the VL6180X and should help in understanding how it works. Near the bottom is the MCU with its ROM (readonly memory) and RAM (random-­ access memory) below it, while above it is the ambient light sensing section. siliconchip.com.au So light takes close to 3.336ns to travel one metre or 0.3336ns to travel 100mm. If the out-and-back journey of the light takes, say, 0.6672ns, the total path length is 200mm, so the distance between the sensor and the object must be 100mm. The key to this method of determining distance is precise measurements of very short time delays. To measure over a range of 1-100mm with 1mm resolution, the chip must have a timer capable of measuring the difference between emission and reception from just 7ps (picoseconds) to 667ps with 7ps resolution or better. One picosecond is one trillionth (10−12) of a second! Such capability is thanks to modern semiconductor manufacturing Australia's electronics magazine July 2023  31 Here the module is shown at nearly three times actual size for clarity. techniques that can make tiny transistors with predictable properties. In addition to this ‘time of flight’ range measurement, the VL6180X can also measure the ambient light level using the sensor and ambient light sensing (ALS) section shown at the top of Fig.1. This appears to be a ‘bonus’ feature as it does not factor into the distance measurements It can measure light levels between 0.002 lux and 20,971 lux, with what is described as a ‘photopic’ response. That means it responds to light wavelengths in the visible range of 400700nm (with a peak at around 550nm) as seen by the human eye at ‘well-lit’ lighting levels. The MCU in the VL6180X can take these measurements either once or repetitively and can also interleave range and ALS measurements. It accepts commands and makes the measurement data available via the Fig.2: the top of the VL6180X IC features three tiny holes that are critical for its functionality. These apertures are required for sensing and emission, with the largest being only 0.58mm in diameter. There is also an even smaller ‘vent’ hole. It’s important to note that the light sensor has a very narrow ‘cone’ and measures objects up to 150-200mm away. 32 Silicon Chip I2C port (pins 5 and 6) at lower right in Fig.1. You are probably wondering how all these impressive things can be done by the very small and innocent-­looking chip visible in the centre of the module PCB. Although they are not easy to see with the naked eye, there are actually three apertures on the top of the device, located on its centre line as shown in Fig.2 (which shows the top of the VL6180X at six times its actual size). The largest aperture (0.58mm diameter) near the centre is for the ALS sensor, while the smaller 0.5mm diameter one near the far end is for the IR ranging laser emissions. The even smaller 0.3mm diameter aperture near the ALS at the pin 1 end is for the IR ranging return sensor. A fourth and very tiny ‘vent’ hole is at lower centre, midway between pins 3 and 4. The VL6180X is designed to operate from a supply of 2.8V ±0.2V, with an average operating current of 1.7mA in ranging mode or 300µA in ALS mode. The current it draws in standby mode is less than 1µA. And the I2C interface can operate at up to 400kHz, with a 7-bit address of 0x29 (41 decimal). The full module Fig.3 shows the complete circuit of the Quason module, with the all-­ important VL6180X device (IC1) visible at lower left. At top centre is REG1, an XC6206 LDO voltage regulator used to step down the 5V input supply (at pin 7 of CON1) to the 2.8V needed by IC1. The 2.8V from REG1 is also made Useful links • www.aliexpress.com • www.st.com/content/st_com/ en.html • www.arduinolibraries.info/ libraries/vl6180-x • github.com/adafruit/Adafruit_ VL6180X available at pin 6 of CON1, for possible use by external circuitry. Both the GPIO0 and GPIO1 pins of IC1 are pulled up to 2.8V via 47kW resistors. The GPIO1 pin is then taken directly to pin 4 of CON1, while the GPIO0 pin is connected to pin 3 of CON1 via diode D1. This allows IC1 to be held in standby mode by pulling pin 3 of CON1 to ground. That is why this pin of CON1 is labelled “SHDN” (for “shutdown”). Mosfets Q1 and Q2, connected between the SCL and SDA pins of IC1 and the corresponding pins 2 and 1 of CON1, provide logic-level conversion. This way, the 2.8V signal swings at pins 5 and 6 of IC1 are converted into 5V swings at pins 2 and 1 of CON1, and vice versa. This allows the module to be connected to external circuitry running from a 5V supply, like an Arduino or similar MCU. The way this kind of ‘passive’ level shifter works is quite clever. Q1 & Q2 are N-channel devices, so they switch on when their gate voltage (“G”) is significantly higher than the source voltage (“S”). At idle, the source is pulled to +2.8V via one 10kW resistor, while the drain is pulled to +5V via another. Fig.3: the circuit diagram for the Quason module which utilises the VL6180X IC. Q1 and Q2 are used for logic-level conversion. Australia's electronics magazine siliconchip.com.au With the gate and source both at +2.8V, the Mosfet is off, so no current flows. If IC1 pulls its end low, the gatesource voltage becomes +2.8V, so the Mosfet switches on and the corresponding pin on CON1 also goes low. Alternatively, if the pin on CON1 is externally pulled low (eg, by an MCU), the Mosfet is initially off. Still, its parasitic ‘body diode’ (visible in Fig.3) allows the corresponding pin on IC1 to be pulled down to about +0.7V. The gate-source voltage of that Mosfet is then 2.8V − 0.7V = 2.1V, high enough for the Mosfet to switch on, pulling the pin on IC1 down to 0V. So when one side goes low, the other does too, but if both sides are allowed to be pulled high by the pull-up resistors, they remain high at different voltage levels. Fig.4: the Quason module can be easily connected to an Arduino Uno (or similar), with just four leads. Connecting it to an Arduino As you can see from Fig.4, connecting the module to an Arduino Uno or compatible is very straightforward. The module’s VIN pin connects to the Arduino’s 5V pin, its GND pin connects to one of the Arduino’s GND pins, and its SCL and SDA pins connect to the same pins on the Arduino. You will also need an Arduino library to get the two communicating, plus a sketch to use the library to make measurements. A couple of these libraries are listed on the Arduino website at www.arduinolibraries. info/libraries/vl6180-x – in both cases, they provide links to the library ZIP files on GitHub. When you download and unzip either of these libraries, they generously provide example sketches to get you going. I downloaded one of these libraries, added it to my list of libraries in the Arduino IDE and then loaded one of its example sketches. It was only a few minutes before I could wave my hand up and down above the VL6180X and see its As you can see from this enlarged photo, the Quason VL6180X is miniature, measuring just 17.8 x 20.3mm. siliconchip.com.au Australia's electronics magazine distance varying in the ranging data on the Arduino IDE’s Serial Monitor. It was as simple as that! So it’s pleasingly easy to get the Quason VL6180X IR range sensing module going with an Arduino. This, plus its low cost, suggests that it would be very suitable for DIY robotics. You might even be able to use a couple of the modules to make a digital Theremin! Where to get it We obtained the module in the photos from the Quason Official Store, one of the vendors on AliExpress (see www.aliexpress.com/ item/1005001572022389.html), for $4 including shipping. But there are several other vendors on AliExpress offering it for similar prices, such as SuperModule Store, DIY-Victor Store and HARYE Store. It is also available from eBay supplier Cakemol8 for just over $10, including shipping. And Australian firm AHEM Engineering (https://shop. ahem.net.au) also seems to have it for $12.45 (including GST) plus postage cost. A very similar VL6180X-based module can be found on the website of Newcastle firm Core Electronics (https://core-electronics.com.au) for $23.15 + $6.00 for shipping. While it is considerably more expensive than the AliExpress and eBay sellers, you are likely to get it within a couple of days rather than a few weeks due to being shipped from Australia. SC July 2023  33