Je t’embrasse Salutations from Silicon Valley, California

5Nov/150

The Human Glowstick – Part 2

Even though I began this project in August, attempting to adapt a OctoWS2811 implementation to be wireless; controlled by my phone...

What I'm actually going to walk through here is the end result. Which is simply a Adafruit WS2801 implementation on top of the Adafruit nRF8001 "callbackEcho" demo sketch.

PLEASE NOTE: At the time of writing this, the Adafruit WS2801 library does not include the Color() method... and as such, I branched it, created the method, and have made my modified version available on GitHub: Here (in all likelihood the change will have been merged into their mainline by the time you are reading this)

To give you an accurate idea on the scope of the software, remember that there are 4 parts to this project:

  1. The LEDs (238x WS2801 modules)
  2. The Bluetooth LE Module
  3. The Fan control (MOSFET)
  4. The Sound Detector

Whenever I start a project like this, I always try to make sure I have the basic understanding of any one component correct before moving on. (That's why each of those links above refer to a test that specifically targets one thing at a time).

One interesting tidbit that I continually forget: If you want to run your project without a console attached, you should probably not wait for a console to be attached... Basically, many Arduino example sketches run a setup() something like the following:

void setup(void)
{
    Serial.begin(9600);
    while(!Serial);
    Serial.println("Setup complete");
}

Only trouble is that when I take this setup into a costume, it will STILL require me to connect a serial console to it before I can continue past that while loop. It can be incredibly helpful to know that your sketch wont start till you connect the console to it... but on the other hand, you can spend an awful lot of time debugging why your sketch is not running when you "hide it away in your project"... but then mysteriously runs when you "look at it"...

Anyway...

Adafruit Color Picker iOS App

As the bare-minimum "glowstick" costume, you have to be able to glow... and given that the previous tests 1 & 2 above both passed... I decided to create the bare-minimum program using the Adafruit Controller ColorPicker.

What this allowed me to do was create another simple test program:

The nRF8001 + WS2801 Color Picker Test

Basically the only educational part of this demo is the breakup of "color picking" to "color setting" (the first being the action done on the App, and the second being the action done by the Teensy 3.2 to the WS2801 LED modules)

The main idea is to never block the main loop. An example of how I do this is to make sure that, instead of using delay functions, I instead just return to the main loop until a certain amount of time has passed.

Another example is inside the mechanism of color-picking. Every loop() starts with reading inputs (like the color #FF0000) and setting modes (in this case seeing a "!C" prefix in the BLE buffer immediately sets the mode to "color picker"). Every loop() ends with implementation of a single mode.

2Nov/150

The Human Glowstick – Part 1

As I know there was a significant interest in my costume this year, I am going to try and put together all of the directions on how I both constructed the foam exterior to the costume, and hooked up the 338 LED modules + Teensy + Bluetooth LE + SPL meter electronics to make the costume what it was.

As a first post, I will provide you with my electronics shopping list (that made the final production), getting into the foam in a later post.

Rainbow Mode

Rainbow Mode

Shopping list:

  1. Two 12V/20A DC regulators for powering the LEDs
  2. One 5V/3A DC regulator for powering the electronics
  3. Two Turnigy 4S 5000mAh 25C LiPo Batteries
  4. Two HXT LiPoly Battery Monitors for 4S packs
  5. Two 4mm HXT to 6x3.5mm Bullet breakout cables
  6. Ten 3.5mm Bullet Extension packs (pack of 3 wires)
  7. Eight pairs of 4-pin JST SM Plug/Receptacle Cable Sets
  8. One pair of 2-pin JST SM Plug/Receptacle Cable Sets
  9. Ten feet of 12AWG Silicone Wire
  10. Two 4mm HXT 10cm Silicone Wire extensions (battery side) - would actually recommend NOT using the same for battery/ESC...
  11. Two 4mm HXT 10cm Silicone Wire extensions (ESC side) - would actually recommend NOT using the same for battery/ESC...
  12. 400 (only used 238) WS2801 12v 4xLED modules
  13. One MOSFET power Control kit
  14. One SparkFun Sound Detector
  15. One Bluetooth LE (nRF8001) module
  16. One Teensy 3.2 (32-bit ARM processor) Microcontroller
  17. One 74HCT245 bus transceiver chip

 

Additional but unknown quantities:

  1. Rosin-core solder
  2. Solder-wick
  3. Solderless breadboards
  4. Jumper Kit
  5. Heat shrink tubing
  6. Zip ties (6 inch & 12 inch)
  7. Resistors of various values (for tuning mic sensitivity)

I will try to go step-by-step with the directions as soon as I can, but I hope this starts you off with a "big picture" of how much time/effort/money is involved in such a project... really that is it though, cause most of the difficult things have been taken care of by using "off the shelf" modules from people like SparkFun & Adafruit. 🙂