Hi, does anybody have any experience with this sensor?
It seems a very cheap option for a colour sensor, does anybody know how one would go about using it with an arduino?
Specifically, can it just be directly connected to the analog pins or will many other parts be needed? (low cost and simplicity needed for project)
It is just three photo diodes so yes you need an op-amp or at least a transistor on each diode. A bit like the circuit here:- http://www.thebox.myzen.co.uk/Hardware/Sneak_Thief.html
You will also need a white LED to illuminate what ever it is you are trying to measure the colour of unless that thing is actually a source of light like stained glass or a monitor.
Thanks for the fast response, fellow mancunian too
So to use this sensor to detect different coloured lines on paper, I'd basically want three of the Sneak Thief circuit, one for each colour photodiode?
Looking at the data sheet, the different colours have different sensitivities to light. Is this something you would recommend I try and address in hardware, with different value resistors on each colour or in code with something to give a calibrated RGB value?
So to use this sensor to detect different coloured lines on paper, I'd basically want three of the Sneak Thief circuit, one for each colour photodiode?
At least, that circuit was for a direct LED not reflection. I would try with one to start.
Is this something you would recommend I try and address in hardware,
If I tried first just directly connecting each anode to separate analogue pins, powering each anode separately from 5v with a resistor in series and the common cathode direct to ground, would I be in danger of damaging anything?
If I can get working readings like this it would only take 4 parts (without target illuminator), making the whole project much simpler.
I've ordered a few and some SMD adapters so I can try it out, hopefully results to follow within a week.
Am I right in assuming they're used to bring the range of output from the photodiode up to the range of inputs for the analogue pins?
Yes
If I tried first just directly connecting each anode to separate analogue pins, powering each anode separately from 5v with a resistor in series and the common cathode direct to ground, would I be in danger of damaging anything?
No
making the whole project much simpler.
Yes but the range of readings you are likely to get is small which might hamper the resolution of the colour recognition.
I'll try it both ways, see which works best.
Any recommendations on specific parts? I've found a quad op-amp IC that looks suitable but I'm not aware of any unknown unknowns that I should be avoiding.
I was only planning on being able to differentiate between a few different colours of marker pen, so low resolution might be fine but then again, different makes/brands/shades of markers of the same colour might throw a low res sensor off.
Looking at using an LF347n quad op amp, possibly with a negative feedback loop.
Would the negative feedback loop need tuning specifically to the sensor and op amp in use?
If so, is there a better way of doing this than plugging variable resistors into breadboard and twiddling to see what works best for the specific application?
You always use negitave feedback with an op amp when you want to amplify a signal. It defines the gain.
See what signal you are getting from the raw sensor then calculate the gain you need to get it up to 5V. Then choose the resistors to give you that gain.
Got the sensor wired up, plugged 47K resistors just to test and getting readings up to ~3V in bright light.
Project for tomorrow: actually calculate proper resistor values for negative feedback,redesign illuminator (LED too close to sensor, just saturates it with light, no reflected reading at all), then get together a processing sketch so I can start visually checking the colours it is reading.
BernardMarx:
More goodies from China arrived today.
Got the sensor wired up, plugged 47K resistors just to test and getting readings up to ~3V in bright light.
Project for tomorrow: actually calculate proper resistor values for negative feedback,redesign illuminator (LED too close to sensor, just saturates it with light, no reflected reading at all), then get together a processing sketch so I can start visually checking the colours it is reading.
Hello BernardMarx,
I am working on the same model RGB color sensor (KPS-5130PD7C). And now i'm stuck with the amplifier circuit to convert current into voltage. Bcz the sensor has common cathode. I have seen your attached image "IMG_20140423_010240.jpg" it looks good. do you have the circuit diagram for this setup. It would be a great help for me.