Midterm Project: Chameleon by Kaycee(Yijia Chen)

Partner: Zhiqiu Wang

Before launching into the midterm project, we had come across several programs using LEDs to reflect the outsider environments, including the dimmable lights that can reflect the shade of the moving bodies in front of them. In these kinds of programs, my definition of interaction, which involves understanding and reacting, is perfectly embodied because the LEDs understand the outside environment and recognize people out of all other elements and then react to it by showing the exact part with the human in front of them. We’re interested in making a device which can also interact with the environment. What is unique about our project is that the reflection to the outside environment is in real-time, which means it is interacting all the time. When it comes to the target audience and its usage, at first, we thought of many broad ways to put such device into practice, including a billboard that will adjust its brightness according to the environment and clothes that can change color. Then we came up with a usage that will add more social effect to this project. At present, there are children with color weakness who in our opinion don’t get enough social focus. Chameleon can serve as a recovery method to train these kids’ sensitiveness to colors.

To let the users understand what they are going to do in order to interact with the device, we print “feed me with the energy bar” on the top of the box and design a face on the front side of the box so that users are clear that they should throw in the color bars through the mouth. We also drew many circles on each side of the box except the top so that the color of light that LED shows can be observed directly.

We used laser cutting to make our box cover the components inside, and special paper that is originally used for Chinese painting as the cover on the holes on the box to let the light better penetrate out. We used the Legos as our “energy bars” instead of the color stick made by our own. We rejected the self-made color bars because they were made by paperboard and were wrapped by colored paper. The shape of them was not stable and the color saturation of wrapped paper was too low for the color sensor to detect precisely.

I think the most significant steps in our production process would be coding and welding different components. Because we bought some of the components online, for instance, the color sensor, we had to do abundant research to understand how these components work and their matching code in Arduino form. This step took us a lot of time and after the countless time of adaption to the code, the RGB belt finally started to shine. What added to the difficulty of debugging our code each time was the unstable connection between some of the components that were connected by welding. Sometimes the failure arose from the code, but sometimes it was because of the loose connection. It was time-consuming to distinguish the exact problem each time.

We intended to make a device that can show all colors within the RGB range to reflect the color that it sensed. However, during the user testing, we found out that the data the color sensor stored wasn’t stable at all which will lead to the continuous blink of the RGB light belt. To cope with this problem, I added a delay in the code to try to make the color it reflects stable for a while but this directly led to the inaccuracy of the device. To further understand what went wrong, I added the serial print code to let the port show the RGB index that it detected. Though this adaption made the device less interactive and rough, it was effective and rendered the device more precise feedback.

The goal of “chameleon” is to reflect the environment light by shining the same color it senses. This device can be used in the process of recovery by the groups of people who have the color weakness to train their sensitiveness of color. Except for this usage which can have a positive social impact, “Chameleon” can also have commercial usages. For example, it can be installed as part of the components of clothes to change its color, making the clothes a color-changeable design, or be used on the billboard which can adjust its brightness and color in response to the environment to let the content on the billboard more clear to see. Since my definition of interaction involves two or more subjects who react to others on the basis of understanding others’ meaning, “Chameleon” in my opinion successfully fits in my definition of interaction. The RGB belt and the outside environment make up the two subjects of interaction. The RGB belt will first “understand” the other by sensing the environmental light and then analyze the RGB index and respond to it by shining the light of the color. The audience interacts with the device by using different color bars to change the environmental light color it senses.

This version of “Chameleon” actually cannot play an important role in our lives because its function and colors are too limited. If I have more time, I would do further research on the color sensor and improve my coding so that the device not only can shine red, green, and blue light but all the colors it senses. From the process of making the color changeable device, we are impressed by the importance of coordination. Not only the seemingly most technical-commanding code matters, but the basic circuit and connection can also lead to failures. Only when each part of the system functions properly can the final work be done. Apart from the practical gain, I and my partner also developed the awareness that no matter how commercialized the goods or technology seems, there are always social functions that can be explored to benefit for the weak groups of the society.

Code:

#define LED_R 5 

#define LED_G 6 

#define LED_B 3 

#include <SoftwareSerial.h>

SoftwareSerial mySerial(8, 9);

byte rBuf[8] = {};

byte R[10] = {};

byte G[10] = {};

byte B[10] = {};

byte final_R = 0;

byte final_G = 0;

byte final_B = 0;

int hist_pos = 0;

byte buf = 0;

byte last = 0;

void setup()

{

  Serial.begin(9600);

  mySerial.begin(9600);

  pinMode(LED_R, OUTPUT);

  pinMode(LED_G, OUTPUT);

  pinMode(LED_B, OUTPUT);

}

void loop()

{

  if (mySerial.available() > 0) {

    buf = mySerial.read();

    if (buf == 90 && last == 90) {

      //read!

      //Serial.println(“head arrived”);

      while (mySerial.available() < 6) {

        //Serial.println(“wait for next 6 bytes”);

        delay(5);

      }

      mySerial.read();

      mySerial.read();

      R[hist_pos] = mySerial.read();

      G[hist_pos] = mySerial.read();

      B[hist_pos] = mySerial.read();

      mySerial.read();

      //Serial.println(“RGB arrived”);

      /*

      */

      hist_pos++;

      if (hist_pos == 10) {

        hist_pos = 0;

      }

      final_R = R[0];

      final_G = G[0];

      final_B = B[0];

      for (int i = 1; i < 10; i++) {

        if (R[i] > final_R) {

          final_R = R[i];

        }

        if (G[i] > final_G) {

          final_G = G[i];

        }

        if (B[i] > final_B) {

          final_B = B[i];

        }

      }

      Serial.print(“R=”);

      Serial.print(final_R);

      Serial.print(” G=”);

      Serial.print(final_G);

      Serial.print(” B=”);

      Serial.println(final_B);

      /*

        final_R = map(final_R, 75, 185, 0, 255);

        final_G = map(final_G, 120, 136, 0, 255);

        final_B = map(final_B, 70, 200, 0, 255);

        analogWrite(LED_R, 255 – final_R);

        analogWrite(LED_G, 255 – final_G);

        analogWrite(LED_B, 255 – final_B);

      */

      

      if (final_R > final_G && final_R > final_B) {

        Serial.println(“RED”);

        analogWrite(LED_R, 0);

        analogWrite(LED_G, 255);

        analogWrite(LED_B, 255);

      }

      else if (final_G > final_R && final_G > final_B) {

        Serial.println(“GREEN”);

        analogWrite(LED_R, 255);

        analogWrite(LED_G, 0);

        analogWrite(LED_B, 255);

      }

      else if (final_B > final_R && final_B > final_G) {

        Serial.println(“BLUE”);

        analogWrite(LED_R, 255);

        analogWrite(LED_G, 255);

        analogWrite(LED_B, 0);

      }

      

      delay(10);

    }

    last = buf;

  }

}

Leave a Reply