loading
So here is my first instructable,Coming to the topic,this is an arduino compatible colour sensor that is extremely made at low cost(don't go on the image I ruined it whole while de attaching it from the robot)....

Step 1: Gathering the Materials

1-10k ohm resistor
2-LDR(3mm)
3-All pins(you can also use male header pins)
4-A perfboard or a copper clad board
5-An led(white I recommend)

Step 2: The Circuit Diagram

The signal pin could be attached to any of the analog in pins on arduino(by my program its A0 )

Step 3: The Etching Traces

The traces should look like this,you may be wondering what is the use of all pins???,because of lack of male header pins,I used them as a connector(by cutting off their heads)...

Step 4: The ARDUINO Code

Note-This code only distnguishes between black and white for other colours it may be modified and the analog in values may vary....

int value1 = 930; // these value
int value2 = 890;//must be
//changed by experimenting

void setup(){
Serial.begin(9600);}

void loop(){
if (analogRead(A0) > value1)
{Serial.println("Its White");}
else if (analogRead(A0) > value2)
{Serial.println("Its black or something except white");}
else{Serial.println("There is no colour");}
delay(100);
}

Step 5: About Me

I am a 14 year old guy who loves arduino and programming,I like science and want to become an engineer.Pleeeeease vote for me,in the sensor and first time author contest,your single vote can make me win,so pleeease...

Step 6: What's Next??

My next instructable will deal with controlling AC current using Arduino through Bluetooth....
<p>What colour of LED did you use for this project?</p>
I mentioned,the leds that I used were white,you can use any colour but that may effect the program a bit....

About This Instructable

558views

12favorites

License:

Bio: I am a 15 year old guy who is passionate about Arduino and programming,I like science but I love programming,I am also interested ...
More by Daniyal Shamsi 154:Arduino Transistor Motor Driver TV Remote Jammer Bluetooth AC voltage controller 
Add instructable to: