Stranger Things Lights


I know for sure I’m not the only one that liked the idea of using a led strip and program it to only light up some of them to display a message. And of course I thought that would be cool to have that in an escape game.

So I bought one from Amazon and using an Arduino Uno and a RaspberryPi I managed to make it work.

This is what the result looks like (my canvas is quite ugly but the important part is the proof of concept):

Here’s how:
My raspberry will be giving the text to display to the arduino (connected to the raspberry via USB) that will manage the led strip.
It is possible to remove the arduino and do everything in python, but I didn’t find any library that does the same job as FastLED.
And since the arduino is powered by the raspberry, it’s not that much of an inconvenience.

This is how I wired the led strip to the arduino.
The control wire is connected to arduino pin 6 (the white one on the picture), the blue one to the ground.
The DC adapter + is connected to the red wire, the blue one to the ground (-).
The raspberry is connected to the arduino using a simple USB to mini USB cable.

On the raspberry, it’s quite easy to setup a serial connection with the arduino using Python:

import serial, time
arduino = serial.Serial('/dev/ttyACM0', 9600)
time.sleep(5) # Wait a little to ensure serial connection has been made
arduino.write("HELLO WORLD\n")

Next is the code on the arduino.
I use the FastLED library that is available from the Arduino Library Manager.
Here’s my sketch:

#include <FastLED.h>
#define DATA_PIN 6 // This is the data pin on the arduino on which you connected the led strip
#define NUM_LEDS 50 // Change this number according to the number of leds in your strip
#define BRIGHTNESS 255 // You can change the brightness of the leds if you want to

String letterIndex = "A-B-C-D-E-F-L-K-J-I-H-G-M-N-O-P-Q-R-ZY-X-WV-U-T-S- "; // My led strip has 50 leds, the alphabet only 26 (roughly half), so I'll use only one led every two
// Note that there is a space at the end. In my case I assigned the last led to the "space" character, but you don't have to.
// If you want to use the 26 first leds, your index will be "ABCDEFGHIJKLMNOPQRTUVWXYZ------------------------"

void setup() {
  Serial.begin(9600); // Setting up the serial connection with the raspberry
  // Setting up the FastLED library for the led strip
  FastLED.addLeds<WS2811, DATA_PIN>(leds, NUM_LEDS);

void lightLED(int ledIndex, uint32_t colorValue, int duration) {
  leds[ledIndex] = colorValue;; // Turn on the led n°<ledIndex> with the color <colorValue>

  delay(duration); // Let's pause during <duration> milliseconds to give people time to read the letter

  leds[ledIndex] = CRGB::Black; // Black color means led is turned off;

void displayLetter(String theLetter, int letterDuration) {
  int lightIndex = letterIndex.indexOf(theLetter); // Get the number of the led on the strip that we assigned to the letter <theLetter>
  uint32_t colorValue = 0x841852; // The color value as hexadecimal RGB, this one is purple
  lightLED(lightIndex, colorValue, letterDuration); // Call the method above

void writeWord(String theword, int letterDuration, int letterSpacing) {
  // Split the message to display in letters, and for each one turn it on, wait a little and turn it off
  int stringLen = theword.length() + 1;
  char char_array[stringLen];
  theword.toCharArray(char_array, stringLen);
  for (int i=0 ; i < stringLen - 1 ; i++) {
    displayLetter(String(char_array[i]), letterDuration); // Call the method above
    delay(letterSpacing); // Number of milliseconds to wait between the previous letter is turned off and the next letter is turned on

void loop() {
  if (Serial.available()) {
    String text = Serial.readStringUntil('\n'); // Wait until a text is sent by the raspberry
    writeWord(text, 1000, 300); // Write the text
  delay(100); // Wait a little before checking the serial input again

Admin area