Go Down

Topic: FastLED not working with ESP8266 D1 Mini, WS2812B, and level shifter (Read 459 times) previous topic - next topic

Shawheen15

I've been trying to get my ESP8266 board to interface with a WS2812B LED strip with FastLED, but I haven't been able to get it to work properly. After research I realized I may need a level shifter, so I got the SN74AHC125N to shift from 3.3V to 5V for the strip. This also did not work. I try to run the color palette example from the FastLED library but all the lights just become a bright white, with and without the level shifter.

Then, I tried to use the NeoPixel library, and it worked without needing any level shifter. I also tried the FastLED library with my Arduino Mega and the same strip, and it worked perfectly.

So, either the FastLED library isn't working with my ESP8266 board (I tried it with multiple boards that I own) or my level shifter isn't working.

I've attached a picture of my wiring (bottom right red and black cables are coming from 5V2A power supply, and bottom middle cables go to led strip). Does anything look wrong with it? Would really appreciate any help.



Grumpy_Mike

Quote
or my level shifter isn't working.
That is my guess. While a photo is good, it is only good for checking against a schematic so can you post the schematic of this level shifter and include the power supplies and decoupling.

PaulRB

I tried to use the NeoPixel library, and it worked without needing any level shifter.
That implies the problem is software, not hardware, related.

I have found that ws2812b work fine with Wemos without a level shifter. But I needed level shifters with Wemos for ws2801 and some other type of "neopixel" I can't remember the name of right now (not wsXXXX). It seems almost everyone's experience is different!

Post your test sketches using Neopixel and FastLED, and mention what version of Arduino IDE and the libraries you are using.

Grumpy_Mike

Quote
After research I realized I may need a level shifter, so I got the SN74AHC125N to shift from 3.3V to 5V for the strip.
Do these work as a level shifter for a 3V3 system?
Quote
VIH High-level input voltage with VCC = 5.5 V minimum signal voltage 3.85V
Much better is a 74HC14.

Shawheen15

So just got feedback on the FastLED library GitHub page, and incredibly enough, it was the FastLED library. I updated my libraries for this project a few days before FastLED v3.2.9 was released (4 days ago), and after updating to the latest version, it's all working now without needing the level shifter. Just my luck that I started right before a vital bug fix.

Grumpy_Mike

Quote
it's all working now without needing the level shifter
But it is a lower signal than you need to guarantee it will work under all conditions. This is what happens with electronics and beginners, they think that just because it works for them it is a working circuit. They then go on to publish it and are surprised at the criticism they get. Or some time later down the line it stops working for them and are baffled.

Shawheen15

This is what happens with electronics and beginners, they think that just because it works for them it is a working circuit. They then go on to publish it and are surprised at the criticism they get. Or some time later down the line it stops working for them and are baffled.
listen man, you don't need to be worried about me being "baffled" if it fails down the line. I've already ordered a new level shifter to use in case mine is broken. and once I get my hands on an o-scope I'll test out if it's really broken or not

Paul__B

The most appropriate level shifter would be a 74HCT14 with two inverters wired in cascade.

An obvious blunder in your picture using the 74AHC125 is the failure to connect the unused inputs to ground.  This also applies to using the 74HCT14 of course.  Whether it will actually prevent it from working is unclear, but it certainly is a necessary step.  In fact, if you propose to have any significant wiring distance between the ESP and buffer and the LED strip, it makes more sense to have the first inverter drive the other five in parallel.

It is improbable that the chip was damaged, so using another of the same is most unlikely to make any difference.  Of course, in experimentation, buying just one of any particular part is rather unwise in any case.  :smiley-roll:

Shawheen15

An obvious blunder in your picture using the 74AHC125 is the failure to connect the unused inputs to ground.  
Interesting. I was following an Adafruit tutorial on how to use it and it didn't show the unused inputs grounded. Although I now see it was in the footer of the datasheet.

It is improbable that the chip was damaged, so using another of the same is most unlikely to make any difference.  Of course, in experimentation, buying just one of any particular part is rather unwise in any case.
Yeah lesson learned.

Thanks for the input I'll look into the 74HCT14

Go Up