Sunday, May 6, 2018

Build and Final Test

Building and Final Test

I have taken several steps in order to make my backpack a successful project. I decided to sketch out how I wanted to place the LED's on the bag. I also decided to sketch out the circles that I wanted to incorporate on the bag. I decided that I wanted the LED's to remain connected to illustrate an illuminated chase of light. Here's a list of items needed to build my bag:

1. painters tape
2. needle
3. white thread
4. container for Arduino
5. speaker wire tubing
6. rechargeable power supply


I wanted to re-engineer the clear backpack because it came with mesh pockets on either side of it that I felt were too distracting. I removed the mesh and began to shape the bag. The bag arrived via Amazon smashed in a box. 


I needed to measure the LED's to their corresponding sides of the backpack. I decided that labeling the cut length LED's should be numbered in order to keep there exact placement exact. I drew out the circle and began to cut individual LED sections from the strip and place them an approximate distance in order to make a circle. I also had to solder the power, ground and data wires to each individual LED to create a chain that would then be reconnected to the other two strips that I have now cut and set aside.


I now had to secure the LED's to the backpack by utilizing the painter's tape. Once, I had all the LED's in place and tape, I began to sew the LED's down to the backpack with white thread in order to keep the bag as translucent as possible and minimize any distracting colors or objects.


Once, I got the LED's sewed in, I needed to install the power supply and Arduino case (I found a portable drive case to use as the Arduino case) to the bag. I plugged everything in and I got no reaction. Oh, no...


The LED's are not working. It would seem that I somehow crossed the power wire from the circle to the main strip with the ground wire. I was very lucky to discover that this mistake did not blow out the LED strip or cause a surge in my Arduino Uno. I found the bad connection and resoldered the strip. 


Yureka, it works. The strip, code, Arduino, and radar are all working harmoniously. 
Somehow in my journey, I plugged the sensors power jumper into the 5V port on the Arduino and the LED's power jumper into the 3.3V port. I was happy that this did not cause a burnout but I discovered during my final critique in class that it was causing the Arduino to shut off everytime the LED's would fire off the first time. Thank you, Thomas, for pointing this exhausting error out. By putting the LED's on the 5V port and the sensor on the 3.3V port, my project fired up once it detected movement. Success...I am including the final code on the bottom and the final video of it working as well. Thanks for reading and viewing ...Please keep an eye out for backpack version 3 here in the future.

Here's the code:
#include <Adafruit_NeoPixel.h>
#define PIN 3
#define NUM_LIGHTS  80
// revised by Slem Lucio May 2nd, 2018
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LIGHTS, PIN, NEO_GRB + NEO_KHZ800);
const int mwPin = 2;     // the number of the pushbutton pin
      // the number of the LED/Buzzer pin

// variables will change:
int mwState = 0;         // variable for reading the pushbutton status
int motionCount = 0;     // variable 

void setup() {
  // initialize the LED pin as an output:
  pinMode(PIN, OUTPUT);
  // initialize the pushbutton pin as an input:
  //pinMode(buttonPin, INPUT);
  attachInterrupt(0, handler, CHANGE);

void loop() {
  // Nothing to see here :)

// The handler is called via interrupt and does all the hard work
void handler() {
  // read the state of the pushbutton value:
 uint32_t low = strip.Color(0, 0, 0); 
    uint32_t high = strip.Color(255, 255, 255);
  mwState = digitalRead(mwPin);

  // check if the Microwave sensor is HIGH.
  // if it is, set the ledPin HIGH and report the count
  if (mwState == HIGH) {
    // turn LED on:   
    digitalWrite(PIN, HIGH);
    Serial.print("Motion: ");
for( int i = 0; i<NUM_LIGHTS; i++){
        strip.setPixelColor(i, high);;
for( int i = 0; i<NUM_LIGHTS; i++){
        strip.setPixelColor(i, low);;
  }    else {
    // turn LED off:
    digitalWrite(PIN, LOW);

Please feel free to visit my Instructables

Here's the video:

No comments:

Post a Comment