In the Wiki - a project is mentioned for proximity detection - distance estimation.
There was a Siggraph presentation a few years ago where the scene was alternately illuminated by an LED on the left and right of the camera.
It used a primitive shape from shading approximation - to detect 3D depth of the scene in front of the camera.
The light from either side cast a hard edge shadow which could be detected as a simple difference and convolution between Left lit, unilluminated and Right lit frames.
I note you have an LED onboard for illumination. if its possible to add an additional light source and connect to a ‘stray’ I/O line - then this approach could be adopted on the Pixy.
Even with only one LED - the unilluminated frame and the lit frame might enable a better proximity detection than the naive brighness threshold…
References:
one of original papers - http://web.media.mit.edu/~raskar/NprCamera/
more detail - http://rogerioferis.com/publications/FerisSIGGRAPH04.pdf
related - http://www.cs.ucsb.edu/~mturk/pubs/Feris-CGA05.pdf
another use - http://web.media.mit.edu/~raskar/NprCamera/medical04.pdf
SFS core - http://dl.acm.org/citation.cfm?id=946681 http://www.math.tau.ac.il/~sochen/Articles/TSY_ICCV_03.pdf
and the subsequent solution paper using fast marching cubes - http://www.cs.tau.ac.il/~hezy/papers/c34.pdf
Explanation and Pseudo code for fast marching method - http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/841/pdf/imm841.pdf