3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.


Magical Colour Copying Chameleon Lamp

Magical Colour Copying Chameleon Lamp
In this Instructable, I will show you how to make an Arduino powered lamp that detects the colour under it and then attempts to emulate that colour. All using easy to find parts (most can be found in the Dollar store with the exception of the Arduino of course).

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.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Get Stuff

To build the colour detection module you will need
  • 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)
Tools that you will need
  • soldering iron
  • glue gun
  • x-acto knife
  • tape
  • white glue
  • paint brush
  • imagination
I decided to leave mine tethered to my computer for power, but you may want to add an on/off switch, and batteries.
« Previous StepDownload PDFView All StepsNext Step »
46 comments
1-40 of 46next »
Mar 29, 2012. 5:18 PMmooner77 says:
could you guys please help me make a diagram for a RGB LED.
Feb 23, 2012. 6:03 AMlioncour says:
Hi. I got some trouble.

I put the .ccp and .h files in libreary/moodlamp.
I got no skteches folder.
Using IDE 0022

when i try to compile the library i get this error.


sketch_feb23a.cpp:1:22: error: moodlamp.h: No such file or directory

Any idea what i am doing wrong?
Jan 22, 2012. 12:59 AMaemery1 says:
How would you do this using a common anode rgb.
would it be okay to use one resistor on the anode?
Dec 21, 2011. 7:32 PMrobot1398 says:
i am getting errors compiling the code
Dec 23, 2011. 11:49 PMrobot1398 says:
it says
"moodlamp does not name a type
Dec 26, 2011. 7:55 AMrobot1398 says:
how do i do that??
Dec 26, 2011. 7:44 PMrobot1398 says:
downloaded the libarary successfully
it gives another error "pulse not defined in the scope" for the statement pulse whit
e
Dec 26, 2011. 10:34 PMrobot1398 says:
(removed by author or community request)
Dec 27, 2011. 1:44 AMrobot1398 says:
removed
Dec 21, 2011. 6:58 AMfoamyguy says:
If you get an error message that says something about

"WProgram.h not found"

This seems to be a bug with the Arduino 1.0 IDE. Switch back to 22 or 23 and it should compile and run fine.
Dec 21, 2011. 10:34 AMfoamyguy says:
Im not really familiar with the Arduino IDE and programming with it yet. So I don't know for sure what part of the process caused it. But here is what happened:
1. create libraries folder in my sketch book folder
2. create Moodlamp folder inside libraries
3. paste the .cpp and .h files into Moodlamp folder (you should consider attaching these files to this instructable too. I eventually found them on the other one that you link to, but it threw me off for a while.)
4. paste the code into arduino IDE
5. press the upload button - at this point there was an error that said something about WProgram.h not found.

When I switch to IDE 0022 and repeat these steps everything works as expected.
Dec 11, 2011. 12:40 AMLexanPanda says:
This is a great instructable, and really well done! Am I correct in assuming you got the idea from ThinkGeek's Huey? :)
Dec 11, 2011. 3:11 AMLexanPanda says:
Yep, custom made is always better than store-bought(and usually cheaper, too). How hard do you think it would be to update your code to store balancing data?

I'll see if I can't build a chameleon lamp myself, and post my result here. Wish me luck!
Dec 9, 2011. 4:37 AMjanw says:
Great project. I will definately try to buid such a colorsensor.

definately worth 5 stars
Dec 8, 2011. 9:06 AMmatt.e.jenkins says:
You have some very cool projects and I'm jealous because I'm in the same contests. Great Job. I'm going to have to build one of these.
Dec 8, 2011. 12:17 PMadar1 says:
Hey, in that picture I can see you wrote digital and analog can you explain how this system work of this chameleon lamp works, please!!!
Dec 8, 2011. 6:56 AMadar1 says:
Hey, can you give me more technical details on how the circuit and the system works of the chameleon lamp!!! I think you you made a cool lamp and I am going to try this out!!!! thanks you!!!!
Dec 8, 2011. 12:21 PMadar1 says:
Thanks!!!!
Dec 7, 2011. 3:50 AMamaze1 says:
Very COOL !!!
One of the smartest led color "change" application ever seen, I'll made one for sure. Great !
Dec 6, 2011. 1:00 AMskumdog says:
Very nice. I hope I learn to write code like you one day. I am just starting with Arduino and it can be very confusing, to the beginner, at times. Thanks for this great instructable.
1-40 of 46next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
48
Followers
20
Author:fjordcarver
Dad, maker, dreamer, hacker, painter.