How to Make a "chameleon" With Arduino

33,748

209

30

Published

Introduction: How to Make a "chameleon" With Arduino

About: You either hate me or love me.

You must have seen chameleons changing colors and blending in the surroundings, in an amazing way. The way that chameleons actually do this is really molecular. If you look at the skin of a chameleon, you find that they have several layers of specialised cells called chromatophores and these are cells that can change colour. And that's where I came up with an idea of building a device that acts alike, with arduino.

Step 1: Intro

You must have seen chameleons changing colors and blending in the surroundings, in an amazing way. The way that chameleons actually do this is really molecular. If you look at the skin of a chameleon, you find that they have several layers of specialised cells called chromatophores and these are cells that can change colour. And that's where I came up with an idea of building a device that acts alike, with arduino.

Hardware Used

TCS3200 Color Sensor from DFRobot, $7.90

Arduino Nano from DFRobot, $22.00

Light Disc with 7 SMD RGB LED, $8.90

Breadboard, x1

Jumper Cables, a few

Here I used Arduino Nano because I want the device to be as compact as possible with a low power consumption. However, if you do not have power or sizing requirements, any other Arduino microcontroller will just do the job —— and saves money.

Step 2: Wiring

To connect the TCS3200 Color Sensor with Nano, you'll need to expand some extra ports. The wirings should follow correctly with the program, to ensure functionality. Connect the LED port of color sensor with 3.3V on Nano. See attached wiring diagram for details.

Step 3: Programming

After all wirings done, you can now go to Arduino IDE and upload the codes for your chameleon. Note: the Metro Library is needed. You can find it here and install it in advance.

Here I leave a zip file with the the code.

 

Step 4: Test and Enjoy!

I used different colored papers to do demo tests. Just put the colored paper beneath the color sensor, and it starts to change color accordingly! Looks a bit more like a "chameleon" now :p

The sensor data will also be affected by ambient light, so it works better in the night.

The container I used is a printed vase found on Thingiverse, I am sure you will easily find a nicer one at home or made by your self.

