Flash Fire Night Light

Hi! This my final project!

The materials I used are as follows:

1.Arduino UNO board

2.color strip

3. wool felt fabric

4.9V battery

At first, when I put the pixel light strip to computer, I find that my whole light strip just

lights six lights which make me crazy. And my computer often pop-ups the warning:

Image

Finally, Becky and Tak help me to solve that problem, the reason why there is only six lights light is that the 60 pixels at full brightness draws a lot if power, and Tak helps me to change Arduino UNO board from the flora board.

As my conception, I need to use the match to ignite the fire. However, I realized that the motion sensor need to move like change the X/Y/Z axis constantly. But my fire can`t move! After that, I figure out  to use the resistant to turn on the fire. I make a code which I just touch sightly to the resistant, and than the fire can be ignited!

QQ截图20131008003117

IMG_0776 IMG_0780 IMG_0783

Image

ImageImage

Image

I use the embroidery machine to make a fire logo on the surface of my matchbox.

This is the code:

#include <Adafruit_NeoPixel.h>

#define PIN 6

// Parameter 1 = number of pixels in strip
// Parameter 2 = 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 strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
strip.begin();
strip.show(); // Initialize all pixels to ‘off’
}

void loop() {
int n=analogRead(A0); //读取模拟口数据
if(n>0) //如果人体触摸了N就不为零,触发
{
for(int a=0;a<50;a++) //循环50次,200毫秒X50次=10秒 亮灭亮灭持续10秒效果
{
colorWipe(strip.Color(255, 0, 0), 0); // Red 亮
delay(100);//延迟100毫秒
colorWipe(strip.Color(0, 0, 0), 0); // noLight 灭
delay(100);//延迟100毫秒
}
}
colorWipe(strip.Color(0, 0, 0), 0); // noLight
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}

void rainbow(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256; j++) {
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i+j) & 255));
}
strip.show();
delay(wait);
}
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r – g – b – back to r.
uint32_t Wheel(byte WheelPos) {
//if(WheelPos < 85) {
return strip.Color(WheelPos * 3, 255 – WheelPos * 3, 0);
//} else if(WheelPos < 170) {
// WheelPos -= 85;
// return strip.Color(255 – WheelPos * 3, 0, WheelPos * 3);
//} else {
// WheelPos -= 170;
// return strip.Color(0, WheelPos * 3, 255 – WheelPos * 3);
// }
}

Please enjoy the amazing video!!!

http://www.youtube.com/watch?v=IPZyzRi0vVY&list=HL1381207377