Hi
I have programmed an LED light tube with WS2811 LEDs and an OLED display Menu on an ESP8266. Now I need to install Bi Color Led strips for the white colors (I need high CRI so RGB White doesn't work). As soon as I have analogWrite in my code the WS2811 LEDs are flickering in random colors. I have read that there's a problem with the timing of FastLED and analogWrite on an ESP but I need a small microcontroller with lots of memory (tried it on a nano before). Does anyone knows if there is a solution for that, or what I could do? couldn't find anything on the internet.
Interesting problems. You might post the schematic, not a frizzy thing, so we can see what you are trying to do. You might also post the code.
Here is a Fritzing diagram. I wrote a simple sketch on my other pc to check if the problems are somewhere else in my code. But I had no luck. Have to post the code from the other pc.
Haven't had a ws2811 in Fritzing. So just imagine it is connected to VCC GND and Signal. Tried everything independently and everything works. So wiring shouldn't be the problem.
#define FASTLED_ALLOW_INTERRUPTS 0
#define FASTLED_INTERRUPT_RETRY_COUNT 0
#include <FastLED.h>
#define NUM_LEDS 20
#define DATA_PIN 4
#define CLOCK_PIN 13
CRGB leds[NUM_LEDS];
int test = 0;
void setup() {
Serial.begin(57600);
LEDS.addLeds<WS2811,DATA_PIN,RGB>(leds,NUM_LEDS);
LEDS.setBrightness(0);
analogWriteFreq(1000);
}
void loop() {
test++;
if (test >1024){
test=0;
}
analogWrite(12, test);
analogWrite(14, test);
FastLED.clear();
FastLED.show();
}
gilshultz:
You might post the schematic, not a frizzy thing
malte_entzmin:
Here is a Fritzing diagram.
:o
No resistor in the WS data line.
No capacitor across the strip?
Is it really built in a solderless bread board?
No level converter from the 3V3 signal to the required 5V signal to the strip.
Apparently no power to the EPS?
No information about what the current capability of you power supply is.
Sorry for the missing information. I have a soldered version and a breadboard version. Just used a schematic I found online for wiring and there was no capacitor or level converter. In solo every strip works fine. Power for the Esp comes from usb at the moment and I use a 1m length for each strip. I tried 12v 5A and 10A psu so power shouldn't be an issue. I read somewhere else that the Esp has no hardware pwm and the timing of FastLed gets screwed when using software pwm so I thought its more a solution that maybe can be fixed by software. But if it is a hardware problem I can change it easily. Okay no level converter at hand but cap and resistor shouldn't be a problem. Do you think that could be the problem even if everything works in solo?
I bought a ESP32 and tried with that (even pwm on the second core) but no change. I really hope someone has an idea.
Today I tried sending a value via serial communication to an Arduino Nano and use the nanos pwm but it is still the same problem. Could the problem be that the led strips have common ground and the strips are dimmed by ground?
Could the problem be that the led strips have common ground and the strips are dimmed by ground?
I don’t know what that means, especially as you have not posted a schematic. I am not sure what strip you are talking about seeing as you have made up things on that physical layout diagram.
Are you still using that code on the Nano?
I'm sorry! I am German and some technical stuff is quite complicated to explain or understand. And I've never made a scematic so I hoped that Fritzing would be okay to understand.
What exactly do you need? I have connected three led stripes to an ESP8266 (tried ESP32 aswell). One strip is WS2811, one is with warm white LEDs and one is with cool white LEDs. They all 1meter long and 12V and powered from an 5A 12V power supply. I use mosfets to dimm the white strips and the mosfets are connected the ground of the strips.
On the nano I just ran code to receive Serial Data and control the pwm of the white strips. The ESP sends a value (via Serial) to the nano aswell as driving the WS2811 directly.
PS. I tried it with a resistor in WS2811 data line and with an capacitor aswell. Still the same. I don't have a logic level shifter so couldn't try that.
I have connected three led stripes
Not stripes, these are the horizontal bands running up or down a dress. You mean strips.
If you use a nano then you don’t need a level shifter, the level is correct, and you will not have any trouble with the fastLED code interfering with the PWM. If you do the. Your wiring is wrong, either in layout or where the wires actually go ( called the topology or the net )
You should use a solderd connection with star wiring. This means connecting all the grounds together at one point. Otherwise you can get something known as ground bounce.
What are the FETs you are using?
Thanks for the answer. For my tests I can use just an Arduino Nano but for the final project I need more memory for the program, that's why I went with an ESP8266 or ESP32. I will solder everything and connect all grounds in one place. I will try a simple sketch with the Arduino to check if everything works. If it does I need to check how I can make it work on the ESP. Thanks for the advice.
For the mostest...I am using irfz44n. I've searched the internet for dimming LEDs and they seem to be used very often.
malte_entzmin:
I am using irfz44n. I've searched the internet for dimming LEDs and they seem to be used very often.
And that is why Mike asked. The IRFZ44 is not suitable for this purpose as it is not a "logic-level" FET, it requires something like 10 V to turn on fully whereas you have only maybe 5 V for a Nano and 3.3 V for the ESP at which voltage it may or may not conduct at all.
The fact that "they seem to be used very often" on the Internet unfortunately does not help you. ![]()
OK, I know your next question.
IRL540
Or perhaps even better, IRLR7843.
As used in this module:

Aliexpress link.
Thanks for the answer. I ordered some of the modules and will try them. Just thought it should work because the strips work individual. They just don't work if I use them together. But I will try it with these modules and report back. If I am using it with an ESP do I need a level shifter for the WS2811 aswell? I think I read somewhere that there are two different boards. Bi directional and directional ones. Which ones would fit?
Bi directional Level shifters are designed for I2C interfaces. They are not quite fast enough for WS2811.
I was addressing the powering (controlling) of the 12 V strips.
Erratic control of the WS281x LEDs by an ESP may be due to not using the version of the code which disables interrupts/ context switching when sending command sequences, or the 3.3 V logic level being insufficient for the 5 V logic LEDs.
The correct (simplest, cheapest) level shifter is a 74HCT14 (hex inverter) with two inverters cascaded, powered from the 5 V of the LEDs.. The inputs of the other inverters must be grounded (unless you happen to have another use for them). A 74HC04 would generally suffice.
I just received the fet modules and my simple test setup with dimming one 12v strip and solid red WS2811 works fine (even without a level shifter at the data pin)
Still have to try it with the display, encoder and the second 12v strip but I guess that should work aswell.
Thank you very much for the help!
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
