• Blinking Lights

    Selali Adobor11/01/2016 at 03:06 0 comments

    I cut an LED off an old addressable strip I had laying around, but I wasn't sure what controller it used.

    Based on the fact it was a 1 wire LED I knew it either a WS2812 or a WS2812B. I started testing it with Adafruit's Neopixel library. From there I just guessed RGB configurations until I found a combination that worked as expected:

    The data pin is connected to GPIO14 on the ESP8266 directly (I skipped out on a terminating resistor and a capacitor across the Vcc on the strip because I'm only using a single LED with very short wires, if I was using multiple I probably couldn't get away with skipping those)

  • Development Board(s)

    Selali Adobor11/01/2016 at 01:15 0 comments

    I actually built 2 development boards for this project.

    The original was based on a much smaller 8 pin ESP8266 module:

    The connections between that one and the 16 pin module based board I'm currently using are almost identical:

    The difference in component count comes down to the smaller module not including a voltage regulator. I ended up using a LM317 because that was what I happened to have in my parts drawer, but if I wanted to make a battery powered version of this I'd probably go with a switching regulator.

    I wanted to use a USB wall wart and luckily the 3.3v Vcc the ESP8266 was low enough that the LM317's dropout voltage didn't come into play. The circuit is pretty simple, for the most part following this reference design (I used a 4.7K potentiometer instead of a 5K):

    Both boards also have near identical pin connections:

    ESP8622 PinConnection on
    8 Pin Board

    Connection on
    16 Pin Board
    VCCVout of LM317Vout of a LDO 3.3V Voltage regulator built into the 16 pin module
    CH_PD3.3v via 4.7k pullup3.3v via 4.7k pullup
    RESET3.3v via 4.7k pullup
    (With a button that pulls it to ground to reset)
    3.3v via 4.7k pullup
    TXSerial Module RXSerial Module RX
    RXSerial Module TXSerial Module TX
    GPIO03.3v via 4.7k pullup
    (With a button that pulls it to ground to enter programming mode on boot)
    3.3v via 4.7k pullup
    (With a button that pulls it to ground to enter programming mode on boot)
    GPIO23.3v via 4.7k pullup3.3v via 4.7k pullup

    Note: The ESP8266 is really picky about connections. If the power supply doesn't keep up with the modules (and I found most USB-to-Serial converters couldn't), all sorts of weird things happen, from a chip that works but occasionally sends garbage over serial, to a dramatically overheated chip.

    And a flaky power supply isn't the only thing that can cause severe overheating with them. The 8 pin module's board had a fault when I first set it up: the pullup resistor for GPIO0 was connected to the wrong hole on my protoboard, leaving GPIO0 floating during operation. Within 30 seconds the entire module was painfully hot, although even in normal operation they get warm to the touch.

    Most of the increased component count on the 8 pin board is from the LM317 and the dedicated reset button (on the 16 pin board I didn't get around to adding a reset switch since the power switch is attached the the board).

    The reason I switched from the 8pin module was GPIOs.

    The original design was going to be fully motion activated. But I was worried about stray objects or pets triggering the detection, and I wanted an item that worked in multiple settings. Getting a calibration that would work "anywhere" probably wouldn't have been possible.

    I thought about a few different solutions and went with the simplest: Adding a button to act as the trigger. The button could also serve double duty by allowing input without a secondary device. The problem with my solution was the module only has 2 GPIOs (and one interacts with the bootloader if it's not pulled up at boot).

    There were actually some really interesting tricks on this page that could have let me use the 8 pin module, but to get developing quickly I didn't want to start waiting on parts (So far I've managed to only use stuff I have around), and I didn't want to give up any part of the UART which is always great for debugging.

    I think once I have the design working correctly I'll probably migrate to the smaller board, since it takes up a lot less space in an enclosure, and I won't want to have the motion sensor attached directly to the board.