ZX Distance and Gesture Sensor Hookup Guide
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.
The ZX Sensor gives us 2 ports to connect to: I2C and UART.
|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|
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.
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).