Introduction: Color Changing Case
A guide on how to recreate our color changing case
Step 1: Case Interaction Video
Step 2: Problem Statement
Most people buy many phone cases, just because of the simple fact that they want cases in an assortment of colors. What we have designed is a phone case that will change color to the consumer’s choice of color. This is done by using a piece of cloth on the inside of the case that has LED lights on it, covered by a piece of clear plastic. There would be a color light sensor which uses RGB values to detect the given color and then changes the color of the case to that color.
Step 3: Overview of How It Works
The case consists of multiple parts: the 3D printed case, the arduino + FLORA sensor + RGB LEDs + sensor switch, and the portable battery.
The FLORA sensor is wired to the Lilypad Arduino, along with a string of 8 LEDs. The arduino is then programmed to recognize the sensor and LEDs and use the two to interact between each other. The sensor switch does not need to be programmed because it is just used to open/close the power to it. When the switch is turned to the ON position, the FLORA sensor is accompanied by a bright LED. Whenever the sensor is held up to a color it can recognize, the RGB value it senses is then sent to the LEDs which light up in unison. Once the desired color is achieved, the sensor switch can be turned off to lock in the color. The portable battery must be charged and connected to the arduino for the device to function correctly.
Step 4: List of Materials and Tools
-FLORA - WEARABLE ELECTRONIC PLATFORM: ARDUINO-COMPATIBLE https://www.adafruit.com/product/659
-FLORA COLOR SENSOR WITH WHITE ILLUMINATION LED https://www.adafruit.com/product/1356
-FLORA RGB SMART NEOPIXEL VERSION 2 - PACK OF 4 https://www.adafruit.com/product/1356
-PREMIUM MALE/MALE JUMPER WIRES - 40 X 6" (150MM) https://www.adafruit.com/product/1356
-iNiCE 3000mAh Ultra Slim Mini Power Bank Charger External Battery Pocket Size with Built in Lightning (MFi) and Micro USB Cable for iPhone,Samsung,HTC and More ---Gray https://www.adafruit.com/product/1356
-Light Diffusing material
3D printer with PLA filament
Step 5: Link to Code
Step 6: Download Arduino
Step 7: Download Color Sensor Libraries
Go to https://learn.adafruit.com/adafruit-color-sensors/use-it and follow the direction to download the Iibrary.
Step 8: Download the Neopixel Library
Go to https://learn.adafruit.com/flora-rgb-smart-pixels/run-pixel-test-code and follow the directions to download the library.
Step 9: Test the Arduino
You now need to do testing on the flora board to insure that it works. Since you download the library, you should be able to open up arduino and go to files, then examples, then open Adafruit_Motor_Shield_Library, and then to MotorTest. Run the code to insure that there are no issues. If there are issues you probably did not download the neopixel library right and need to go back and check to see if you missed any steps. Now hook up your Flora board to your computer and upload the code, make sure you are on the right port you need to be on. After up loading this to the board you should see the LED on the board start turning different colors.
Step 10: Testing the FLORA Sensor
You need to hook up the color senor with the alligator clips to the Flora board and run a color test. To test the sensor you need to run the TCS34725 to do this you you go to file, then example, then open Adafruit TCS34725, and then colorview. Run the code to make sure it works right, and upload it to your board. Now you should be able to put any color over it and it should change that color, also you should open up a port so you can see the color sensor outputs by downloading processing. This is also a good time to see what colors work and what colors don't work and what colors the sensor struggles with.
Step 11: Testing the LEDs
Now that you have the flora and the color sensor working check each light to make sure each light works. To do this hook up one LED to the flora board use alligator clips also hook up the color sensor to flora board with alligator clips. Now go to file, examples, Adafruit_NeoPixel and then strandtest. Run this code on every light one at a time, also change the color of the light when you test it to ensure it work right. Now that you known everything works it’s time to put it all together to test. To test all lights you’ll need to solder because the alligator clips become unreliable as you add on more lights.
Step 12: Soldering
Soldering the Flora Color Sensor solder wire to FLORA Board with...
GND to GND
SCL to SCL
SDA to SDA
3V to AE*E
Soldering Switch to FLORA...
one side of switch to 9
other side of switch to GND
The FLORA solder wire to FLORA RGB SMART NEOPIXEL….
GND to –
VBATT to +
The FLORA solder a resistor to FLORA RGB SMART NEOPIXEL….
Db 6 to arrow pointing towards led
FLORA RGB SMART NEOPIXEL to FLORA RGB SMART NEOPIXEL….
- to –
+ to +
Arrow point away from led to arrow point towards the led
Step 13: Adding the Code
Go to https://github.iu.edu/ise-e101-F17/TeamBot-Swany/wiki/Design-Process and copy and paste the code into Arduino. Run the code to make sure there are no errors, we added a button into this code. The button enables you to turn the color senor off and on as you please that way you can change the color of the case without turning the whole case off and on. Note that because you don't have the button solder on there the color senor will be on for 3 seconds and then turn off. After the button is on you don't have to change the code to make the button work it will automatically.
We have a be nice policy.
Please be positive and constructive.