Enjoy.

Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Woodworking Contest

      Woodworking Contest
    • Make it Move Contest

      Make it Move Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    30 Comments

    I'm also getting errors with the code. I do have Metro installed. Anybody ever find a solution to this? Thanks.

    2 replies

    Me too, I got this error when running the code (already install the metro library at arduino libraries folder)

    Arduino: 1.8.3 (Windows 8.1), Board: "Arduino/Genuino Uno"

    chameleon_code:3: error: no matching function for call to 'Metro::Metro(int, bool)'

    Metro ledlightup = Metro(60, true);

    ^

    D:\CODING\!Colorsensor\chameleon_code\chameleon_code.ino:3:34: note: candidates are:

    In file included from D:\\CODING\!Colorsensor\chameleon_code\chameleon_code.ino:1:0:

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:37:3: note: Metro::Metro(long unsigned int)

    Metro(unsigned long interval_millis);

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:37:3: note: candidate expects 1 argument, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:36:3: note: Metro::Metro()

    Metro();

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:36:3: note: candidate expects 0 arguments, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: constexpr Metro::Metro(const Metro&)

    class Metro

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: candidate expects 1 argument, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: constexpr Metro::Metro(Metro&&)

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: candidate expects 1 argument, 2 provided

    chameleon_code:4: error: no matching function for call to 'Metro::Metro(int, bool)'

    Metro processdata = Metro(50, true);

    ^

    D:\CODING\!Colorsensor\chameleon_code\chameleon_code.ino:4:35: note: candidates are:

    In file included from D:\CODING\!Colorsensor\chameleon_code\chameleon_code.ino:1:0:

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:37:3: note: Metro::Metro(long unsigned int)

    Metro(unsigned long interval_millis);

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:37:3: note: candidate expects 1 argument, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:36:3: note: Metro::Metro()

    Metro();

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:36:3: note: candidate expects 0 arguments, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: constexpr Metro::Metro(const Metro&)

    class Metro

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: candidate expects 1 argument, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: constexpr Metro::Metro(Metro&&)

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: candidate expects 1 argument, 2 provided

    chameleon_code:5: error: no matching function for call to 'Metro::Metro(int, bool)'

    Metro TcsTrigger = Metro(10, true);

    ^

    D:\CODING\!Colorsensor\chameleon_code\chameleon_code.ino:5:34: note: candidates are:

    In file included from D:\CODING\!Colorsensor\chameleon_code\chameleon_code.ino:1:0:

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:37:3: note: Metro::Metro(long unsigned int)

    Metro(unsigned long interval_millis);

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:37:3: note: candidate expects 1 argument, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:36:3: note: Metro::Metro()

    Metro();

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:36:3: note: candidate expects 0 arguments, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: constexpr Metro::Metro(const Metro&)

    class Metro

    ^

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: candidate expects 1 argument, 2 provided

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: constexpr Metro::Metro(Metro&&)

    C:\Program Files (x86)\Arduino\libraries\Metro/Metro.h:32:7: note: candidate expects 1 argument, 2 provided

    exit status 1

    no matching function for call to 'Metro::Metro(int, bool)'

    This report would have more information with

    "Show verbose output during compilation"

    option enabled in File -> Preferences.

    ==============
    Anybody know how to solve this problem? In some forum, I found someone said that i have to use the modified metro libraries, but the author of this instructable use the library straight from the github page and i use the same library file. Any help will greatly appreciated, thankyou.

    Did you find a response to this by any chance?!

    I get chameleon code.zip. but can not open code with winrar. every help me open code.zip

    hi mindminus,,

    A great project you got here.. i am new to using an arduino and when i tried this project i am facing a few errors even after i have the metro installed.. please could u have a look and let me know, i have uploaded a picture as well.. thanks

    chameleon.jpg

    Hey, I have this thing all wired up but the code has quite a few error messages. Do you have an updated code? thanks!

    Hi,
    I really want to use your example, since its perfect for a project I'm working on. Although I get this error message trying to use it.
    I downloaded Metro from this link:
    https://github.com/thomasfredericks/Metro-Arduino-...
    As I can find on the net, this lib might be modified. Can you post or link to the version of Metro you are using?
    Thx :-)

    Skærmbillede 2014-10-21 11.25.40.png

    HI, I want to do this project but I'm having a difficulty buying the
    "Light Disc with 7 SMD RGB LED" but I have found an alternative
    component found on ebay http://www.ebay.ph/itm/Cyclic-RGBuino-Shield-V3-0-Arduino-Compatible-/270951123760?pt=LH_DefaultDomain_0&hash=item3f15f20b30
    yet I don't know if it'll work because I'm not into this profession.
    Also the code will be affected right? Will you please help me? Thank you so much!

    Hi, I am very enthusiastic about this project, but when I try to upload your code into my arduino micro, (Metro library installed) I get a number of metro related error messages. Can you please advce me what I do wrong?

    2 replies

    Hi,

    Can you post an image of the error message you've encountered? Thanks

    Hi, mindminus

    Below you will find the error message.

    thnx.

    Aduino_error.jpg

    Hi, mindminus

    Could you please have a look at the error message I get?

    I would very much like to finish this project and I am curious about the result.

    Thank you.

    Hi,

    This is the image of the error message, I am sure I installed the Metro Library.

    If I compile and transfer Metro examples they work flawless.

    Kind regards

    Aduino_error.jpg

    hi again! in the post indicates that there is a wiring diagram attached but i cant see it, tnx!

    2 replies

    The wiring diagrams are in the pics attached in step2.

    thanks i already do the Project is awesome!

    Hi nice Project!, i have some problems, can you help me? pls. at the moment to compile the code, the next errors are indicated.

    chameleon code.jpg
    1 reply

    I already have the Metro Library, thanks !