ZX Distance and Gesture Sensor x-value and gestures

I’ve hooked up a zx sensor (https://www.sparkfun.com/products/13162) to an arduino (compatible) according to the example sketch.

Supply voltage 5v, DA/CL and DR hooked up to SDA(A4)/SCL(A5) and 2

The z values work well, with values between 5 and 100 depending on distance, with reasonable repeatability.

The x values on the other hand only change between about 115 - 140. That doesn’t seem to be enough to trigger gestures, because in the example gesture sketch no interrupts are triggered.

What is the expected range of x-values? It is around 120 with no obstacle above it, is that to be expected?

Hi another_thomas,

The full range of X (and Z) values is 0-240. I do not have one of these handy to test right now but seeing 120 reported with no obstacle in front of the sensor sounds about right. When you are testing the X range, does moving your hand further or closer to the sensor help at all? Also, if you have a light source (or any IR source) directly above the sensor, that will impair the readings. If you have a work light or possibly direct sunlight around your testing, try obscuring that a bit and you may see some better results.

I hope this helps you troubleshoot this issue!

I’ve rebuilt the circuit, and I checking whether distance makes a difference realized that the cables on the breadboard seem to reflect enough light to impair the sensor, although I of course didn’t cross the sensor breakout board.

Bending the cables down to the breadboard solved my problem. Do you have any information about the opening angle in y in which the sensor is sensitive?

Interesting. I’m surprised the sensor was seeing reflected light there but I’m glad that rearranging the wires helped fix the problem! As for the y-angle, the [datasheet for the IR Receiver has some good information in there regarding directivity.](http://www.vishay.com/docs/82482/tssp57038.pdf)