WS2812B flickering with 74HCT245D

hey there, so I posted a while back because I had a problem interfacing WS2812B leds with a Wemos D1 mini because the first led kept flickering no matter what I did. My quick and dirty approach was to just put the led in front of the strip in a casing, add this extra led in the software and I was done. Now I decided to upgrade and bought a 74HCT245D module and ordered my own PCB. This is the schematic:


And this the pcb:

I also have a video of the situation: https://photos.app.goo.gl/qUyAzfQJnhKixZxu7
I checked every connection, everything seems fine and should be working.
I also added a DS3231 module which I forgot to add on the pcb but this shouldn't interfere with any of the leds, right?
Does anybody got an idea what could be the cause?

Also don't be harsh on my schematic and pcb, this is the first time I designed something like this :wink:

No filter capacitor on the 74x's Vcc? Adventurous!

It might if it also draws power from 5V.

I'd start with adding a 100nF ~ 1uF ceramic capacitor across Vcc and GND close to the 74x chip and a 22-100uF electrolytic at JP1.

How is the WS led strip connected to the GND of this board? I see no connection for it.

1 Like

Can you post your code, and link to the library you are using, Perhaps it's not the hardware.

Hi,
Can you post a jpg EXPORT of your PCB pattern please?

Can you please post a COMPLETE circuit diagram including power supplies and the LED strip so we can see how you have connected it all.

How much current does your strip consume?
Have you got the gnd of the strip connected to the gnd of your control circuitry.

What is your supply for the LEDS, it looks like an LED lamp supply, possibly not really suitable for your application.
Can you please post a picture of the label on the supply.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

the main power connection is directly wired from my PSU which has more than enough power to supply the whole strip, grounds are connected. Will try the capacitors today, hopefully thats the cause, the DS3231 is connected to the 3.3V of the Wemos.

I'm using FastLED and tried it out on different sketches, the simplest would be a dimming/fading sketch, I don't currently have access to it, will update my thread ASAP.

the PSU is a MeanWell LPV-60-5 which is rated for up to 8A which should be more than enough for my 110 LEDs. I'm also not planning to light up all lights at once in white.
The complete circuit diagram would be the one I posted plus some WAGO clamps which are just distributing the power from the PSU to the strip and the PCB. The strip is connected on both sites with 16AWG wire. All grounds are connected, the wire the PCB to the data line of the strip is as short as possible.
this it the PCB:


the wire paths at the chip seem close but they don't touch each other, measured everything and all seemed fine

Are you sure also at the top right of the chip? Sure looks to me that there's a short there. Anyway, given the vast amount of space you got there its beyond me why you'd want to run those traces so close.

As to your PSU: 110 leds would draw 6.6A at full power, which can happen also unintentionally. So your PSU is only just heavy enough.

Let's hope the grounding scheme doesn't create a nasty ground loop the way you wired it.

Oh, so that's the PCB pattern!

Well it is an obvious fail for a start - you have the antenna of the WeMOS mounted over the PCB! :astonished:

can this interfere with the 74HCT245D or why is it bad? I did it that way so I can still use the USB port, again I'm a complete beginner regarding this topic

I checked every connection no short anywhere, this was my first pcb design so I didn't draw much attention to something like distance between the paths :wink:
I also added the capacitors you mentioned but no improvements, still got the problem
@missdrew Also here's my simplified code:

#include <FastLED.h>
#define NUM_LEDS 110
CRGB leds[NUM_LEDS];
#define DATA_PIN 15

void setup() {
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  fill_solid(leds, NUM_LEDS, CRGB::Red);
  FastLED.show();
  fill_solid(leds, NUM_LEDS, CRGB::Black);
  FastLED.show();
  pinMode(A0, INPUT);
  delay(100);

}


CRGB color = CRGB::White;
void loop() {
  //just turn on some leds
  for (int i = 0; i < 6; i++) {
    if (!(i == 2)) {
      leds[i] = color;
    }
  }
  leds[7] = color;
  leds[8] = color;
  leds[9] = color;
  leds[10] = color;
  leds[38] = color;
  leds[39] = color;
  leds[40] = color;
  leds[41] = color;
  FastLED.show();
  //dimm them to match surrounding brightness
  FastLED.setBrightness(map(analogRead(A0), 0, 1024, 0, 255));
  FastLED.show();
  delay(500);
}

Hi,
Make your tracks about 3 to 10 times wider, you have the space.
Can I suggest your next board be a double sided PCB, you could have routed some of those close tracks better and wider.

Thin tracks limit current and can actually burnout if you have any serious current flowing through them.

You purchased a PCB completely clad in copper.
You payed someone to remove the copper you bought.
They aren't going to give you a discount for the copper they reclaimed.
Keep as much of YOUR copper on YOUR PCB as possible.

No, include your power supplies and LED strip.
That is a diagram to make a PCB, not trace a signal and see power supply wiring.

Where is the gnd connection between your PCB and the LED strip/power supply gnd?

Tom... :smiley: :+1: :coffee: :australia:

Metallic objects in close proximity to an antenna modify its impedance and cause a percentage of transmitted RF to reflect back into the transmitter. At best, it will weaken the transmit signal. At worst, it could damage the transmitter. In your case, it will just weaken the transmit, and also the receive signal.

Conductive objects also modify the 3d radiation pattern, creating "hot and cold" spots in the coverage.

Hi,
Have you put bypass capacitors on your PCB, particularly the 74HCT245D?

Tom... :smiley: :+1: :coffee: :australia:

Can you try

#include <FastLED.h>
#define NUM_LEDS 110
CRGB leds[NUM_LEDS];
#define DATA_PIN 15

void setup()
{
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  FastLED.clear();
  FastLED.show();
}

void loop()
{
  fill_solid(leds, NUM_LEDS, CRGB::Red);
  FastLED.show();
  delay(1000);
  fill_solid(leds, NUM_LEDS, CRGB::Green);
  FastLED.show();
  delay(1000);
  fill_solid(leds, NUM_LEDS, CRGB::Blue);
  FastLED.show();
  delay(1000);
}

could you also give a link to where you purchased the led strips please.

I would also jumper over the flimsy 5V and ground connections to the buffer. Use some 20 or 22 guage wire and connect them directly to gnd and 5V on the D1 mini.

1 Like

I would phrase that as "all logic chips need decoupling capacitors, these are never optional". Also I'd second the advice that the traces (for power and ground) need to be wide - for low inductance. Typically you use a ground plane too so the return path is available.

And of course putting a logic trace across the antenna like that will risk trashing the signal in that trace, even risk frying the chips it connects too - RF antennas can put out high resonant voltages even at a few tens of milliwatts, 10's of volts. That may couple to the trace efficiently (or not - its a roll of the dice due the precise layout details).