Plugging Neopixels into ESP32-S2 Metro?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
dfeldman
 
Posts: 29
Joined: Mon Jul 04, 2022 4:11 pm

Plugging Neopixels into ESP32-S2 Metro?

Post by dfeldman »

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!

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dastels »

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

User avatar
dfeldman
 
Posts: 29
Joined: Mon Jul 04, 2022 4:11 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dfeldman »

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?

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dastels »

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

User avatar
dfeldman
 
Posts: 29
Joined: Mon Jul 04, 2022 4:11 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dfeldman »

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.)

User avatar
dfeldman
 
Posts: 29
Joined: Mon Jul 04, 2022 4:11 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dfeldman »

Huh. The NeoPixel Überguide suggests what I’m doing isn’t unreasonable:
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.
Though also:
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.
And:
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.
…which makes me wonder if maybe I’m not connecting to a 5V out on the Hiletgo the way I think I am…

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.

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dastels »

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

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dastels »

Also, don't leave them on and unattended until you are confident that overheating isn't a problem.

Dave

User avatar
dfeldman
 
Posts: 29
Joined: Mon Jul 04, 2022 4:11 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dfeldman »

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?

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dastels »

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

User avatar
dfeldman
 
Posts: 29
Joined: Mon Jul 04, 2022 4:11 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dfeldman »

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.

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dastels »

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

User avatar
dfeldman
 
Posts: 29
Joined: Mon Jul 04, 2022 4:11 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dfeldman »

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?

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dastels »

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

User avatar
dfeldman
 
Posts: 29
Joined: Mon Jul 04, 2022 4:11 pm

Re: Plugging Neopixels into ESP32-S2 Metro?

Post by dfeldman »

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?

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”