Detecting color on a screen.

Hi,
One of my projects need the detection of color on a screen.
Can anyone tell me what should I use?
For now I wanted to detect just black and while, so I tried using a infrared sensor, but its a screen, and gives me same value of reading for black and white.

Will a photo diode be able to tell the difference between black and white? or as the brightness is constant, even the photodiode will fail in this?

Thanks

What type of screen is it? Is it TV, computer, Arduino LCD, etc?

What do you need to do with the color information? Do you NEED an Arduino or could you use a laptop?

How detailed is the image on the screen? Is the screen flooded with a single color or is it a video (etc.)?

There is, though, something you can do if you can't find a good sensor:

You could send the image to a laptop that is running a Java app or a MATLAB script to find the RGB values of the pixels, find the color you are looking for, and send the necessary data to an Arduino via USB.

Does it matter a lot?
Because I would wanna make it work with laptop screen, and mobile screen.
I wanna run some triggers when the screen is white.
The screen keeps on changing. so does the location of color.

Naah this has to be independent system, cannot use matlab or something else with it. just the arduino

Ok, cool.

Here's the deal:

1.) I don't think there are any sensors out there that do everything you need.
2.) No Arduino (except for maybe a Due) has the speed or memory to do much image processing.

Here's the fix:

1.) Break the bank and get a Raspberry Pi and a Bluetooth transceiver.
2.) Send the image bitmap from the screen to the Pi via Bluetooth.
3.) Find a Raspberry Pi image processing library on GitHub.

The Raspberry Pi is a MUCH faster and more powerful microcontroller than any Arduino. They should be used over Arduinos when you do either image, video, or audio processing.

I believe that the spectrum emitted by both CRT and lcd screens will be closer to UV than to IR, although I don't really know; but it doesn't surprise me that an IR sensor doesn't detect anything.

This being said, there are tons of infrared sensors out there and thus "infrared sensor" is a bit vague. IR sensor can be a photo transistor with 38khz demodulator, a phototransistor, photoresistor, photodiode, PIR sensor, etc. Please specify it further and preferably give us a link to the datasheet of the sensor you used.

Just use standard photoresistors, 3 of them close together, each with a piece of filtering glass (red, green and blue).
Photo-resistors go in voltage divder type circuit, you could use pots or software to calibrate (zero) the sensors.
You will then need to calibrate for known values and make a LUT for the system.

How many points on the screen do you need to detect the color of?

If it's a few then a color sensor like this might be your best choice: RGB Color Sensor with IR filter and White LED - TCS34725 : ID 1334 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits

For lots of pixels you are probably outside the range that an Arduino can help with. I'd consider a cheap old PC/Laptop with a webcam and running Processing. (See: https://processing.org)

Johnny010:
Just use standard photoresistors, 3 of them close together, each with a piece of filtering glass (red, green and blue).
Photo-resistors go in voltage divder type circuit, you could use pots or software to calibrate (zero) the sensors.
You will then need to calibrate for known values and make a LUT for the system.

Yup, what Johnny said seems good! I would just add that photoresistors are generally slower than phototransistors, so you might wanna take that into account (I mean I believe that they are, correct me if I'm wrong). But from what I recall, they see pretty much what humans see in terms of spectral sensitivity.