This set up will light up a different LED based on the distance an object is away fromt he sensor

This set up isn't really to terribly hard to get up and running but it can get pretty cluttered pretty quick. I myself went through 3 different wiring setups before submitting this. I tried to keep my wires color coded when setting up the board. I find this helps a lot, especially when everything is packed so tight.

 

Once you've got everything rigged up and the code is uploaded, all you have to do is move your hand towards and away from the sensor. I found that using a folder or an object wider than my hand led to better results.

 

Problems: Occasionally, when moving outside of the sensor's range, the LEDs will cycle between Yellow and Red. I believe this has something to do with the sampling rate or perhaps the sensor or something. Not quite sure.