Project showcase

Programmable Stranger Things Light Wall Costume

An Arduino powered Stranger Things light wall costume that can be controlled via Bluetooth serial connection to a cell phone.

  • 3,865 views
  • 6 comments
  • 18 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

This little album details my Stranger Things light wall halloween costume.

The costume uses an Adafruit LED strand, Arduino Nano, Bluetooth receiver, battery and other components to allow the shirt to be wearable and accept different messages and light patterns. The instructions are sent from a Bluetooth terminal on my phone over a serial connection to the Arduino Nano. Some cobbled together Arduino code runs the whole thing.

The LEDs are sewn onto a simple beige sweater and connect to an enclosure I made to house the power and electronics.

Commands are sent using a Bluetooth terminal on my cellphone. I personally use one titled 'Bluetooth Terminal' from the Google Play Store but any Bluetooth serial terminal that can send text strings should suffice. Sending a text string adds it to the buffer to be spelled out. Sending '*' resets the text to blank for a new message. The following commands run a few patterns I programmed into the costume:

'%' = 3 blinks, '&' = Random blinks, '$' = Rapid blinks, '#' = Cascade

**The code only works with lower case letter input atm**

The electronics are housed in a small 3D printed enclosure of my design. A little bit of custom PCB work handles the interconnects from the Arduino nano to the Bluetooth module and LED strand. See the schematic section for more info.

Code

Light Wall Costume Arduino CodeArduino
This code is used to handle character inputs over serial terminal to the Arduino. Based on the input the lights will run a variety of functions or add the characters to a buffer to spell out. **Input currently has to be lower case character strings** The following are commands sendable from a serial terminal:

'char string' = add string to buffer and spell out on each loop
'*' = clear character buffer
'%' = constant rate 3 blinks
'&' = increasing rate blink
'$' = random blinks
'#' = cascade
/* Prototype for haloween costume 2016, read input string from serial and perfrom action character by character with delay */
// Built from StringLength Arduino example and Adafruit StrandTest example

#include "Adafruit_WS2801.h"
#include "SPI.h" // Comment out this line if using Trinket or Gemma

#define ONDELAY 750
#define OFFDELAY 500

String txtMsg = "welcome";    // Initialize default string for incoming text
uint8_t dataPin  = 3;    // Yellow wire on Adafruit Pixels
uint8_t clockPin = 2;    // Green wire on Adafruit Pixels
Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);

// Array to handle colors of alphabet, 3 element subarrays represent rgb
const int colors[26][3] {
  {255, 100, 0}, // a
  {0, 100, 255}, // b
  {255, 0, 100}, // c
  {100, 255, 0}, // d
  {0, 100, 255}, // e
  {255, 100, 0}, // f
  {255, 0, 100}, // g
  {100, 255, 0}, // h
  {0, 100, 255}, // i
  {255, 0, 100}, // j
  {0, 100, 255}, // k
  {100, 255, 0}, // l
  {255, 100, 0}, // m
  {255, 0, 100}, // n
  {255, 0, 100}, // o
  {100, 255, 0}, // p
  {255, 0, 100}, // q
  {100, 255, 0}, // r
  {255, 100, 0}, // s
  {255, 100, 0}, // t
  {0, 100, 255}, // u
  {255, 0, 100}, // v
  {0, 100, 255}, // w
  {255, 100, 0}, // x
  {255, 0, 100}, // y
  {255, 0, 100}, // z
};

// Array to transpose incoming ascii positions to corresponding positions in light fixture
const int charPos[25] {
  19, //A
  20, //B
  21, //C
  22, //D
  23, //E
  24, //F
  18, //G
  17, //H
  16, //I
  15, //J
  14, //K
  13, //L
  12, //M
  5, //N
  6, //O
  7, //P
  8, //Q
  9, //R
  10, //S
  11, //T
  4, //U
  3, //V
  2, //W
  1, //X
  0, //Y
};

void setup() {
  
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  strip.begin();

  // Update LED contents, to start they are all 'off'
  strip.show(); // write all pixels out
}

// Create a 24 bit color value from R,G,B
uint32_t Color(byte r, byte g, byte b) {
  uint32_t c;
  c = r;
  c <<= 8;
  c |= g;
  c <<= 8;
  c |= b;
  return c;
}

