I have a Metro ESP32-S2 that I've been using to control a 300-LED Neopixel strip, with great success. The Metro seems to do fine powering the Neopixels off the 5V pin.
I tried transferring the code over to a smaller ESP32 from Hiletgo and the thing overheated (and the lights didn't light up). Advice on the Arduino forum was that this was an error on my part—I shouldn't be using the 5V pin to power the LEDs. So now I'm back using the Metro but wondering...am I doing something I shouldn't be?
Thanks!
Plugging Neopixels into ESP32-S2 Metro?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
What Hiletgo product? It might not be able to provide enough current on the 5v pin.
I do agree somewhat with your critics, 300 NeoPixels need a lot of current. You would be better using an external 5v supply. 300 pixels want 18A in the worst case. If you have only a few on at a time they would work. How physically long in the strip? It's worth thinking about voltage drop in the power lines if it's long. You want to connect the 5v & ground to each end and possibly at points along its length as well.
Have a refresh read of https://learn.adafruit.com/adafruit-neopixel-uberguide.
Dave
I do agree somewhat with your critics, 300 NeoPixels need a lot of current. You would be better using an external 5v supply. 300 pixels want 18A in the worst case. If you have only a few on at a time they would work. How physically long in the strip? It's worth thinking about voltage drop in the power lines if it's long. You want to connect the 5v & ground to each end and possibly at points along its length as well.
Have a refresh read of https://learn.adafruit.com/adafruit-neopixel-uberguide.
Dave
- dfeldman
- Posts: 29
- Joined: Mon Jul 04, 2022 4:11 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
This is the Hiletgo. The LED strip is 16' long (and in the interests of full disclosure they're not true Neopixels but a similar product). I'll check out the link; thanks for that.
And one follow-up question: I guess I'd assumed that if I needed an external power source it'd be because the ESP32 simply couldn't effectively power the LEDs; is it normal for it to overheat the board and, if so, why?
And one follow-up question: I guess I'd assumed that if I needed an external power source it'd be because the ESP32 simply couldn't effectively power the LEDs; is it normal for it to overheat the board and, if so, why?
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
OK, a different LED product might change the power requirements.
There's nothing between the USB connector and the 5v pin except a protection diode, which should be able to handle 1A. What are you powering the board with?
Dave
There's nothing between the USB connector and the 5v pin except a protection diode, which should be able to handle 1A. What are you powering the board with?
Dave
- dfeldman
- Posts: 29
- Joined: Mon Jul 04, 2022 4:11 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
USB cable into either a phone-style power brick or the USB port on a laptop. For the Hiletgo, there’d be a further adapter in the case of the laptop to convert from USB-C to -A. (And that’s when I noticed it overheating actually: MacBook Pro USB-C port to adapter to USB-A-to-Micro-USB cable.)
- dfeldman
- Posts: 29
- Joined: Mon Jul 04, 2022 4:11 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
Huh. The NeoPixel Überguide suggests what I’m doing isn’t unreasonable:
The main thing that scares me is not having a mental model around “things that might result in melting or burning.” Blowing out an LED or board is an acceptable learning experience; burning down the house, not so much.
Though also:Can NeoPixels be powered directly from the Arduino’s 5V pin?
Sometimes. The Arduino can continuously supply only about 500 milliamps to the 5V pin. Each NeoPixel can draw up to 60 milliamps at full brightness. So yes, you can skip the separate DC supply and power directly off the Arduino as long as just a few pixels are used, more if the colors and overall brightness are low. When in doubt, give the pixels a separate power supply.
And:NeoPixels powered by 5v ideally require a 5V data signal. If using a 3.3V microcontroller, it’s wise to use a logic level shifter such as a 74AHCT125 or 74HCT245. If you are powering your NeoPixels with 3.7v directly from a LiPoly cell, a 3.3v data signal is OK. See the “Logic Level Shifting” page for further information.
…which makes me wonder if maybe I’m not connecting to a 5V out on the Hiletgo the way I think I am…If powering the pixels with a separate supply, apply power to the pixels before applying power to the microcontroller. Otherwise they’ll try to power “parasitically” through the data line, which could spell trouble for the microcontroller.
The main thing that scares me is not having a mental model around “things that might result in melting or burning.” Blowing out an LED or board is an acceptable learning experience; burning down the house, not so much.
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
I still suspect that the pixels are drawing too much current. The power circuits on the two boards are different so I'm not surprised they behave differently. I still say you're better off to use a separate, large, external supply for the LEDs.
Dave
Dave
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
Also, don't leave them on and unattended until you are confident that overheating isn't a problem.
Dave
Dave
- dfeldman
- Posts: 29
- Joined: Mon Jul 04, 2022 4:11 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
Gotcha. I think the thing I’m wrapping my head around comes down to “drawing current” vs “pushing current”. I think of the board pushing current to the pixels, and if it can’t push enough there’s not enough light. But it seems like also, the pixels are demanding current from the board, and it gets overtaxed or overheated when it can’t keep up. What’s an accurate way to think about all this?
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
The latter is generally the correct way to think of it. For example, if you connect a 20mA LED (with appropriate resistor) to a 5v 10A supply, 20mA will flow due to the voltage across the resistor (see Ohm's law). The fact that the supply is capable of supplying 10A is irrelevant until the demand on it exceed 10A.
Things like resistors, transistors, diodes, etc are designed and rated to handle some maximum current flowing through them. Exceed that and they tend to overheat and/or burn out, catch fire, explode, etc depending on what they are and the situation. This is why fuses are your friend. When excessive current flows through a fuse it melts, breaking the circuit.
Dave
Things like resistors, transistors, diodes, etc are designed and rated to handle some maximum current flowing through them. Exceed that and they tend to overheat and/or burn out, catch fire, explode, etc depending on what they are and the situation. This is why fuses are your friend. When excessive current flows through a fuse it melts, breaking the circuit.
Dave
- dfeldman
- Posts: 29
- Joined: Mon Jul 04, 2022 4:11 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
OK. So I'll start with the face-palm moment. I had the Hiletgo pinout upside down with respect to the board. In particular, that meant the 5V and ground pins were reversed. Oops. With the pinout oriented properly, the LEDs light up as expected.
And yet. If I ask the Hiletgo to drive 36 LEDs at once with a red color, everything's fine—no noticeable warmth. If I increase the number to 60 and go full-on white, the board overheats near the 5V pin. I'm powering it with a 5.1V/2.1A brick. Assuming the LEDs draw power similar to Neopixels, 36 red should draw about 1A, whereas 60 white should drive about 3.6A.
So I guess that all makes a bit of sense and it's time to buy that external power supply (5A? 10A? Seems like maybe 10A because 244 white LEDs will actually want 15A?).
The Metro does overheat too, but it seems like it's a little more tolerant. It definitely gets hot if I tell all 244 LEDs to be white, but with 60 going it's just a tad warm.
And yet. If I ask the Hiletgo to drive 36 LEDs at once with a red color, everything's fine—no noticeable warmth. If I increase the number to 60 and go full-on white, the board overheats near the 5V pin. I'm powering it with a 5.1V/2.1A brick. Assuming the LEDs draw power similar to Neopixels, 36 red should draw about 1A, whereas 60 white should drive about 3.6A.
So I guess that all makes a bit of sense and it's time to buy that external power supply (5A? 10A? Seems like maybe 10A because 244 white LEDs will actually want 15A?).
The Metro does overheat too, but it seems like it's a little more tolerant. It definitely gets hot if I tell all 244 LEDs to be white, but with 60 going it's just a tad warm.
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
Oops! It's nice/surprising that they still work.
It all depends on what the current is going through. Near the 5v pin on the Hiletgo makes it sounds like it's that diode (1A rating).
Dave
It all depends on what the current is going through. Near the 5v pin on the Hiletgo makes it sounds like it's that diode (1A rating).
Dave
- dfeldman
- Posts: 29
- Joined: Mon Jul 04, 2022 4:11 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
OK! So I bought a 5V / 10A power supply and plugged it into the barrel jack on the Metro. The result is, unfortunately, similar to when I used the USB-C jack with a power brick: it works, but the lights aren't getting enough power and the board is getting hot. The Uberguide suggests this setup should work, but I'm guessing what it means is I need to run the power directly to the LEDs rather than through the Metro?
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
A couple things.
Yes, you should run power directly to the NeoPixel strips. Be sure to connect the grounds of the Metro and strip together. If you are using the 5v pin on the Metro, that's the output of the 5v regulator (and going through a comparable diode). It doesn't make any different what the supply can provide in terms of current; it's the current limits of the component along the path.
I'm surprised that a 5v supply to the barrel connector works. That feeds a 5v regulator and is speced for 6v-12v.
Dave
Yes, you should run power directly to the NeoPixel strips. Be sure to connect the grounds of the Metro and strip together. If you are using the 5v pin on the Metro, that's the output of the 5v regulator (and going through a comparable diode). It doesn't make any different what the supply can provide in terms of current; it's the current limits of the component along the path.
I'm surprised that a 5v supply to the barrel connector works. That feeds a 5v regulator and is speced for 6v-12v.
Dave
- dfeldman
- Posts: 29
- Joined: Mon Jul 04, 2022 4:11 pm
Re: Plugging Neopixels into ESP32-S2 Metro?
Is there a way to power both the LEDs and the Metro from the new power supply? Or do I need two separate power supplies?
Please be positive and constructive with your questions and comments.