It turns out that a colour detection module can be built for next to nothing, and the results are astoundingly good for the investment.
The biggest hurtle in this project is getting the balance right on our sensor as we are using LEDs to represent the colour being detected, which becomes our limit. Dark colours are more difficult to represent. The sensor still does a good job at detecting and giving a reliable reading, but again, balancing becomes the real issue. Reflectivity will also play with the readings. That being said, this sensor would work great for all manner of colour detecting projects. Best of all it is super cheap to make.
I really hope that a few of you out there both copy and improve on my lamp, or find some other great uses for this cheap, easy to make, Arduino friendly Colour sensor.
Step 1: Get Stuff
- a CdS photocell (cadmium sulfide), also called an LDR or light dependent resistor. Anyways, it is one of those little light detectors on most garden lamps, night-lights, etc.
- A 10K resistor
- A red LED
- a green LED
- a blue LED
- alternatively you could use an RGB(red green blue) LED
- A 220 ohm resitor
- a bit of shrink wrap or a cut section of a pen or anything else that would be a decent shroud for the LDR
- a shroud for the entire sensor (film case cut, pvc pipe, bits of plastic, again anything to shield the whole ensemble from ambient light a bit)
- a bit of prototyping board.
- Hookup wire (I also use male header pins and jumpers, but this is not required)
To make the rest of the lamp, you will also need.
- An enclosure
- a diffuser (I managed to get mine all in one with a tomato container from the Dollar store)
- an Arduino that will fit in your enclosure (I used a mini)
- another RGB LED or a red, green and blue LED
- three 220 ohm resistors
- some decor (use your imagination here, I went for the magic lamp look, you do what pleases you or go with what you have on hand as I did)
- soldering iron
- glue gun
- x-acto knife
- white glue
- paint brush