Halloween Forum banner

1 - 20 of 61 Posts

·
Registered
Joined
·
46 Posts
Discussion Starter · #1 ·
Just thought I'd share my version of the Alphabet "Message" Wall from Stranger Things. Finally got it finished! I'm pretty happy with how it came out. It's going to be a lot of fun for the Halloween party! These are WS2811 individually addressable LED's (C9 style bulb cover) controlled by an Arduino Uno. Thanks to Dyne for the guidance on this project.




 

·
Registered
Joined
·
110 Posts
Good job, Vater. It turned out great


That looks great, can you program it to spell words?
At the very least it can be hard coded. It spells out "Hi HF" in the video ('Hi, Halloween Forum"). I'm not sure what the ZE at the end was for, possibly a temporary end-sequence marker, or just the start of some other phrase.


If Vater based the code on the function I described in one of the earlier threads, then it's even more flexible. You could just stuff a phrase into a function like that and it will light up the correct lights, with short random pauses between words/letters.

However, it occurs to me that my code ignored the physical layout of the alphabet wall, as I wrote it with the mindset that the letters would all be in sequential order on the strand. These aren't. For one thing, judging by the plug at the top, these start at the end of the strand rather than the beginning, which makes sense. I also didn't account for any extra lights between lines or between certain letters (P and Q, for example), nor the fact that each line runs in the opposite direction from the previous.

A function consisting of a couple of if-then statements would take care of all of that. You'd supply the current letter as input, and the function would give the LED number as output. Just slice the alphabet up into convenient runs of letters: A-H, I-P, and R-Y and use those (or rather their ascii) in the conditionals. The oddballs, Q and Z, get conditionals as well.

For each group, you'd determine which LED to activate using a different formula. (Note: I habitually call these LEDs "pixels" because I'm used to Adafruit's neopixels.)

Something like this:

Code:
int chooseLED(char c) {
  if (c >= 65 && c<=72)    // A through H, which are at the end of the strand.
      return numpixels - (c - 65);   // Count from the end of the strand.  Assuming we have the letter D, (c-65) = 3.  
                                     // Assuming 50 pixels (numbered 0 to 49), D would be pixel number 46 (49 - 3)

  else if (c>=73 && c<=80)  // I through P
     return (numpixels - 21) + (c-73);    // numpixels - 21 gives us the position of the LED above I
                                          // then we add (not subtract) the distance to the exact letter from I.

  else if (c>=82 && c<=89)  // R through Y
     return (numpixels - 25) - (c-82);   // numpixels - 25 is R.  Then subtract c-82 to get the distance from R.

  else if (c==81)   // Q
     return numpixels - 12;

  else if (c==90)   // Z
     return numpixels - 34;

  else 
     return 0;   // If this pixel lights up, you know there are extraneous characters.
}
 

·
Registered
Joined
·
248 Posts
WOW!!!! This is incredible, nice work!!!! How difficult would you say this would be for someone who is not technically-inclined to do??
 

·
Registered
Joined
·
46 Posts
Discussion Starter · #5 ·
Good job, Vater. It turned out great


At the very least it can be hard coded. It spells out "Hi HF" in the video ('Hi, Halloween Forum"). I'm not sure what the ZE at the end was for, possibly a temporary end-sequence marker, or just the start of some other phrase.
Thanks! Yeah the "ZE" was just the start of a new message in my test...

EDIT 10/21: See JeffHass' post here for the most up-to-date code: http://www.halloweenforum.com/hallo...anger-things-alphabet-wall-5.html#post2030962

Here's the code I'm using:

Code:
include <FastLED.h>

template<typename T, size_t N> constexpr size_t countof(const T(&)[N]) { return N; }

CRGB leds[50];

CRGB colors[] = {
  0xEEEEEE,
  0xFFDD11,
  0x00BBFF,
  0xFF66FF
};

uint8_t index[countof(leds)];

void setup() {
  for (auto &color : colors) napplyGamma_video(color, 2.2);
  for (auto &i : index) i = random8(countof(colors));
  
  FastLED.addLeds<WS2812B, 6, GRB>(leds, countof(leds));
  FastLED.setBrightness(63);


  for (size_t i = 0; i < countof(leds); i++) leds[i] = colors[index[i]];
  FastLED.show();

  delay(5000);

  for (int i = 0; i < 128; i++) {
    if (random8() > ease8InOutQuad(i*2))
      FastLED.show();
    else
      // To prevent having to repopulate leds[], we
      // simply show black instead of clearing the array.
      FastLED.showColor(CRGB::Black);

    delay(33);
  }

  FastLED.clear();
}

void loop() {
  // Spaces are moved to before the message so that there's a pause
  // after the flicker. Could be replaced with a delay() in setup().
  write("   Hi Halloween Forum");
  write("   Another message");
}

int getIndex(char c) {
  c = toUpperCase(c);
  switch (c) {
    case 'A'...'H':
      return 50 - (c - 'A');

    case 'I'...'P':
      return 30 + (c - 'I');

    case 'Q':
      return 39;

    case 'R'...'Y':
      return 26 - (c - 'R');

    case 'Z':
      return 17;

    default:
      return 0;
  }
}

void write(char c) {
  if (isAlpha(c)) {
    // Get index and convert to 0-based indexing
    int i = getIndex(c)-1;
    
    leds[i] = colors[index[i]];
    FastLED.show();
    delay(750);
    
    leds[i] = CRGB::Black;
    FastLED.show();
    delay(250);
  } else if (isSpace(c)) {
    delay(1000);
  }
}

void write(const char *str) {
  while (*str) write(*str++);
}
 

·
Registered
Joined
·
46 Posts
Discussion Starter · #6 ·
WOW!!!! This is incredible, nice work!!!! How difficult would you say this would be for someone who is not technically-inclined to do??
I was able to pull this off with minimal electronics and coding experience. I'd give this a 6/10 in difficulty level for a beginner. Luckily I had people generous enough to help out with the code.

Here's a list of items needed for this project:

1) DC5V WS2811 LED String lights (strand of 50) -- C9 style bulbs
2) Arduino Uno controller
3) DC 9V power adapter for the Arduino
4) DC 5V adapter to power the lights
5) Female CCTV Power Plug Adapter
6) Male-to-male and male-to-female breadboard jumper cables
7) 300 to 500 Ohm resistor and 1000uf large capacitor (I'm currently not using these but they're recommended)
8) USB printer cable to upload the scripts (also called sketches) from your PC to the Arduino controller
9) Wallpaper or scene setter like the one I used
10) 3M command small hooks (clear plastic)
11) Black acrylic paint
12) Blu-tack, which will probably end up leaving oily spots on the walls :\

