# Power for Devices

**URL:** <https://forum.makecode.com/t/power-for-devices/14742>\
**Category:** micro:bit\
**Created:** [August 2, 2022, 4:56pm UTC](https://forum.makecode.com/t/power-for-devices/14742 "2022-08-02T16:56:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrHM](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@MrHM](https://forum.makecode.com/u/MrHM)\
**Post date:** [August 2, 2022, 4:56pm UTC](https://forum.makecode.com/t/power-for-devices/14742/1 "2022-08-02T16:56:17Z")

</div>

Hello, this is probably a general question, but my current use case is an ultrasonic sensor. I bought the sensor from Adafruit that is rated for 3.3v. It works great when my Microbit is plugged into the computer. It does not work on battery pack ;-(

When the MB is plugged into the computer, I read 3.2v between the 3v and GND. When I only plug into the battery pack (with fresh batteries), I only read 2.8…hence the reason the ultrasonic no longer works.

I am a trained programmer and school of hard knocks electrician. I assume this convo has to do with current and amps as well. Can anyone shed light on this behavior between the two power sources?

Thanks!

---

<div class="post-metadata">

**Author:** ![dsssssssss9](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dsssssssss9/32/861_2.png) [@dsssssssss9](https://forum.makecode.com/u/dsssssssss9)\
**Post date:** [August 2, 2022, 8:33pm UTC](https://forum.makecode.com/t/power-for-devices/14742/2 "2022-08-02T20:33:47Z")

</div>

Hi

What type of battery pack are you connecting?  
How are you connecting it to the Micro:Bit?

---

<div class="post-metadata">

**Author:** ![MrHM](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@MrHM](https://forum.makecode.com/u/MrHM)\
**Post date:** [August 2, 2022, 11:05pm UTC](https://forum.makecode.com/t/power-for-devices/14742/3 "2022-08-02T23:05:18Z")

</div>

Standard 2xAAA battery pack to power the MB. When adding extra power, I use 4xAA like this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c1b9493e768fb0445ead4507b7090681b74782e8.jpeg)

The question is still why the difference between USB power from the computer vs. the standard 2xAAA?

Thanks!

---

<div class="post-metadata">

**Author:** ![MrHM](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@MrHM](https://forum.makecode.com/u/MrHM)\
**Post date:** [August 2, 2022, 11:05pm UTC](https://forum.makecode.com/t/power-for-devices/14742/4 "2022-08-02T23:05:37Z")

</div>

With lots more research, looks like USB provides 5V and the on board regulator turns it into 3.3. So with more input voltage, I assume it can maintain higher currents, hence the reason USB acts more powerfully than a battery pack. Am I understanding this correctly?

---

<div class="post-metadata">

**Author:** ![adamkdean](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/adamkdean/32/7155_2.png) [@adamkdean](https://forum.makecode.com/u/adamkdean)\
**Post date:** [November 14, 2022, 3:03am UTC](https://forum.makecode.com/t/power-for-devices/14742/5 "2022-11-14T03:03:04Z")

</div>

I’ve been playing around with the micro:bit, to better be able to teach my son how to use it, and I’ve noticed that when powering from a battery directly, that is via the 3V/GND rails, there is no onboard regulation (which makes sense, when you think about it.)

The block schematic[1] shows that the JST (JST S2B-PH-SM4-TB) and USB connections pass through the regulator but as you can see, the rails don’t. (How could they, they can’t have two voltages at once?)

![Fig A](https://tech.microbit.org/docs/hardware/assets/v2-2-block.svg)

So if you power it directly with 3.6V for example (3 x 1.2V NiMH) the 3V rail will be 3.6V, and as in your case, a supply of 2.8V (assuming two alkaline batteries at 1.4V), the 3V rail will be 2.8V, thus under voltage for your peripheral. (Note, the micro:bit still runs fine as the nRF52832[2] chip on the v2 allows for 1.7–3.6V supply voltage range.)

Looking into this more, the nRF52832 specs[3] state that it has a “fully automatic LDO and DC/DC regulator system”. My understanding is that it will step-down an input voltage, but won’t step low input voltage up.

But let’s test it. I’ll connect a number of power supplies and test the voltage with all LEDs active, and with them all inactive.

1 x 5V USB (nominally **5V** ) via **USB**.  
Rail reads: 3.328V (idle), 3.325V (active)  
**Regulator active (5V → 3.33V)**

3 x 1.2V NiMH (nominally 3.6V, actual **3.85V** ) via **JST**.  
Rail reads: 3.328V (idle), 3.325V (active)  
**Regulator active (3.85V → 3.33V)**

3 x 1.2V NiMH (nominally 3.6V, actual **3.85V** ) via **rails**.  
Rail reads: 3.36V (idle), 3.13V (active)  
**Regulator inactive, some voltage drop.**

2 x 1.5V Zinc Carbon (nominally 3V, actual **2.59V** ) via **JST**.  
Rail reads: 2.34V (idle), 2.21V (active)  
**Unknown, some voltage drop, but less than direct.**

2 x 1.5V Zinc Carbon (nominally 3V, actual **2.59V** ) via **rails**.  
Rail reads: 1.99V (idle), 1.88V (active)  
**Regulator inactive, some voltage drop.**

It looks like there is some voltage drop for the direction connections but that could be the way I’m reading it, or some consumption along the way, but I think it’s fair to make the follow speculative statement:

- Regulator only active when powered via USB or JST ports
- Regulator can step down voltage, but cannot step up voltage
- Even under supplied, regulator appears to keep voltage more stable

Hope this little foray into the power supply helps you, or others who land here.

```auto
[1] https://tech.microbit.org/hardware/
[2] https://www.nordicsemi.com/products/nrf52832
[3] https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52832.html

```
