Hello. I'm working on my first project to program an LED strip with the NodeMCU ESP8266. I've got it working just fine for the most part. However, I'm attempting to change the light patterns with a web interface hosted from the ESP8266. I've got the code loaded to host the page and it comes up fine, sometimes. I've noticed that when I have the board attached to my PC (via USB) and with a 5v power supply at the same time and the Arduino software running, the wifi connects with no issues. Seems it works consistently when I launch the Serial interface (connects within a couple of seconds). When I'm done working with the code and attempt to run it standalone, the wifi has a lot of difficulty connecting. It takes a while to connect initially and when it finally does and I bring up the HTML page, the wifi cuts out and goes down. Very hit and miss (mostly miss). I suspect that the board doesn't have enough power to transmit the wifi signal since it seems to work fine when attached to both the PC and the 5v supply. I did run a quick test without Arduino running, and was still having wifi issues. Only when Arduino was running and I launched the Serial interface did wifi connect consistently. Can anyone please confirm this? If so, what can be done to help this out? I figured a 5v supply would be plenty (both board and LED strip say to not use more than this), but perhaps if the board and the LED strip are sharing it, then that might be an issue? I've attached an image of how I have this wired up. Please let me know if you would like to see my code that connects to the wifi. Any help would be greatly appreciated! Thanks!
You should give more details of the components you are using. What type of strip? How many LEDs? Spec of the 5V PSU?
Have you measured the output voltage of the PSU when not connected to usb?
You could try a resistor between the esp pin and the strip, e.g. 330R, 470R. Especially if that line is more than a few cm long. The resistor should be close to the strip. Also run a ground wire alongside the data wire, as a pair. Another good idea is a large value cap, e.g. 470uF, across the power lines near the strip.
You may need a level shifter between the esp and the strip. Level shifters designed for i2c bus are not really suitable and may not work reliably if at all. Use a 74hc14 or 74hct14 chip as a level shifter.