See this guide: https://learn.adafruit.com/adafruit-neopixel-uberguide/power

Once I got everything wired up, I downloaded the Arduino software (https://www.arduino.cc/en/Main/Software) to my Windows laptop. Then I installed the FastLED library, which includes a lot of "sketch" code examples to make your LED lights do cool effects. You have to make minor modifications to the code to set the amount of the LED's you have, the data pin you're using on the Arduino, etc.

There's also another version of an Alphabet Wall here with a write-up: https://www.sparkfun.com/news/2181 -- this one has code to allow your message wall to be controlled via twitter when specific hashtags are included.
 

·
Registered
Joined
·
110 Posts
Ah, cool. That getIndex function looks more or less like what I wrote earlier in the thread (though with switch-case statements, which I considered but didn't bother to do, because I constantly forget the syntax). Good to know I wasn't way off base with what I came up with with zero real testing.

As I looked at your function, I initially thought it confirmed that I was returning a few numbers that were off by one. Like where I return 16 (numpixels-34 is 50-34, or 16)** for Z, and you return 17. I'd already suspected that my code might have this issue (due to miscounting LEDs or whatever), and your code obviously worked. Then I thought to look for the function call and saw int i = getIndex(c)-1;

Don't judge me, I just woke up. :)


** I wrote my formulas using a (fake) "number of pixels" variable. The Adafruit library would provide the real thing. I don't know if FastLED does or not. If the real code were written this way then it would automatically account for expanding the LED strand to have more lights (or less, if you removed some of the extras). Maybe the Alphabet wall gets expanded to include punctuation, lowercase letters, numbers, and a couple of space invader sprites in "Stranger Things 2: Stranger Danger"
 

·
Registered
Joined
·
248 Posts
Thank you !!!! I showed this to husband and he doesn't feel confident he can do it...is the first link you posted the sort of step by step instructions? It didn't seem so to me, but maybe there's a "language" barrier!
 

·
Registered
Joined
·
2,049 Posts
very cool!!!! I first saw this on an email from fright props. didnt know it was from stranger things. Istarted watching the show because of this prop idea.

But you lost me at "encoding".
 

·
Registered
Joined
·
46 Posts
Discussion Starter · #14 ·
Dyne said:
Maybe the Alphabet wall gets expanded to include punctuation, lowercase letters, numbers, and a couple of space invader sprites in "Stranger Things 2: Stranger Danger"
Lol

Thank you !!!! I showed this to husband and he doesn't feel confident he can do it...is the first link you posted the sort of step by step instructions? It didn't seem so to me, but maybe there's a "language" barrier!
I wasn't confident either but I was able to figure it out with Dyne's help and another programmer. I say just buy the items so you can force yourselves to figure this out. It's not that hard, there's still plenty of time, and we'll be here to guide you along the way. Once you get the hang of this project, you're gonna want to start doing all sorts of lighting projects. I plan on using these lights for my Christmas tree in a few months. It's a great investment. :D Eventually I want to create light shows in the front of the house for Halloween and Xmas...like the light shows that you see go viral. Learning this stuff is going to be the basics to going to that level.

Most of the items needed can be found on Amazon.

Start by buying the lights: https://amzn.com/B01DZV3PNO

The Arduino Uno controller: https://amzn.com/B008GRTSV6

--These are the two biggest items to purchase.

The adapter I'm using to power the Arduino: https://amzn.com/B01COVIFYU

The adapter I'm using to power the lights: https://www.altex.com/Switching-Wall-Plug-In-AC-Power-Adapter-5VDC-4A-SPS5DC-4A-P149955.aspx

You can find other items like breadboard jumper cables at an electronics or computer shop. I'll post a picture of my arduino setup so you can see how it's wired up.

Pretty sure I stayed under $100 with everything I bought.

EDIT 10/21: See JeffHass' post here for the most up-to-date code: http://www.halloweenforum.com/hallo...anger-things-alphabet-wall-5.html#post2030962
 

·
Registered
Joined
·
110 Posts
Thank you !!!! I showed this to husband and he doesn't feel confident he can do it...is the first link you posted the sort of step by step instructions? It didn't seem so to me, but maybe there's a "language" barrier!
The first link that Vater posted was to Adafruit's neopixel guide. It's more of a "things you need to know about these LEDs" guide than a step-by-step manual. The primary things to take away from it are that you can't expect to power 50 LEDs straight off of the Arduino's 5V output -- they'll need a separate power supply -- and the correct usage of the capacitor and resistor.


Vater has already given the working code, so that shouldn't be an issue for anyone.

Hardware wise, this is the wiring diagram that I made, mostly to illustrate how you need a common ground wire going from the Arduino to the LED power supply (it's the black wire connected to the Arduino). But it does show the main wiring for this sort of setup (click for full size):




The wiring diagram doesn't show what the actual LED connector looks like (it actually looks like a three wire plug on the end of a christmas light string). I just picked a random RGB LED strip object in Fritzing in order to illustrate the connections.

The diagram includes the capacitor but omits the resistor. As Vater indicates, these two parts aren't strictly required, they just protect the LEDs from power surges (like when you power up the system). In fact, the LEDs may or may not already have the resistor built in.

But they are both super simple. The resistor would be wired in between the yellow wire and the LEDs (in other words, in series with the wire, physically nearest to the first LED). The capacitor connects across the terminals of the LED power supply. Polarity matters with electrolytic capacitors like the part used here, so the trick is to make sure that the negative lead of the capacitor is connected to the negative or ground terminal of the power supply, and the other lead to the positive terminal. Connect those backwards, and it will likely turn into a small firecracker (and an ex-capacitor, shortly thereafter).

This also doesn't show the power supply for the Arduino. Vater uses a 9V wall wart plugged into the round DC socket. In my arduino projects I've tended to use 5V power via the USB port, supplied by my PC when uploading and testing code, and supplied by a mobile phone power bank or a phone charger in the actual project. Any of these methods works.


As always when dealing with electricity, just be careful, don't get in a rush, and when in doubt, ask or do some more research.


Most of the items needed can be found on Amazon.

Pretty sure I stayed under $100 with everything I bought.
If folks are willing to wait a week or four for shipping, and don't mind dealing with Chinese companies/products/quality control, they can probably lower that a bit.

I've seen Uno clones that are a less than a quarter of the price of the official product (and I've bought Nano clones for $3). Since Arduino is an open design, clone boards are legit. Breadboard jumpers can be had for 0.75 for a pack of 40, shipped. And so forth.

eBay and Aliexpress are especially good places to look for cheap electronics, but you can find some on Amazon too. (All three sites have buyer protection policies.)
 

·
Registered
Joined
·
46 Posts
Discussion Starter · #17 ·
Do I have to use LED lights? Can I use incandescent string lights?
This project cannot be done with just any set of traditional string incandescent lights. I suppose it's possible but would require a lot of time and hacking. They have to be individually addressable LED's ("pixels"). Google WS2811 or WS2812 string led's. All of the individually addressable strings you'll find these days are LED-based.

Rather than spend $40 for the 50-led string WS2811 lights, this guy chose to do it the hard way for the more realistic vintage look: https://www.youtube.com/watch?v=ZkAxEGFXsic

In my case my party guests wont be able to tell the difference since it'll be dark.
 

·
Registered
Joined
·
2,049 Posts
this is such a cool idea. it really warrant a tutorial especially since it involves codeing which is greek at least to me.
I suppose it wont be long till spirit make a cheap version with limited ability.
 

·
Registered
Joined
·
2,049 Posts
Lol



I wasn't confident either but I was able to figure it out with Dyne's help and another programmer. I say just buy the items so you can force yourselves to figure this out. It's not that hard, there's still plenty of time, and we'll be here to guide you along the way. Once you get the hang of this project, you're gonna want to start doing all sorts of lighting projects. I plan on using these lights for my Christmas tree in a few months. It's a great investment. :D Eventually I want to create light shows in the front of the house for Halloween and Xmas...like the light shows that you see go viral. Learning this stuff is going to be the basics to going to that level.

Most of the items needed can be found on Amazon.

Start by buying the lights: https://amzn.com/B01DZV3PNO

The Arduino Uno controller: https://amzn.com/B008GRTSV6

--These are the two biggest items to purchase.

The adapter I'm using to power the Arduino: https://amzn.com/B01COVIFYU

The adapter I'm using to power the lights: https://www.altex.com/Switching-Wall-Plug-In-AC-Power-Adapter-5VDC-4A-SPS5DC-4A-P149955.aspx

You can find other items like breadboard jumper cables at an electronics or computer shop. I'll post a picture of my arduino setup so you can see how it's wired up.

Pretty sure I stayed under $100 with everything I bought.
how many strings of 50 lights did you use for the wall?
 

·
Registered
Joined
·
110 Posts
how many strings of 50 lights did you use for the wall?
From the code, 1 string ("CRGB leds[50];")

You only need 26 letters, after all. There are a few extras here and there, but most of the 24 that aren't letters would be after the letter Z.
 
1 - 20 of 61 Posts
Top