Techno-Tiki RGB LED Torch
2018-01-30 | By Adafruit Industries
License: See Original Project Arduino
Courtesy of Adafruit
Guide by Tony DiCola
Techno-Tiki RGB LED Torch
Turn a Tiki torch into a beautiful animated LED light display.
Aloha! Are you looking for a beautiful decoration for late summer parties, camping trips, or festivals? The techno-tiki torch project is the perfect way to set the mood with LED torches that glow and animate in any color. These lights are built from a Gemma and NeoPixel strip placed inside a mason jar that's filled with diffuse material. The jar slides right into a bamboo tiki torch and turns it into a techno-tiki torch that glows with cyber-Hawaiian ambiance. And since this torch has no flames it's safe to use anywhere, even indoors! Light up the dark with the fun colors and style of the techno-tiki torch.
UPDATE October 2017: There's now a version of the techno tiki torch that uses Circuit Playground Express! This version has IR remote control built-in using Circuit Playground Express' IR receiver. You don't even need to solder NeoPixels to the board as it uses the 10 pixels built-in to Circuit Playground Express too! Check out the repository for the techno tiki code to get the Circuit Playground Express version and load it on your board using the Arduino IDE!
To follow this project it will help to familiarize yourself with the following guides first:
Overall this is an easy project that can be built in an afternoon. There's a small amount of soldering to connect NeoPixels, Gemma, and an IR receiver. Continue on to learn about the parts needed to build the project.
Parts
You'll need the following parts to build this project:
Gemma - You can use either the Arduino Gemma or Adafruit Gemma board for this project.
UPDATE October 2017: You can also use Circuit Playground Express as an all-in-one board to build this project with no other soldering or assembly. Grab the Circuit Playground Express board and load the necessary code from the next section--that's it!
NeoPixel Strip - You'll need a strip of about 6-10 NeoPixel LEDs. If you have a 1-meter length of the 30 LED NeoPixel strip you can cut off a small section of the strip.
A 16oz mason jar works best with a 6 pixel strip, and a 32oz mason jar works with a 10 pixel strip.
Tiki torch - Look for plain bamboo tiki torches like shown to the left as they likely fit mason jars without any modification. Check the outdoor or seasonal section of department or hardware stores for tiki torches. Use a mason jar to check how well it fits in the torch if you can before purchasing.
Tiki brand 'The Original' tiki torches worked best in my testing and didn't require any modifications to hold a 16 or 32oz regular mouth mason jar.
IR Receiver - To use IR remote control with the tiki torch you'll need an IR receiver that's tuned to receive 38khz signals.
IR control is optional--if you choose not to use it then skip adding the IR receiver to your project. Without the IR receiver you will only be able to program one animation to constantly run on the tiki torch.
Remote control - To use IR control in your tiki torch make sure to use this micro remote control. This remote sends NEC IR remote control codes which the project software can recognize. Because of code size constraints only NEC IR codes are supported by the software for this project.
Battery - A lithium ion battery is recommended as it's small but still able to light power hungry NeoPixels. A 2200 mAH or 2500 mAH battery will run bright animations for about 5 hours, and stay in off/sleep mode up to about a week. Don't use a battery smaller than about 1000 mAH or else you'll only get an hour or less of bright animations.
Make sure you have a battery charger too, like the Micro Lipo charger.
Soldering tools - You'll need to solder wires to the IR receiver, NeoPixel strip, and Gemma. You'll also want heatshrink wrap to protect the soldered connections on the IR receiver.
Mason Jar - Look for a regular mouth mason jar in either 16oz or 32oz size. You can typically find mason jars at any grocery, department, or craft store however they are available online too. Clear glass jars work great, but you can experiment with colored or even patterned jars. Don't use a wide mouth jar as it's too large to fit inside a typical tiki torch without modification!
Vase filler material - Look for a small, clear vase filler material like tiny clear beads or plastic rods. The smaller the material the better as it will fill in the space of the jar and better diffuse the light of the pixels. Be careful not to use a metal or conductive filler material that might short electric connections. This crystal fill product worked well in my testing.
Soldering
Follow the steps below to solder the hardware in the project. If you're new to soldering be sure to read the guide to excellent soldering.
Note the IR receiver is optional. If you choose not to use the IR receiver then ignore the instructions that deal with assembling and connecting it to the Gemma. Without the IR receiver you will only be able to program one animation to constantly run instead of being able to control animations with the remote control.
Cut your NeoPixel strip down to the size you'd like to use for your torch. For a 16oz mason jar a strip of 6 NeoPixels (from the 30 pixels per meter strip) works great, and for a 32oz mason jar 10 NeoPixels are best. Make sure to only cut the NeoPixel strip on the line with exposed solder pads between pixels.
Start by soldering wires that are about 3-4" long to the NeoPixel strip and IR receiver. It's easiest to 'tin' each wire and pin by heating them with the iron and touching with solder to leave a thin layer of solder on the part. Then hold the tinned parts together and heat them with the iron to flow the solder again and fuse the parts.
Make sure to solder to the end of the NeoPixel strip with the arrow pointing towards the pixels (the signal line can only flow in one direction on a NeoPixel strip).
Add heatshrink to the connections on the IR receiver to prevent them from touching and shorting out.
Next solder the NeoPixel strip and IR receiver to the Gemma as shown below:
- NeoPixel strip ground to Gemma GND/ground.
- NeoPixel strip Din to Gemma D1.
- NeoPixel strip +5V to Gemma Vout.
- IR receiver signal pin (left-most pin when receiver is facing you) to Gemma D2.
- IR receiver ground pin (middle pin) to Gemma GND/ground.
- IR receiver power pin (right-most pin when receiver is facing you) to Gemma 3Vo.
Once the parts are soldered together gently bend the IR receiver so it's facing behind the Gemma, and the NeoPixel strip so it forms a U shape as shown below.
Continue on to learn how to install the Arduino sketch that controls the hardware.
Software
Installation
Before you install the software for this project you'll need to make sure you're running the latest Arduino IDE 1.6.x version. In addition you'll need to install the Adafruit NeoPixel library using either the library manager (recommended) or a manual installation. Once you have the Arduino IDE and NeoPixel library setup, click the button below to download the Arduino sketches for this project from their home on GitHub:
Unzip the file and you should see three Arduino sketches:
Techno_Tiki_No_Remote_Control - This sketch is for a hardware setup that does not use the IR receiver and remote control.
Techno_Tiki_With_Remote_Control - This sketch is for a hardware setup that uses the IR receiver and remote control.
Techno_Tiki_Circuit_Playground_Express - This sketch is for a hardware setup using the Circuit Playground Express board. Be sure to follow the Circuit Playground Express guide to setup the Arduino IDE to load the board and install the necessary Circuit Playground library first!
Open the appropriate sketch in the Arduino IDE.
Configuration
If you're using a remote control there are some configuration settings you can change at the top of the Techno_Tiki_With_Remote_Control sketch:
// Sketch configuration:
#define PIXEL_PIN 1 // Pin connected to the NeoPixel strip.
#define PIXEL_COUNT 6 // Number of NeoPixels. At most only about 100 pixels
// can be used at a time before it will take too long
// to update the pixels and IR remote codes might be
// missed.
#define PIXEL_TYPE NEO_GRB + NEO_KHZ800 // Type of NeoPixel. Keep this the default
// if unsure. See the NeoPixel library examples
// for more explanation and other possible values.
#define IR_PIN 2 // Pin connected to the IR receiver.
// Adafruit IR Remote Codes:
// Button Code Button Code
// ----------- ------ ------ -----
// VOL-: 0x0000 0/10+: 0x000C
// Play/Pause: 0x0001 1: 0x0010
// VOL+: 0x0002 2: 0x0011
// SETUP: 0x0004 3: 0x0012
// STOP/MODE: 0x0006 4: 0x0014
// UP: 0x0005 5: 0x0015
// DOWN: 0x000D 6: 0x0016
// LEFT: 0x0008 7: 0x0018
// RIGHT: 0x000A 8: 0x0019
// ENTER/SAVE: 0x0009 9: 0x001A
// Back: 0x000E
#define COLOR_CHANGE 0x000A // Button that cycles through color animations.
#define ANIMATION_CHANGE 0x0008 // Button that cycles through animation types (only two supported).
#define SPEED_CHANGE 0x0005 // Button that cycles through speed choices.
#define POWER_OFF 0x0000 // Button that turns off/sleeps the pixels.
#define POWER_ON 0x0002 // Button that turns on the pixels. Must be pressed twice to register!
In particular change the PIXEL_COUNT value from 6 to the appropriate number of NeoPixels used in your hardware (like 10, etc.).
Notice you can change which remote control buttons control the sketch by adjusting the COLOR_CHANGE, ANIMATION_CHANGE, SPEED_CHANGE, POWER_OFF, and POWER_ON values at the bottom. For now keep the default values but be aware you can change them based on the remote codes in the comments above.
If you're not using a remote control there's a different set of configuration values you can change in the Techno_Tiki_No_Remote_Control sketch:
// Sketch configuration:
#define PIXEL_PIN 1 // Pin connected to the NeoPixel strip.
#define PIXEL_COUNT 6 // Number of NeoPixels.
#define PIXEL_TYPE NEO_GRB + NEO_KHZ800 // Type of NeoPixel. Keep this the default
// if unsure. See the NeoPixel library examples
// for more explanation and other possible values.
#define SPEED_MS 100 // Animation speed (in milliseconds). This is how
// long to spend in a single animation frame. Higher
// values are slower. Good values to try are 400, 200,
// 100, 50, 25, etc.
#define ANIMATION 0 // Type of animation, can be one of these values:
// 0 - Solid color pulse
// 1 - Moving color pulse
Change the PIXEL_COUNT value from 6 to the number of pixels used in your hardware (like 10, etc).
In addition you can adjust the speed and type of animation by changing the SPEED_MS and ANIMATION values. Read the comments to see how these values will change the animation behavior. Remember there is no remote control so the only way to change animation is by adjusting the sketch and uploading it to the hardware again.
You can also choose the animation color in this part of the sketch:
// Color animation values. Each value is a 24-bit RGB color value that will be displayed
// at that current step in the animation. Make sure only ONE row is uncommented below!
const int colorSteps = 8; // Number of steps in the animation.
const uint32_t colorAnimation[colorSteps] PROGMEM =
// Complimentary colors
//{ 0xFF0000, 0xDA2424, 0xB64848, 0x916D6D, 0x6D9191, 0x48B6B6, 0x24DADA, 0x00FFFF }; // Red-cyan
//{ 0xFFFF00, 0xDADA24, 0xB6B648, 0x91916D, 0x6D6D91, 0x4848B6, 0x2424DA, 0x0000FF }; // Yellow-blue
//{ 0x00FF00, 0x24DA24, 0x48B648, 0x6D916D, 0x916D91, 0xB648B6, 0xDA24DA, 0xFF00FF }; // Green-magenta
// Adjacent colors (on color wheel).
{ 0xFF0000, 0xFF2400, 0xFF4800, 0xFF6D00, 0xFF9100, 0xFFB600, 0xFFDA00, 0xFFFF00 }; // Red-yellow
//{ 0xFFFF00, 0xDAFF00, 0xB6FF00, 0x91FF00, 0x6DFF00, 0x48FF00, 0x24FF00, 0x00FF00 }; // Yellow-green
//{ 0x00FF00, 0x00FF24, 0x00FF48, 0x00FF6D, 0x00FF91, 0x00FFB6, 0x00FFDA, 0x00FFFF }; // Green-cyan
//{ 0x00FFFF, 0x00DAFF, 0x00B6FF, 0x0091FF, 0x006DFF, 0x0048FF, 0x0024FF, 0x0000FF }; // Cyan-blue
//{ 0x0000FF, 0x2400FF, 0x4800FF, 0x6D00FF, 0x9100FF, 0xB600FF, 0xDA00FF, 0xFF00FF }; // Blue-magenta
//{ 0xFF00FF, 0xFF00DA, 0xFF00B6, 0xFF0091, 0xFF006D, 0xFF0048, 0xFF0024, 0xFF0000 }; // Magenta-red
// Other combos.
//{ 0xFF0000, 0xDA2400, 0xB64800, 0x916D00, 0x6D9100, 0x48B600, 0x24DA00, 0x00FF00 }; // Red-green
//{ 0xFFFF00, 0xDAFF24, 0xB6FF48, 0x91FF6D, 0x6DFF91, 0x48FFB6, 0x24FFDA, 0x00FFFF }; // Yellow-cyan
//{ 0x00FF00, 0x00DA24, 0x00B648, 0x00916D, 0x006D91, 0x0048B6, 0x0024DA, 0x0000FF }; // Green-blue
//{ 0x00FFFF, 0x24DAFF, 0x48B6FF, 0x6D91FF, 0x916DFF, 0xB648FF, 0xDA24FF, 0xFF00FF }; // Cyan-magenta
//{ 0x0000FF, 0x2400DA, 0x4800B6, 0x6D0091, 0x91006D, 0xB60048, 0xDA0024, 0xFF0000 }; // Blue-red
//{ 0xFF00FF, 0xFF24DA, 0xFF48B6, 0xFF6D91, 0xFF916D, 0xFFB648, 0xFFDA24, 0xFFFF00 }; // Magenta-yellow
// Solid colors fading to dark.
//{ 0xFF0000, 0xDF0000, 0xBF0000, 0x9F0000, 0x7F0000, 0x5F0000, 0x3F0000, 0x1F0000 }; // Red
//{ 0xFF9900, 0xDF8500, 0xBF7200, 0x9F5F00, 0x7F4C00, 0x5F3900, 0x3F2600, 0x1F1300 }; // Orange
//{ 0xFFFF00, 0xDFDF00, 0xBFBF00, 0x9F9F00, 0x7F7F00, 0x5F5F00, 0x3F3F00, 0x1F1F00 }; // Yellow
//{ 0x00FF00, 0x00DF00, 0x00BF00, 0x009F00, 0x007F00, 0x005F00, 0x003F00, 0x001F00 }; // Green
//{ 0x0000FF, 0x0000DF, 0x0000BF, 0x00009F, 0x00007F, 0x00005F, 0x00003F, 0x00001F }; // Blue
//{ 0x4B0082, 0x410071, 0x380061, 0x2E0051, 0x250041, 0x1C0030, 0x120020, 0x090010 }; // Indigo
//{ 0x8B00FF, 0x7900DF, 0x6800BF, 0x56009F, 0x45007F, 0x34005F, 0x22003F, 0x11001F }; // Violet
//{ 0xFFFFFF, 0xDFDFDF, 0xBFBFBF, 0x9F9F9F, 0x7F7F7F, 0x5F5F5F, 0x3F3F3F, 0x1F1F1F }; // White
// Rainbow colors.
//{ 0xFF0000, 0xFF9900, 0xFFFF00, 0x00FF00, 0x0000FF, 0x4B0082, 0x8B00FF, 0xFFFFFF };
By default a red-yellow animation will be used with the sketch. However you can comment the red-yellow line and uncomment a different line to change the animation. Remember only one line should be uncommented! If you have multiple lines uncommented then you'll receive an error trying to compile the sketch.
For example to change to the rainbow color animation at the end you would change the section to look like:
// Color animation values. Each value is a 24-bit RGB color value that will be displayed
// at that current step in the animation. Make sure only ONE row is uncommented below!
const int colorSteps = 8; // Number of steps in the animation.
const uint32_t colorAnimation[colorSteps] PROGMEM =
// Complimentary colors
//{ 0xFF0000, 0xDA2424, 0xB64848, 0x916D6D, 0x6D9191, 0x48B6B6, 0x24DADA, 0x00FFFF }; // Red-cyan
//{ 0xFFFF00, 0xDADA24, 0xB6B648, 0x91916D, 0x6D6D91, 0x4848B6, 0x2424DA, 0x0000FF }; // Yellow-blue
//{ 0x00FF00, 0x24DA24, 0x48B648, 0x6D916D, 0x916D91, 0xB648B6, 0xDA24DA, 0xFF00FF }; // Green-magenta
// Adjacent colors (on color wheel).
//{ 0xFF0000, 0xFF2400, 0xFF4800, 0xFF6D00, 0xFF9100, 0xFFB600, 0xFFDA00, 0xFFFF00 }; // Red-yellow
//{ 0xFFFF00, 0xDAFF00, 0xB6FF00, 0x91FF00, 0x6DFF00, 0x48FF00, 0x24FF00, 0x00FF00 }; // Yellow-green
//{ 0x00FF00, 0x00FF24, 0x00FF48, 0x00FF6D, 0x00FF91, 0x00FFB6, 0x00FFDA, 0x00FFFF }; // Green-cyan
//{ 0x00FFFF, 0x00DAFF, 0x00B6FF, 0x0091FF, 0x006DFF, 0x0048FF, 0x0024FF, 0x0000FF }; // Cyan-blue
//{ 0x0000FF, 0x2400FF, 0x4800FF, 0x6D00FF, 0x9100FF, 0xB600FF, 0xDA00FF, 0xFF00FF }; // Blue-magenta
//{ 0xFF00FF, 0xFF00DA, 0xFF00B6, 0xFF0091, 0xFF006D, 0xFF0048, 0xFF0024, 0xFF0000 }; // Magenta-red
// Other combos.
//{ 0xFF0000, 0xDA2400, 0xB64800, 0x916D00, 0x6D9100, 0x48B600, 0x24DA00, 0x00FF00 }; // Red-green
//{ 0xFFFF00, 0xDAFF24, 0xB6FF48, 0x91FF6D, 0x6DFF91, 0x48FFB6, 0x24FFDA, 0x00FFFF }; // Yellow-cyan
//{ 0x00FF00, 0x00DA24, 0x00B648, 0x00916D, 0x006D91, 0x0048B6, 0x0024DA, 0x0000FF }; // Green-blue
//{ 0x00FFFF, 0x24DAFF, 0x48B6FF, 0x6D91FF, 0x916DFF, 0xB648FF, 0xDA24FF, 0xFF00FF }; // Cyan-magenta
//{ 0x0000FF, 0x2400DA, 0x4800B6, 0x6D0091, 0x91006D, 0xB60048, 0xDA0024, 0xFF0000 }; // Blue-red
//{ 0xFF00FF, 0xFF24DA, 0xFF48B6, 0xFF6D91, 0xFF916D, 0xFFB648, 0xFFDA24, 0xFFFF00 }; // Magenta-yellow
// Solid colors fading to dark.
//{ 0xFF0000, 0xDF0000, 0xBF0000, 0x9F0000, 0x7F0000, 0x5F0000, 0x3F0000, 0x1F0000 }; // Red
//{ 0xFF9900, 0xDF8500, 0xBF7200, 0x9F5F00, 0x7F4C00, 0x5F3900, 0x3F2600, 0x1F1300 }; // Orange
//{ 0xFFFF00, 0xDFDF00, 0xBFBF00, 0x9F9F00, 0x7F7F00, 0x5F5F00, 0x3F3F00, 0x1F1F00 }; // Yellow
//{ 0x00FF00, 0x00DF00, 0x00BF00, 0x009F00, 0x007F00, 0x005F00, 0x003F00, 0x001F00 }; // Green
//{ 0x0000FF, 0x0000DF, 0x0000BF, 0x00009F, 0x00007F, 0x00005F, 0x00003F, 0x00001F }; // Blue
//{ 0x4B0082, 0x410071, 0x380061, 0x2E0051, 0x250041, 0x1C0030, 0x120020, 0x090010 }; // Indigo
//{ 0x8B00FF, 0x7900DF, 0x6800BF, 0x56009F, 0x45007F, 0x34005F, 0x22003F, 0x11001F }; // Violet
//{ 0xFFFFFF, 0xDFDFDF, 0xBFBFBF, 0x9F9F9F, 0x7F7F7F, 0x5F5F5F, 0x3F3F3F, 0x1F1F1F }; // White
// Rainbow colors.
{ 0xFF0000, 0xFF9900, 0xFFFF00, 0x00FF00, 0x0000FF, 0x4B0082, 0x8B00FF, 0xFFFFFF };
Upload
Once you've configured the sketch for your hardware you're ready to upload it to the Gemma board. Before you upload make sure you've setup the Arduino IDE to program Gemma. In the Tools -> Board menu select the Arduino Gemma board (you can use this option even if you're using the Adafruit Gemma boards). Also in the Tools -> Programmer menu select the USBtinyISP option.
Make sure the Gemma's USB micro/mini connector is connected to your computer. If your Gemma board has an on/off switch slide it into the on position. Press the reset button on the Gemma and you should see its red light start pulsing as the bootloader waits for a sketch to be uploaded. In the Arduino IDE press the upload button or use the Sketch -> Upload command. After a few moments you should see the sketch uploaded to the hardware (on Linux systems you might see broken pipe errors that can be ignored).
If you receive an error be sure to read the Gemma guide and confirm you can upload a basic LED blinking sketch.
If you're using more than 6 LEDs you might not see them light up because they can draw more current than some USB ports provide. Unplug the Gemma from your computer and plug in the lithium ion battery. Ensure the Gemma on/off switch is in the on position (if your Gemma has a switch). Verify that the Gemma board turns on and after it waits a few seconds in the bootloader (with a pulsing red LED) it should turn on all the LEDs and start animating.
If you're using an IR receiver and remote control check that you can control the hardware behavior with the remote control. Point the remote control at the front of the IR receiver. By default the sketch is programmed to use these buttons on the remote:
- Vol- - This turns off the hardware and puts it into a low power sleep mode where it draws about 11mA of current (compared to ~200+ mA while animating pixels).
- Vol+ - When the hardware is in low power sleep mode press this button twice to turn it back on into full power mode. Remember you need to press the button twice.
- Up Arrow - This cycles through the animation speeds.
- Left Arrow - This cycles through the two different types of animation.
- Right Arrow - This cycles through the different colors of animation.
Try pressing the buttons and verify they work as expected. If the buttons aren't working make sure the remote control has a fresh battery and the plastic tab is removed which protects the battery during shipping. Also ensure the IR receiver is correctly connected to the Gemma (its signal line must be on pin D2). Note that with Circuit Playground Express you need to hold the remote control very close to the board as its IR receiver sensitivity through the glass beads/vase filler isn't as good as a stand-alone sensor.
Once your hardware is working you're ready to move on to finish assembling the project.
Assembly
Once you've soldered the hardware together and uploaded the sketch code you're ready to assemble the final tiki torch.
Start by putting a layer of filler material inside a mason jar.
To prevent a mess if filler material spills I recommend filling the jars on a tray or in a box.
Gently bend the NeoPixel strip into a U shape and hold it inside the center of the jar. Then continue to fill the jar with filler material.
Leave a bit of room at the top of the jar so you can fit the Gemma board and battery (pushing the battery down into the jar if necessary). Then fill the jar up to the top with filler.
Once the jar is filled you're ready to put the lid on and screw it shut. However make sure the lid is not conductive or it might short out the connections on the hardware! Most mason jar lids have a white coating on them that is not conductive, however if your lid is shiny metal or you're not sure if it's conductive then cover the lid in tape (like packing tape or even duct tape) to protect it.
Once the jar is sealed up check that you can still control it using the remote control. If the remote control isn't registering double check the IR receiver isn't blocked by the battery and has a clear view out of the jar (as long as the filler material is clear it shouldn't block the IR receiver).
Now that the jar is assembled the last piece is to place it inside a tiki torch.
Pull the fuel cannister out of your tiki torch.
Push the jar lid side first into the torch. If you're using the torch suggested in this guide the mason jar should pop in and be held snugly by the wire in the top of the torch.
If the mason jar doesn't fit the torch you might need to cut the wire at the top of the torch and bend it into a smaller or larger opening to accomodate the mason jar.
Congratulations, you've built the techno-tiki torch! Decorate your backyard, a patio/balcony, a campsite, or even your room with these beautiful glowing lights.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum