Marc's Public Blog - Electronics Hacking


All | Aquariums | Arduino | Btrfs | Cars | Cats | Clubbing | Dining | Diving | Electronics | Exercising | Flying | Hiking | Linux | Linuxha | Public | Rc | Sciencemuseums | Snow | Solar | Trips



>>> Back to post index <<<

2017/06/02 LED Pants and Shirt Programmed With Arduino on ESP8266
π 2017-06-02 00:00 in Arduino, Clubbing, Electronics
So, this all started with some LED shoes I hacked to last 12H instead of 4, and it ended with me learning how to program arduino like microcontrollers to control neopixels (aka WS2811/WS2812/WS2812B) while being able to receive Infrared/IR commands. The latter is actually difficult but you go read that page to learn why

Since I've met plenty of people who complimented for my neopixel shirt and pants combo, and some who asked questions about them, I thought I'd write some quick page to explain how it all works and how you can do similar things, since it's more fun if I'm not the only one lit up at Dreamstate (which has been less of a problem at burning man).

Here is a video summary:

Show me the code!

Sure, it's here: https://github.com/marcmerlin/Neopixel-IR (but go to the end of this page for more details).

So, I have 3 versions of the shirt, let's go through them depending on how complex you'd like to go:

Multi Color LED strip, non controllable



It used a 12V controllable dimmer: https://www.amazon.com/gp/product/B00MHKCTLE which can simply change the brightness of the LEDs, which are of a set color. I bought the LED strip in Akihabara Japan, but I'm guessing something similar can be found elsewhere.

Tri Color Controllable LED strip



This version is better in that the LED strip has 3 channels, one for reach of Red, Green, and Blue. I uses a tri color controller like this one: https://www.amazon.com/gp/product/B01410R4KS or remote controlled: https://www.amazon.com/gp/product/B00PBOJNZS
Those controllers can create any color and flash it at any interval, however:

  • they are a flat trip that doesn't really like being bent
  • all the LEDs are in series, so if the chain fails somewhere, nothing lights up beyond the point of failure (which is why I have extra wires soldered on to make redundant paths and get around breakage
  • I have had some sections of 3 LEDs where one color died
  • All of the controllers I tried have a dimming function, but it fails to work when I use the fade dimming patterns, which means they are full bright, suck battery and blind others. I've therefore had to add a 2nd voltage regulator where I can just dim the voltage sufficiently so that the current is then also capped by each color string and therefore the brightness is controlled (you cannot limit the global current fed to the LED controller because you don't know whether it's all fed into a single color, or shared amongst 3).
  • Of course the last thing is that all the LEDs for a color are in series in a single circuit, so you light up all the reds, or all the blues or greens, or none. You can't turn on one LED individuallly. This is where the next solution comes in.
  • ESP8266/Arduino Controlled Neopixels



    To fix the issue of not being able to have custom multi color LED patterns, where each LED/pixel can be controlled separately, the solution is neopixels (aka WS2811/WS2812/WS2812B). Each LED/pixel is controllable separately, which is done by a computer, in this case the ESP8266 can run my own programs to control all the LEDs.
    The ESP8266 is a 3.3V based microcontroller for low power use (good when battery powered) while the neopixels are 5V powered, but thankfully the neopixels can use 3.3V signalling from the ESP8266 while being 5V powered to light up properly. The one thing to keep in mind is that neopixels use some power even if they are not lit. In my case 200 neopixels, take about 120mA when they are off, and 4.5A when they are all lit in white on full brightness.

    Neopixels are almost infinitely versatile, instead of having them in single line strips like on my shirt and pants, you can also make display matrices out of them:


    I've then written code that receive the IR commands from the remote and execute different code that creates different light patterns, which is explained in more details and available on this page and you can get the code from github.

    Here is a video that shows all 3 modes, jump to 3:50 for the neopixel bit:


    More pages: May 2011 July 2011 August 2011 October 2015 November 2015 February 2016 May 2016 April 2017 June 2017

    >>> Back to post index <<<