We will be making this colour sensor on a breadboard, but it is easily transferred onto a prototyping board, and for those who fab their own boards, this would be an awesome kit that is super cheap to throw together. I am sure it would only take about two minutes to write a gerber file for this circuit and make a nice little finished sensor.
Remove these ads by
Signing UpStep 1: Gather Some Parts
- a breadboard (not required, but it is how I will walk you through it.)
- an RGB LED (alternatively you could use 3 LEDs)
- A 220 ohm resistor
- A CdS photocell (these can be salvaged out of all kinds of things like nightlights or garden lamps)
- An Arduino, or a clone. I am using a RBB in this example
Tools you will need
- A computer
- a cable to upload to your Arduino










































Visit Our Store »
Go Pro Today »




Have you seen any problems with the red color - due to the spike in sensitivity that the LDR has?
If you are having difficulty with a certain range, you can 'trick' it to perform better by changing your black balance. Might have been a good idea to add a pot for fine tuning without rescanning. Thanks for the compliment. Not much to it, throw one together and play. Cheers.
I have a project and I need to detect White Red Blue and green colors.
The PIC microcontroller code is done, i just need the schematic to build my project
I must also use 4 sirenges (one for each color) for the color mixing part
I appreciate your prompt help, i need it for my project.
Plzzz
Thank you :D
I have a project and I need to detect White Red Blue and green colors.
I must also use 4 sirenges (one for each color)
I appreciate your prompt help.
Thank you :D
Did you try out the processing sketch? It is a quicker way to see the colour.
I noticed that you will be working on getting an LED to light the same colour next, check out my Magical chameleon lamp project if you need any pointers.
Cheers!
I will put it together and try it, but until then - curious if know how surface finish/texture of the object being scanned effects the reading. Also, as a derivative of that question, will it sense equally well through a clear film, glass, etc?
Thanks
Cheers.
You can certainly mess with the readings by providing a yellow sample in place of white. But that would be true of just about anything. Just try wearing a pair of yellow ski goggles around and see how effective your own colour perception becomes.
Also, I suggested calibrating on a non-white target not as a criticism but as a fun way to play with your device.
I notice that we are in some of same competitions. ;) Cheers.
Dennis, KC9PYD
I've only ever programmed in BASIC, but your breakdown of the Arduino code was really easy to follow. I wish more people would take the time to explain their code, rather than just presenting it as a "black box."
It is really great to hear such positive feedback, moreover, I am really glad that people 'get it'.
Thanks again. (I am beaming)
I think I will no longer have an excuse.
Red LEDs work at 2v, green LEDs work at 2.1v, and blue LEDs work at 3.6v.
The resistor should not be on the GND (common). There should be an exclusive resistor per LED. Otherwise, the blue LED will most likely be dimmed in excess.
I might be wrong tho.
So long as you are not trying to light the three together, which we are not in this application, the single resistor is sufficient.
Not that it is a problem with this particular setup, but you can get quite good results even if you are using three seperate LEDs of different quality. (see my chameleon lamp, it uses three LEDs from a dollar store toy...on one resistor as well)
I hope this alleviates your concerns, go try it out, you will be surprised at how well it works.