Home Creators Posts Import Register Favorites Logout

Content

Hi folks! I hope you're all well. Here's a new escape room puzzle tutorial for you, which is all about LED strips (specifically WS2812B strips, commonly known as "Neopixels"). These amazing things are strips of individually-addressable LEDs which, with a little Arduino code and a 5V power supply, you can specify exactly what LED you want to light up, and what RGB colour you want it to have. They're frequently used to create flashy chase sequences or pretty puzzle decoration, but in this tutorial they're actually at the heart of the puzzle mechanic itself. 

LED particles of different colours are spawned at the top of the track at regular intervals, and players must flick the correct toggle switches to guide them down through the various segments of strips to the matching elemental symbol at the bottom (similar to the way that a set of points are used to direct a train on a railway track). Once a certain number (configurable in code) of matching particles have been received at the end of each track, the puzzle is solved, and e.g. a relay can be activated releasing a maglock and granting players access to the next part of the escape room.

This puzzle is a hi-tech puzzle which could be themed to match many escape room scenarios - the LED particles could represent trains on a railway, packets of data on a computer network, or energy required to power a mysterious alien device, for example. It is easy to customise, and requires relatively little hardware, all of which can be purchased online for well under $50 (see links below).

Timings

00:00-02:22 Introduction and Demonstration

02:23-07:19 Explanation of Components Used

07:20-10:41 Wiring Diagram

10:42-52:10  Arduino Code

52:11- Wrapup, Theming, Customisation, and Accessibility

Hardware

In terms of hardware, this project is actually pretty straightforward. I'm using:

1x Arduino Nano (you could use pretty much any sort) ~$5 from e.g. https://www.banggood.com/custlink/KvKDUmhTqI

3 metres of WS2812B ("Neopixel") LED strips ~$15 from e.g. https://www.banggood.com/custlink/3G3KMmYfzN

1x 5V 40A Power supply ~$20 from e.g. https://www.ebay.co.uk/itm/DC-5V-24V-Universal-Regulated-Switching-Power-Supply-1A-60A-10W-480W-LED-3D-PSU/372784363144

4x Toggle Switches ~$5 from e.g. https://www.banggood.com/custlink/GmD3UDhuuG

2x 10V 1000uF capacitors

1x 330Ω resistor

Software

The software - i.e. the Arduino code - is where all the magic happens in this project. I'll explain all the code line-by-line in the video, but it includes some relatively advanced coding concepts, including:

Custom C struct to define the related properties of each particle

Multidimensional arrays to describe the track of LEDs

Object pooling to avoid creation/destruction of objects at runtime (bad for memory management of constrained-memory devices like Arduinos) 

Sub-pixel animation to create smooth transition between LEDs

That's quite a lot to take in, so please don't worry if you don't get it on the first go through! I'll put up the code download in a separate post shortly for Patreons to download, and I've tried to comment it as thoroughly as possible so do take your time as you work through it - and as always please ask if any questions! If you adapt this to your own projects, I'd strongly recommend jotting down on a piece of paper exactly how your network of LEDs is connected and indidually numbered, in much the same way as I did in the comments at the top of the code - you'll find it really helpful if you need to debug behaviour later!

I hope you like it!

Files

LED Track DIY Escape Room Puzzle Tutorial

