Introduction: Arduino Colour Sensor Under 1$
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)
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);
}
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....