import boardimport neopixelimport timepixel_pin = board.D18num_pixels = 1012color = 0pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.5, auto_write=False, pixel_order=neopixel.GRB)while True: pixels.fill((0, 255, 0)) pixels.show() time.sleep(1) pixels.fill((0,0,0)) pixels.show() time.sleep(0.2)
The root of the problem here is that -- according to the NeoPixel data sheets -- the NeoPixel data line voltage (in logic-high state) has to be at least 0.7× the NeoPixel power voltage.5. LEDs drive 60mA when at full power, so at most they will draw 60.72A6. External power supply has 3 connectors for GND and 5V and I've divided the LEDs almost equally in 7 groups/lines connected to VCC and GND even though they are all connected through Dout->Din. They are all connected to the same power supply, I've just tried balanced the current going through the cables.In other words, the power voltage has to be at most 1.43× (= 1 / 0.7×) of the data line voltage. Therefore, if the data line is at 3.3V, then the highest voltage you can put on the power line and still have a reliable NeoPixels is 1.43 × 3.3V = 4.71V.As a result, if your NeoPixel power is close to 4.7V, the NeoPixels will be unreliable in interpreting its data line, resulting in flicker and random color changes.
I would recommend 74hct244, the t in the name is rather important. Two gates in series from a 74hct14 can also do the job.
Can I use transistors to match my data line voltage to something close to 5V?
How can I drop my current from 5.3V to 4.7V, considering it might draw 60A?
But I would suggest they are not. I have had many projects published in the MagPi magazine that use WS2812 LEDs ( Mike's Pi Bakery ) and I have found that the 74HC14, 74HCT14 and even the 74LS14 will all work fine. In fact the latest issue of the MagPi, Jan 2020 has the circuit in it along with a physical layout, as did Dec 2019. Available as a PDF to download free on line, or in the shops for money.
Look again at those specifications, we are talking about the threshold on a 14 buffer, not the general TTL input specifications.