user23967: I am working on lighting some WS2812 Leds with a nodemcu form hiLetgo. The project works when it is powered from the usb that is on the board, but as soon as it is powered from the barrel jack, the leds will only light up to the last color that they were set, ignoring code. A schematic and code are included for reference.
#include <ESP8266WiFi.h>
#include <Adafruit_NeoPixel.h>

// Which pin on the ESP8266 is connected to the NeoPixels?
#define PIN            D8

// How many NeoPixels are attached to the ESP8266?
#define NUMPIXELS      30

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 10; // delay for half a second
int x, y, z;

void setup() {
  // put your setup code here, to run once:
  pixels.begin(); // This initializes the NeoPixel library.
  x = 0;
  y = 0;
  z = 0;
}

void loop() {
  // put your main code here, to run repeatedly:
   for(int i=0;i<NUMPIXELS;i++){
    x = (x+1)%256;
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255

    pixels.setPixelColor(i, pixels.Color(x,y,z)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).

  }
  y= (y+1)%256;

}


user4143: First: What is the purpose of that resistor you have in there? It serves no purpose as far as I can see, and would only cause problems anyway. Lose it.
Second: You have logic voltage level problems:

You are supplying 5.2V to the LEDs.
The ESP8266 is a 3.3V device.
The ESP8266 outputs 3.3V as a logic HIGH.
The WS2812 accepts 0.7Vdd as logic HIGH (as stated in the datasheet).
0.7 × 5.2 = 3.64v

Ergo, the LEDs aren't seeing the logic HIGH signal as logic HIGH because it is too low a voltage.
Add to that the voltage drop across the resistor and your logic HIGH voltage will be even less.
So:

Lose the pointless resistor
Either reduce the supply voltage to the LEDs or increase the output HIGH voltage level with a logic level shifter circuit (3.3v -> 5v).


23967: <p>I am working on lighting some WS2812 Leds with a nodemcu form hiLetgo. The project works when it is powered from the usb that is on the board, but as soon as it is powered from the barrel jack, the leds will only light up to the last color that they were set, ignoring code. A schematic and code are included for reference.<a href="https://i.stack.imgur.com/bdonO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bdonO.png" alt="The schematic"></a></p>

<pre class="lang-c prettyprint-override"><code>#include &lt;ESP8266WiFi.h&gt;
#include &lt;Adafruit_NeoPixel.h&gt;

// Which pin on the ESP8266 is connected to the NeoPixels?
#define PIN            D8

// How many NeoPixels are attached to the ESP8266?
#define NUMPIXELS      30

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 10; // delay for half a second
int x, y, z;

void setup() {
  // put your setup code here, to run once:
  pixels.begin(); // This initializes the NeoPixel library.
  x = 0;
  y = 0;
  z = 0;
}

void loop() {
  // put your main code here, to run repeatedly:
   for(int i=0;i&lt;NUMPIXELS;i++){
    x = (x+1)%256;
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255

    pixels.setPixelColor(i, pixels.Color(x,y,z)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).

  }
  y= (y+1)%256;

}
</code></pre>
 4143: <p>First: What is the purpose of that resistor you have in there? It serves no purpose as far as I can see, and would only cause problems anyway. Lose it.</p>

<p>Second: You have logic voltage level problems:</p>

<ul>
<li>You are supplying 5.2V to the LEDs.</li>
<li>The ESP8266 is a 3.3V device.</li>
<li>The ESP8266 outputs 3.3V as a logic HIGH.</li>
<li>The WS2812 accepts 0.7Vdd as logic HIGH (as stated in <a href="https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf" rel="nofollow">the datasheet</a>).</li>
<li><strong>0.7 × 5.2 = 3.64v</strong></li>
</ul>

<p>Ergo, the LEDs aren't seeing the logic HIGH signal as logic HIGH because it is too low a voltage.</p>

<p>Add to that the voltage drop across the resistor and your logic HIGH voltage will be even less.</p>

<p>So:</p>

<ol>
<li>Lose the pointless resistor</li>
<li>Either reduce the supply voltage to the LEDs or increase the output HIGH voltage level with a logic level shifter circuit (3.3v -> 5v).</li>
</ol>
