ZX Distance and Gesture Sensor Hookup Guide
This Tutorial is Retired!
This tutorial covers concepts or technologies that are no longer current. It's still here for you to read and enjoy, but may not be as useful as our newest tutorials.
View the updated tutorial: ZX Distance and Gesture Sensor SMD Hookup Guide
Board Overview
The ZX Sensor works by bouncing infrared (IR) beams of light from the two LEDs on either side off of an object above the sensor. The bounced light returns to the receiver in the center of the sensor, and a microcontroller on the back of the sensor interprets the data. We can read the results using an I2C or UART connection.
Pin Descriptions
The ZX Sensor gives us 2 ports to connect to: I2C and UART.
Pin Label | Description |
---|---|
GRN | Not used |
TXO | UART transmit out from the ZX Sensor |
RXI | UART receive. Not used at this time. |
VCC | 3.3 - 5 V power supply |
GND | Connect to ground |
BLK | Not used, but connected to GND |
DR | Data Ready. High when there is data to be read via I2C |
CL | I2C clock |
DA | I2C data |
Setting the Jumpers
The ZX Sensor has a couple of jumpers on the back of the board that can be opened or closed with a soldering iron.
I2C Pullups - The ZX Sensor, by default, comes with 4.7 kΩ pull-up resistors on the SDA and SCL I2C lines. Remove the solder on this jumper to disconnect the pull-ups.
I2C Addr - By default, this jumper is open. Close it to change the I2C address of the sensor.
Jumper | I2C Address |
---|---|
Open | 0x10 |
Closed | 0x11 |
The Infrared Shields
See those little brass tubes on the LEDs? They are needed to block any IR light going directly from the LEDs (inside the brass tubes) to the receiver (the black domed component in the center of the sensor). We want the light to bounce off an object first.
They are held on with Super Glue. You can remove them, but it might require a bit of acetone. If you plan to mount the ZX Sensors in your own housing, make sure IR light can't travel directly from the sides of the LEDs to the receiver (i.e. you will want to make your own IR shields).