Comments: ZX Distance and Gesture Sensor Hookup Guide

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Tech Support Tips/Troubleshooting/Common Issues

    If you see this error output using the I2C_ZX_Demo.ino code:

    -----------------------------------
    SparkFun/GestureSense - I2C ZX Demo
    -----------------------------------
    ZX Sensor initialization complete
    Error reading model version number
    Model version needs to be 1 to work with this library. Stopping.
    

    Make sure that you are connected to the I2C pins correctly. If you have any loose connections, you will have issues communicating with the sensor through I2C. If you are using an Arduino Mega, make sure that you are connecting to the correct I2C pins https://www.arduino.cc/en/Reference/Wire .

  • Hi, I have problem when I try to use 2 sensors in game pong. When sensors are connected to one I2C bus but supplied from 2 Arduinos everything works fine. The problem is when I try to supply them from one Arduino, results are unstable, they change, although my hand is at the same position. I thought that maybe one Arduino can't provide enough current but I measured that this is not the cause.

    • It's possible there's IR interference bleeding from one to the other, since they both work on the same modulation frequency. Can you move the ZX sensors farther apart to see if that fixes your issue?

      • Yes, I move sensors farther apart, also I cover diodes from one sensor and check values from the other and problem still exist

        • And you closed the I2C Addr jumper on one of the ZX sensors, right? Do you have another Arduino you could use to test - have 2 Arduinos each with a ZX sensor sending data to a computer to see if the results are still skewed. This will determine if it's an IR problem or an I2C problem.

          • Yes I2C Addr on one sensor is closed and I tested with 2 Arduinos. When SDA and SCL lines of both sensors are connected to one Arduino (Arduino Mega ADK) and one sensor is supplied by that Arduino Mega ADK and second sensor is supplied by Leonardo everything works fine. I want to connect SDA, SCL, VCC, GND lines of both sensors to one Arduino, but this configuration makes problem with unstable results.

            • Maybe i should use additional 10k pull-ups resistors or open the I2C Pullups jumper to disconnect pull-ups on sensors?

              • I recommend first desoldering the "I2C Pullups" jumper to disconnect pullups on one of the sensors. Although, it shouldn't matter, because 5k pullups should work just fine. I used 2 ZX Sensors on the same I2C bus with my HoverPong demo, and both sensors have the "I2C Pullups" jumpers connected.

  • Could someone explain me what data is stored in these I2C registers: Left Emitter Ranging Data (0x0c) and Right Emitter Ranging Data (0x0d)?

    • They seem to be unused from a user perspective. My guess is something to do with calibration. Since the firmware was developed by XYZ Interactive, I recommend contacting them to learn more.

  • Hey is it normal for different sized objects to be detected at different distances? I get greatly different z values for my hand and then my finger. It seems that larger objects are seen to be closer even if the detected edge of the object is in the same place.

    • That seems pretty normal. How does 2 fingers compare to the palm of your hand?

      • I get a difference of around 12 units(Standard arduino demo program)

        • That's not so bad. In my testing, smaller objects seem to get a different reading than large, flat objects. The ZX sensor is not very good at getting accurate z- and x- coordinates of an object, and the readings are non-linear. It's better for relative position in the air and gestures. If you need high accuracy, I recommend looking into something like the Leap Motion.

  • I am having this error. I checked all the PIN and still have this. Any idea???

  • Hi, I am using Ardublock to do my coding, as my knowledge of coding is limited. Does anyone know what 'block' could be used for the zx sensor? Thanks

    • There is no block available for the ZX sensor, however, if you connect the sensor using UART, you can use the Serial block to receive data from the sensor.

  • Hi! I bought this sensor and I'm having some problems. It does work, but when I put my hand up really high (only vertically, Z axis) and DO NOT move in the X axis, the X value still increases.

    What could be the problem? I can't figure out. Thanks! David

    • What do you mean the X value increases? Where does it stop? When I try mine, as I raise my hand and the Z value approaches 240, the X value becomes very sensitive. At Z 230 - 240, the X value will switch between 0 and 240 with nothing in between. This is normal operation for the sensor, as at the edge of its IR range, it has trouble determining the X position of something.

      If you think the sensor is broken, I definitely recommend contacting our Tech Support staff.

  • Has anyone gotten this to work, or does it just hang at the init() for everyone else too?

    **update I had two bad boards in a row. Works fine.


If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!