// Program to step through string character by character and perform an action 
void printChar(String input) {

  for (int i = 0; i < input.length(); i++) {
    int pos = (((int)input[i]) - 97);
    // Get color from colors array 
    // Subtract one from pos to properly index charPos Array
    strip.setPixelColor(charPos[pos], Color(colors[pos][0], colors[pos][1], colors[pos][2]));
    strip.show();
    delay(ONDELAY);
    strip.setPixelColor(charPos[pos], Color(0, 0, 0));
    strip.show();
    delay(OFFDELAY);
  }
}

// Function to blink all lights at constant speed
void blinkConst(void) {
  
  int blinkCount = 0;
  int i;
  
  while (blinkCount < 3) {
    for (i = 0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Color(colors[i][0], colors[i][1], colors[i][2]));
    }
    strip.show();
    delay(ONDELAY);
    for (i = 0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Color(0, 0, 0));
    }
    strip.show();
    delay(OFFDELAY);
    blinkCount++;
  }
}

// Function to blink all lights at variable speed
void blinkVar(int speed) {

  int i;
  
  for (i = 0; i < strip.numPixels(); i++) {
     strip.setPixelColor(i, Color(colors[i][0], colors[i][1], colors[i][2]));
  }
  strip.show();
  delay(speed);
  for (i = 0; i < strip.numPixels(); i++) {
    strip.setPixelColor(i, Color(0, 0, 0));
  }
  strip.show();
  delay(speed);
}

// Function to blink all lights randomly
void blinkRandom(int speed) {

  int i, randomNum;

  for (i = 0; i <= 50; i++) {
    randomNum = random(strip.numPixels());
    strip.setPixelColor(randomNum, Color(colors[i][0], colors[i][1], colors[i][2]));
    strip.show();
    delay(speed);
    strip.setPixelColor(randomNum, Color(0, 0, 0));
    strip.show();
    delay(speed);
  }
}

// Function to blink all lights in a row
void blinkRow(int speed) {

  int i;
  
  for (i = 0; i < strip.numPixels(); i++) {
    strip.setPixelColor(charPos[i], Color(colors[i][0], colors[i][1], colors[i][2]));
    strip.show();
    delay(speed);
  }
  for (i = 0; i < strip.numPixels(); i++) {
    strip.setPixelColor(i, Color(0, 0, 0));
  }
  strip.show();
}

// Main program body, loop checks for new serial input and runs functions based on character input or default print function
void loop() {
  
  // Set string to incoming text
  while (Serial.available() > 0) {
    delay(10);
    char inChar = Serial.read();
    if(inChar == '*'){  // Clear string using '*' input
      txtMsg = "";
    } 
    else if (inChar == '%'){  // Run other functions using specified inputs
      blinkConst();
    }
    else if (inChar == '&'){  // Run other functions using specified inputs
      for (int i = 500; i >= 50; i -= 50)
      {
        blinkVar(i);
      }
    }
    else if (inChar == '$'){  // Run other functions using specified inputs
      blinkRandom(50);
    }
    else if (inChar == '#'){  // Run other functions using specified inputs
      blinkRow(50);
    }
    else {  // Other wise add input serial character to cleared string
    txtMsg += inChar;
    }
  }

  //blinkBlink();
  printChar(txtMsg);
}

Custom parts and enclosures

Electronics Enclosure
Enclosure to house Arduino, BT receiver, UBEC and interconnections.
Lid for enclosure

Comments

Similar projects you might like

Stranger Blinks: Send Messages from the Upside-Down

Project tutorial by Luigi Francesco Cerfeda

  • 3,424 views
  • 1 comment
  • 10 respects

Arduino Audio Reactive Desk Light

Project tutorial by Haziq Azri

  • 12,578 views
  • 5 comments
  • 30 respects

Simple wall clock using Adafruit 1/4 60 Ring Neopixel

Project tutorial by antiElectron

  • 6,691 views
  • 0 comments
  • 34 respects

Programmable Pocket Power Supply with OLED Display

Project tutorial by Shahariar

  • 6,324 views
  • 6 comments
  • 28 respects

Magic Cauldron

Project showcase by Ian McKay

  • 5,801 views
  • 3 comments
  • 21 respects
Add projectSign up / Login