Arduino Colour Sensor Under 1$

About: I am a 16 year old guy who is passionate about Arduino and programming,I like science but I love programming,I am also interested in robotics......

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)....

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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....

First Time Author Contest 2016

Participated in the
First Time Author Contest 2016

Sensors Contest 2016

Participated in the
Sensors Contest 2016

Be the First to Share

    Recommendations

    • CNC Contest

      CNC Contest
    • Make it Move

      Make it Move
    • Teacher Contest

      Teacher Contest

    3 Discussions

    0
    None
    RiverSmith101

    Question 5 weeks ago

    Would the code possibly be able to be modified so that many different colours can be recognised?

    0
    None
    jfudger

    3 years ago

    What colour of LED did you use for this project?

    1 reply
    0
    None
    Daniyal Shamsi 154jfudger

    Reply 3 years ago

    I mentioned,the leds that I used were white,you can use any colour but that may effect the program a bit....