Suggested method for avoiding pixels-on-full during program upload #400
Replies: 3 comments 1 reply
-
Linked this FAQ entry to this discussion. |
Beta Was this translation helpful? Give feedback.
-
@sandandstars Thank you for this good suggestion! Long story: TL;DR I will keep the 10K resistors mentioned above, not knowing if they are really needed. @sandandstars and 'arnemauer' from forum.arduino.cc: BTW: |
Beta Was this translation helpful? Give feedback.
-
Hi @sandandstars, thanks you for your elaborate feedback. The difference between 74HCT125 and 74HCT126 is indeed as you described. Of course I inverted the logic in my code when changing to the other type. The 470 ohm resistors are in the schematic schematic of the Wemos D1 Mini Pro. As you can see, the RX input of the ESP8266 is connected via a 470 ohm resistor to the TX output CP2104, which translates USB to/from UART. This RX/TX crossing is normal BTW. With NeoPixelBus in DMA mode, something special happens: the RX input of the ESP8266 becomes an output for Neopixel data. This output is connected to the data input Neopixel strip, via the 74HCT125 in our case. But the TX output of the CP2104 is also still connected to the "RX input" = "Neopixel output" of the ESP8266, so 2 outputs are connected to each other. The 470 ohm resistor in between ensures that the Neopixel output signal from the ESP8266 "wins" from the CP2104. But that resistor needs to be sufficiently large for that. For sure, 2 ohms is far to little and causes the issue that I had: the Neopixels were working when the Wemos was powered from 5V supply (because then the CP2104 is not active), but NOT working when powered from the USB bus (because then the active output of the CP2104 interferes with the RX input" = "Neopixel output" of the ESP8266. So, very logical in the end, but I'm really disappointed in the manufacturer who made this change to 2 ohms. Because they were cheaper? Or the 470 ohm was out of stock? Anyway, I'm happy I found it, and was able to fix it. -/-/- About the 10K resistors: as said, I myself will leave them in now. Just wanted to mention them, in case someone has a weird problem |
Beta Was this translation helpful? Give feedback.
-
Large numbers of pixels, when on full brightness, need inconveniently large power supplies - up to 7Amps/metre. An easy way to reduce the power requirement is to light up just a few pixels at a time, or many at a lower brightness. However, with common controllers, such as the ESP8266, uploading a new program causes every pixel to light up on full due to the way the neopixel output pin is used during programming. This can overload a smaller power supply, blow fuses, damage wiring, etc.
There's a great way to resolve this. Firstly, neopixels are usually powered at 5V, but many microcontrollers run at 3V3, and neopixels don't work reliably if driven at a much lower voltage than they are powered. A common way around this is to use the ICs 74HCT125 or 74HCT245 to convert the microcontroller output from 3V3 to 5V.
These ICs have an ENABLE input for each converter, and this can be used to solve the upload problem.
Simply connect the ICs Enable inputs to a pin on the microcontroller that is HIGH AT BOOT (e.g. D0 on the ESP8266). This will disconnect the neopixels until your program runs, preventing the upload from affecting the pixels. Then, in the program, set the pin to LOW in order to allow data to reach the pixels.
Beta Was this translation helpful? Give feedback.
All reactions