This project uses an Arduino 101, a strip of addressable LEDs, foam-core and cardstock paper to create a phone-controllable animated Shadow Theater. The electronics are used non-destructively, so you can easily use them later for another project. Here's a handy Sparkfun wishlist with 99% of the electronics.
How it works:
One strip of addressable LEDs is wrapped over a piece of foam-core in the middle of the Shadow Theater. The lights near the bottom are slowly fired in sequence and shine through pinholes to create an animated shadow. Lights further up are channeled into the buildings on top, and the last LED on the strip is used to shine on the whole scene, creating the main shadow.
The Arduino 101 has a Bluetooth radio built-in, and I use a quick prototyping app called Blynk to remotely control the scene. In the example code you can control the colors in the buildings, turn on a flickering fire, and control the brightness of the main shadow light.
Part One: Setting up the ElectronicsStep 1
Collect the end harness from your LED strip by cutting about 1 cm from the end of the lights. Strip the wire ends.
Step 2
Break apart the bent header pins that came with your voltage regulator, and solder two of them to the ends of the green and yellow wires. This will let you easily plug them into the pins of the Arduino 101.
Step 3
Next solder the red wire to the VIN terminal on the Voltage Regulator, and solder two straight headers into the GND and VOUT pins as shown.
Step 4
Now connect the barrel jack adapters. First strip the ends of the wires coming from your battery case, then mount them in the terminals of the male barrel jack and tighten with a screwdriver. RED goes to the (+) terminal, BLACK goes to the (-) terminal.
Next connect the female barrel jack adapter onto to the loose wires coming from the beginning of the LED strip. YELLOW goes to the (-) terminal, and RED goes to the (+).
Step 5
Now connect your harness to the Arduino 101. The GREEN wire goes to PIN 6, the YELLOW wire goes to the GND pin near #13.
With the two header pins on the voltage regulator, GND goes to GND and VOUT goes to the "Vin" pin on the Arduino 101. Don't get this wrong! Plugging in backwards leads to smells and burns. I know this.
Print the foam-core pattern on regular printer paper (4 sheets) and print out the cardstock pattern on cardstock paper (4 sheets.)
Step 1
Take the printed foam-core pattern pages and use them to cut out your foam-core pieces. You can lay a pattern on the foam-core, then lightly trace the outline with a hobby knife to transfer the lines through.
Step 2
Once you have the pieces cut, start by assembling the LED strip holder like so:
Now take your LED strip and attach the first LED to the bottom with tape or hot glue, and wrap your LEDs as shown. The idea is to keep the LED strip intact. It doesn't need to be a super tight wrap.
Once you've made three wraps, leave the tail end free and secure the top with tape or hot glue.
Step 3
This LED strip has addressable LEDs, meaning you can more or less say, "hey, you in the middle, turn red!" But they don't answer to "hey you," so you need to know their numbers.
The LEDs below the crease will shine out the back of the Shadow Theater and be used for animation. In the example below, my animation lights are 0, 1, 2, 20, 21, 22, 40, 41, 42. Two LEDs in the top section will shine up into the houses. I use LED 23 to shine up into the back house, and 25 to simulate firelight in the front houses.
Count out your LEDs and draw a simple reference map that makes sense to you so you can enter appropriate LED numbers into the code later. Remember to start your count at the beginning of the strip starting with zero, because computers.
Step 4
Glue the LED holder down onto the foam-core bottom piece. Position it as shown and so the wide stripe of lights is roughly centered lengthwise with the base.
Now add the curved foam-core side pieces on the ends with hot glue as shown.
Step 5
Now add the light dividers and the foam-core top piece. The light dividers keep the animation lights from spilling up into the houses, and vice-versa. Position the largest divider close to the crease in the LED holder, and position the smaller divider above it so at least one LED is between them (see photos below.) Position the top piece so it's square with the base as shown in the slideshow below and secure with hot glue.
Step 6
Attach the end of the LED strip to the front top edge with hot glue so the last LED in the string can shine on the scene. This is the main shadow LED.
Connect a USB programming cable to the Arduino 101, and connect the LED strip, battery pack and Arduino 101 all together (leave the power switch on the battery pack to "off.")
You'll need the Arduino IDE installed on your computer, with the Intel Curie Core (see Arduino 101 getting started.) You'll also need to install the Adafruit Neopixel library, and the Blynk library.
If you're new to Arduino, it's a good idea to run some basic example sketches to be sure everything's working OK.
Step 1
Install the Blynk app on your phone.
Blynk is a great tool for rapid proof-of-concept building and remote controlling your Arduino 101. BLE support still has some bugs, but Blynk is by far the fastest way I've found to control any Arduino 101 project from a phone.
Step 2
Load the example code in your Arduino IDE and change the LED pixel numbers if necessary using the map you made earlier.
The program animates through the LED numbers in the "pos[ ]" array to create the illusion of falling snow. Change these numbers if needed to match your setup, (the animation LEDs are the ones below the crease on your LED holder.) Arrange the numbers in the order you want them to fire. The lights project through pinholes to make the "snow," so lighting from the bottom to top will make snow appear to fall down, left to right will make snow appear to blow from right to left.
//#snow animation lights
int pos[] = {0, 1, 2, 20, 21, 22, 40, 41, 42};
Next set how many pixels will animate
//#how many animation pixels are in the array above?
int numLeds = 9;
Then set the pixel that is at the end of the strand shining on the scene (on a 60 pixel strip, this is pixel #59.)
//#main shadow-casting LED at the end of the strand.
int shadowPixel = 59;
Choose a pixel for the lights that will shine up into the rear house. This pixel should be between the two light dividers.
//#pixel for the lights in the rear house
int lightHousePixel = 23;
Finally, set the number of the pixel that will be shining up into the front houses to be the "fire pixel." This pixel should be just in front of the smaller light divider.
//#Pixel for flickering firelight in the front houses
int firePixel = 24;
When the code above is changed as needed, you can compile and upload to your Arduino 101. Once the code is successfully uploaded, disconnect your USB cable and turn the power switch on the battery pack to "on." You should see the shadowPixel turn on, and the animation pixels will light in sequence. The house and fire pixels will be off until you control them with Blynk.
Step 3
Loading your Blynk app:
Open the Blynk app on your phone and press the "scan" button near the upper right. Scan this QR code and the controller interface should automatically load and you'll be all set.
When loaded, the interface should look like this:
If you prefer to build your Blynk interface manually instead of scanning the code above, start with with a BLE widget and 3 sliders set to output 0-100 to VO, V1 and V2.
Step 4
Connect over BLE to your Arduino 101. Tap the BLE widget and if your Arduino 101 is powered on, you should see "ShadowTheater." Connect, then hit the "play" arrow icon in the upper right to control your project. You may need to reconnect after your phone goes to sleep.
OK all done with the hard stuff, now on to crafting! You can turn everything off until the final reveal.
Part Four: Card stock silhouettes, buildings, and final touchesStep 1
Find your four printed card-stock sheets. Using a hobby knife and fresh blades, cut out the background silhouette. Change the blade frequently! Cutting with a dull blade is super frustrating. I changed the blade 3 times cutting out this silhouette.
Step 2
Cut out the house pieces and attach the backs with hot glue. The printed sides should face back, so you can't see any ink from the front. Scroll through the photos below.
Step 3
Add the houses to the stage. You can use hot glue or tape. Try to close all gaps so the light goes into the houses but doesn't spill around the sides.
Step 4
Now fold the sides of the silhouette sheet and attach the bottom to the back edge of the stage with hot glue. (face the printed side away from the viewer.)
Step 5
Cut out a snow scene to project on the wall behind the shadow theater. You can use pins or toothpicks, or cut out intricate shapes. Once the sheet is done, hot glue it to the curved edges to create a projection surface.
Step 6
Attach the left side and front sheets with hot glue.
Loosely attach the right side sheet with tape, so you can still get at the inside to turn the power on and off at the battery case.
All done! Find a dark area with a wall nearby to try it out! When you first turn the power on, the Shadow Theater should cast a scene shadow and falling snow. With the Blynk app, you can control the main light, and the lights in the buildings.
Comments