Powering LEDs from the Seeed XIAO Sense nRF52840 on LiPo?

Hi!

I have a project where want to power 19 neopixel LEDs (WS2812B or SK6812) using a Seeed XIAO nRF52840 Sense MCU, powered by a LiPo battery.

My idea was to power the LEDs using the 3V pin on the MCU, but having seen this post, I now worry that I wonā€™t be able to power the LEDs using this pin. (Wrong maximum output current for XIAO ESP32C3 3V3 pin)

What is the allowable mA draw on the 3V pint? And, if it canā€™t handle 19 LEDs, then is there some way to power it directly from the LiPo battery instead? Like, running the power wire from the LiPo to both the V+ on the MCU and the V+ on the LEDs? (and ground to both the MCU ground and LED ground, and then a signal wire from the MCU to the LEDs)

Many thanks,
Gustav

According to the datasheet, VDD is 4.5 to 5.5V. Is there any possibility that it will not work with battery?

No that should be fine. Running the LEDs using 3V is fine, Iā€™ve done so before. (they get a little bit dimmer, but that is totally fine. In fact, I will be reducing the brightness anyway.)

Since the operating voltage of the MPU (3.3V) and the LEDs (4.2V to 3.7V) are different, is a level shifter required?
Even if the MPU outputs HIGH, the LED may not recognize it as HIGH.

If I understand it right, the LEDs will interpret the signal based on the supplied voltage being fed into the LED. So, if I supply 3V to the LEDs, then it will use that as the reference voltage, and so a 3V signal pin should be fine. Iā€™ve done this in other projects where Iā€™ve run these kind of neopixels using the 3V power pin and a digital out pin as the signal pin.

My current worry is how much power I can draw from the 3V power pin before overloading the Seeed regulator.

The LDO used for nRF52840 may be SGM2040 (I forget where I saw it).
According to the datasheet, the output current is 250mA, but I donā€™t think the output current is expected as an XIAO. The 3V3 pin is probably provided for the purpose of supplying small current to sensors, etc.
Seeed doesnā€™t publish these kinds of values, so the answer is that the XIAO can output until it gets hot?

Iā€™ve made two schematics of how I can see myself wiring this up.

This first option powers the LEDs via the XIAOā€™s 3.3V power pin. My question remains though of what the maximum sustained current draw is on that pinā€¦

The second option powers the LEDs directly from the LiPo battery. But, Iā€™ve never seen this suggested beforeā€¦ and, I worry about what would happen when I plug in a USB to recharge the lipo battery. I presume the power flowing from the XIAOā€™s charging circuits would ā€˜flow intoā€™ the LEDs? Is that bad? I donā€™t knowā€¦

Any thoughts on these two options?

The power supply circuit for the nRF52840 is shown below. Please refer to it.

When USB is connected, up to 4.2V is applied to the battery. The LEDs connected to the same terminals as the battery are also powered, but if this is a concern, why not disconnect the LEDs with a switch?
By the way, what is the required peak current in mA, which may vary depending on the pattern of light emission?

I could add another power switch for the chargingā€¦ But I would like to know if this is required sinceā€¦ well, at some point, someone is going to forget to disconnect the LEDs before charging! :grinning:

As for the draw, at maximum brightness white, it will draw 60mA*19, so 1140 mA. But it will be rare that all lihgts are on, and rare that they will be white. Soā€¦ the answer is, it depends. Rough estimate is half the pixels are on, and probably each drawing 30 mA, so 300mA. I could add in code to guard against too high draw if requiredā€¦

I have never checked to be sure, but I donā€™t think it will break.
Charging current is limited to 50mA, so if the LED is lit, it may not be possible to charge the battery.

Ah, good to know. Is there a way to know if the USB is connected in software (CircuitPython), so I can turn them off?

Hi there,
SO in this post is an example for the Xiao nrf52840 the code in the zip file includes the indicator of weather the usb is plugged in or not.
HTH
GL :slight_smile: PJ

I have two ideas.

  1. Since port P0_17 goes LOW during charging, this signal is used to keep the LED off during charging.
  2. The LEDs are supplied from both the battery and the 5V pin, ORed with a Schottky diode. Power is supplied from the one with the higher voltage.

2 Likes

Ah great! Thanks. I think I will try the P0_17 pin trick and do it in software. If the LEDs had a reference voltage of 5V, the 3V signal might not work anyway.