Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

New to this site so hoping it's the right place to ask.

I'm trying to prototype something for use in a retail store and an idea a teammate had was using an RGB sensor to detect both ambient color as well as a proximity sensor to detect when someone is near the display and get the color of their clothing. We'd then use a series of LEDs to recolor the display to match that customer.

The problem I'm running into is that most RGB sensors I've found seem to only be accurate at a few inches (at most) and for proximity sensors it's a bit better but not enough for use in a store setup.

I have a pretty limited electronics background though so I'm mostly browsing Arduino suppliers. Does anyone know if you can get sensors with a larger distance and if so can they be controlled by something like an arduino?

One potential fallback is a camera like the MS Kinect with a full on computer but the client is weary of having a real camera for legal reasons.

share|improve this question
Cool idea. I can't say much for the RGB sensors, but a camera can be used with something like OpenCV to determine the color histogram of the the store nomially. This can then be subtracted from the images you acquire when customers are in the camera's view thereby leaving only their color spectrum. Of course you will have to coorelate this somehow the LED drivers. Too bad this is pretty much out of the question! – sherrellbc Jun 19 '14 at 13:49

Light sensors aren't limited to any distance. It makes no difference whether the photons they sense came from someone's clothes 1 foot away or the sun 93 Mmiles away.

Your problem with distance is probably that the light is not focused, so the sensor is seeing the average of a large angle. When a person is close, that angle of view will be dominated by light reflecting off their clothes. When more distant, all kinds of other ambient light is mixed in.

The solution is therefore to either focus the light so that only light arriving from a narrow angle hits the sensor, or to just block the light coming from outside the view of interest. The latter can be easily done by putting the sensor at the back of a tube that is diffuse black on the inside.

share|improve this answer

I'm not an Arduino kind of guy, but if you google on "RGB sensor Arduino" you'll get a number of hits, including http://www.adafruit.com/products/1334, which looks like exactly like what you want.

You'll need an optical setup with a lens gather more light from your subject, and a tube to block light from the surroundings. If that sounds like a telescope, that's because it is. If you want to look at a 6 inch diameter spot at 6 feet, that says you want a 5 degree field of view. Since you're not interested in resolving details within your spot, you can use very simple optics, like a single cheap lens, to do the job. Depending on just how accurate you want your readings to be, it might be a good idea to set up your detector so that when nobody is in view, it looks at a white panel. This will allow you to compensate for variations in the color of ambient illumination.

share|improve this answer

An RGB sensor, in it's simplest form, is simply a one pixel camera without a lens.

To make it sense color at a distance, use a lens, pinhole, or similar method to allow that sensor to sample a smaller portion of the scene at a distance.

Unfortunately, this will make it look like a camera.

The easiest non-camera-looking option is probably placing it at the end of a black tube. It will only sense straight forward from the tube, any incidental light on an angle will be absorbed by the tube.

The drawback is that it won't collect much light, but in a store that's well lit, you should have enough of a signal to determine the color.

As far as presence, you're simply looking for a fast change in color and brightness. If no one is moving in front of the sensor, the values will stay the same. As someone walks in front of it, they will change very rapidly, depending on the angle of view.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.