This is a simple color sensor using Atmega16 MCU and can sense Red ,Green and Blue color.

How it works:
the sensor consist from LDR sensor and RGB LED ,so when the object putted on the sensor the light that emitting from RGB LED will reflected from the object to LDR sensor and read it by ADC of ATMEGA16 as below sequence:
1-Turn on Blue in RGB LED and wait.
2-Read ADC and store it in the registry as blue.
3-Turn on Green in RGB LED and wait.
4-Read ADC and store it in the registry as green .
5-Turn on Red in RGB LED and wait.
6-Read ADC and store it in the registry as red.
7- if red >green>blue turn on Red LED display.
if green > red > blue turn on Green LED display.
if blue > red >green turn on Blue Led display.
Calibration :
The RGB LED emitting red ,blue and green in different intensity so to equalize them , variable resistors should be used with below steps :
1-put a white object on the sensor.
2-turn on Blue in RGB LED and read the voltage across the LDR sensor using voltmeter.
3-turn on Green in RGB LED and read the voltage across the LDR sensor using voltmeter.
4-turn on Red in RGB LED and read the voltage across the LDR sensor using voltmeter.
5-adjust the variable resistances to make all the voltage equalized when white object putted on the sensor.
