Introduction: BLU - a Wearable Sensor/status Bracelet
This project was undertaken as I was applying for Intel's "Make it Wearable" contest (https://makeit.intel.com/).
Trailer of that contest:
----------------------------------
Although I did not win I decided to try to build my idea. While the idea is not so simple here it is summarized [also see video]: a wearable device that has embedded sensors to monitor your environment and give you feedback/information on certain parameters and most prominently the quality of air and water.
This is only step one: designing a simple bracelet that displays the status of anything with embedded LEDs in a nice light diffusing 3D printed casing. Hopefully later down the road I'll be able to achieve the final goal as described in the BLU video.
Step 1: The Casing
The original design is the white 3D printed bracelet - it was too fragile and turned out quite ugly...
The second try; a much simpler design worked quite well. Simple arcs with a hollow portion in the middle. There is the main body and the cover. The design is very solid, and diffuses the light. It may not look super classy - but it ain't too bad either!
Step 2: Light Diffusion
To have a nice and diffused light I utilized a few different tricks:
- I used Suguru (http://www.adafruit.com/products/436). A little dab of white suguru on each LED and the light was much "softer".
- I put a layer of white paper inside the walls of the bracelet and transparent (opaque) tape on the paper.
Step 3: The Electronics
The electronics are very simple:
- Arduino Gemma ( http://www.adafruit.com/gemma ) [although any mini Arduino will do!]
- Lithium cell battery
- 3 or more Neopixels (http://www.adafruit.com/products/1260)
And they all nicely fit into the casing!
For the battery, any battery should do... but I have a preference for lithium as they are small, hold a decent charge, are easy to get and have the ability to be recharged.
Step 4: The Code
Here is code I wrote for it. It's pretty strait-forward and simple.
- It uses the following Arduino library: https://github.com/adafruit/Adafruit_NeoPixel
- For a lot of tutorials and further tips on Neo-pixels, this page is quite useful: https://learn.adafruit.com/adafruit-neopixel-uberg...
----------------------------------
#include
//requires library from https://github.com/adafruit/Adafruit_NeoPixel
//arbitrary PIN for now
#define PIN 2
#define WAIT 20 //milliseconds off time between next color
#define SEQLEN 5 //memory of array = how many colors?
#define SEC 1000 //millis in a second
#define NUMPIXELS 10
#define PI 3.14159
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel light = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
//color sequence
//define each element using light.Color(R,G,B) function.
uint32_t WHITE = light.Color(255,255,255);
uint32_t RED = light.Color(255,0,0);
uint32_t GREEN = light.Color(0, 255,0);
uint32_t BLUE = light.Color(0,0,255);
uint32_t YELLOW = light.Color(255,215,0);
uint32_t colors[SEQLEN] = {
WHITE, RED, YELLOW, GREEN, BLUE};
//how long each color.
uint32_t colortime[SEQLEN] = {
10*SEC, 6*SEC, 6*SEC, 6*SEC, 6*SEC};
unsigned long t0 = 0;
void setup(){
Serial.begin(9600);
/* colors[0] = WHITE;
colors[1] = RED;
colors[2] = YELLOW;
colors[3] = GREEN;
colors[4] = BLUE;
*/
light.begin();
light.show();
}
void loop(){
for(int bulb = 0; bulb < SEQLEN; ++bulb){
Serial.println("Setting new bulb");
Serial.print(colors[bulb]);
Serial.print("\t");
Serial.println(colortime[bulb]);
t0 = millis();
delay(1);
unsigned long t = millis()-t0;
while(colortime[bulb] - t*1. > 0){
light.setBrightness(int(255*sin(PI*t/colortime[bulb])));
for(int pixel = 0; pixel < NUMPIXELS; ++pixel){
light.setPixelColor(pixel, colors[bulb] );
}
delay(10);
t = millis()-t0;
Serial.println(colortime[bulb] - t*1.);
light.show();
}
// delay(colortime[bulb]);
#if WAIT
for(int pixel = 0; pixel < NUMPIXELS; ++pixel){
light.setPixelColor(0,0);
}
light.show();
delay(WAIT);
#endif
}
}
Attachments
Step 5: Results & Further Additions
Later down the road as time and funds become available I'm going to add Bluetooth (perhaps with one of these? http://www.adafruit.com/products/1697).
And then comes the tricky part: the sensors! But in the mean time it looks wicked cool :) ! [see video]
Tips and ideas are welcome!
Participated in the
Epilog Challenge VI
Participated in the
Battery Powered Contest