In this video tutorial, I'll teach you how to build an escape room puzzle that requires players to guide LED particles down a series of "tracks". Particles of different colours appear at the top of the track at regular intervals, and players must flick the correct toggle switches to direct them to the matching elemental symbol (similar to the way that a set of points are used to direct a train on a railway track). Once a certain number (configurable in code) of matching particles have been received at the end of each track, the puzzle is solved, and e.g. a relay can be activated releasing a maglock and granting players access to the next part of the escape room. This puzzle is a hi-tech puzzle which could be themed to match many escape room scenarios - the LED particles could represent trains on a railway, packets of data on a computer network, or energy required to power a mysterious alien device, for example. It is easy to customise, and requires relatively little hardware, all of which can be purchased online for well under $50 (see links below). 00:00-02:22 Introduction and Demonstration 02:23-07:19 Explanation of Components Used 07:20-10:41 Wiring Diagram 10:42-52:10 Arduino Code 52:11- Wrapup, Theming, Customisation, and Accessibility In terms of hardware, this project is actually pretty straightforward. I'm using: - 1x Arduino Nano (you could use pretty much any sort) ~$5 from e.g. https://www.banggood.com/custlink/KvKDUmhTqI - 3 metres of WS2812B ("Neopixel") LED strips ~$15 from e.g. https://www.banggood.com/custlink/3G3KMmYfzN - 1x 5V 40A Power supply ~$20 from e.g. https://www.ebay.co.uk/itm/DC-5V-24V-Universal-Regulated-Switching-Power-Supply-1A-60A-10W-480W-LED-3D-PSU/372784363144 - 4x Toggle Switches ~$5 from e.g. https://www.banggood.com/custlink/GmD3UDhuuG - 2x 10V 1000uF capacitors - 1x 330Ω resistor The software - i.e. the Arduino code - is where all the magic happens in this project. I'll explain all the code line-by-line in the video, but it includes some relatively advanced coding concepts, including: - Custom C struct to define the related properties of each particle - Multidimensional arrays to describe the track of LEDs - Object pooling to avoid creation/destruction of objects at runtime (bad for memory management of constrained-memory devices like Arduinos) - Sub-pixel animation to create smooth transition between LEDs The code is extensively commented, and available for subscribers to download (alongside the wiring diagram etc.) from my Patreon page: https://www.patreon.com/playfultech You can see more of my escape room tech tutorial projects here: https://www.youtube.com/watch?v=3Zn6D0731MQ&list=PLogiUurtMYtR2Hf0-eg8-K2E9uRtpWzWV

Comments

Graham Wood

Hi Alistair, is it possible to add a reset on some of your projects, it's not possible to press the reset on the Arduino when everything is hidden, I find this an issue on a few of your projects, many thanks

Быхун Алексей

Hello. I immediately apologize for my English, since I am from Ukraine, I translated using Google. I decided to implement your project "LED Track DIY Escape Room Puzzle Tutorial". at the very beginning of the work everything is fine, but then individual track LEDs blink, and then the LEDs stop moving from the middle of the track. Perhaps I made a mistake somewhere or what is the reason? I spent a lot of time and resources on the project. I hope you can help me fix this problem. Video problems: https://drive.google.com/file/d/1EUl_fYfgupS-lx-xx35LmPTCG7i2Gh1B/view?usp=drive_link

Nick Scott

Is it possible to change the speed of the led track?

Encrypted Escape

Hi, I just joined, where can I get the code?

Patrick Bonin

Nice Job !! Anxious toget the code

Hal Woods

Hope all is well with you and yours! I was thinking of making this larger. Could i use 2811 individually addressable string lights vs 2812B strip lights? Would this be possible?

David Schrempf

Alastair, just completed the wiring using WS2811 5v RGB strings, 100 LEDS instead of the strips. it kinda works, but problem I have is a strange one.. the 5 lights per color rail is inconsistent on my build white rail runs on 5 leds lit, the blue rail runs at 4, yellow 4, red 3, and green 2 down the puzzle. Any ideas if this is code related? I'm using a nano and its powered by a 5v 20 AMP power source.

Hal Woods

I did it with the 2811 three wire lights. It worked great. I bought the ones for 15 dollars for 50 lights on eBay

Greg Pare

Hi There! I get this error message when trying to send code to either Nano or Uno......Thoughts? exit status 1 Error compiling for board Arduino/Genuino Uno.

Greg Pare

Here's the latest message: Still trying!!!! Anyone? In file included from /Users/gregpare/Documents/Arduino/libraries/FastLED-3.3.2/noise.h:4:0, from /Users/gregpare/Downloads/LEDTrack_Puzzle/LEDTrack_Puzzle.ino:1: /Users/gregpare/Documents/Arduino/libraries/FastLED-3.3.2/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.002 # pragma message "FastLED version 3.003.002"

Óliver Novelles

Hi. Can I do it with a four wires LED strip? What may I change?

tropp73

Where is it possible to find code?

Дмитрий Попов

Hi Alastair! Can you help me a little with your code, pls? Planning to add this puzzle to escape room, but got a little problem. I need to cover puzzle with diffusing glass to hide all wires etc. But i need to leave tracks visible. Best way to do it is make leds a little glow with any color on 10-15% of brightness. Is it possible? Can you help me with this, please? ^^

RJ Hemy

Is it possible to use a 3 pole switch on the 2 way split so that if it is in the center and off, the light just dead ends and goes away?

Alba Fleutot

Hello Alistair and everyone coming this way who could help me ! The track doesn't work after 60 leds, and I'm starting to wonder if it's a power supply issue... So I was wondering : did you use 2 different power supply or is the "additional 5v" we can see on the fritzing project from the same source ?