> For the complete documentation index, see [llms.txt](https://monasheng.gitbook.io/zerotohero/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monasheng.gitbook.io/zerotohero/arduino-zero-to-hero/core-skills/constant-power.md).

# Constant Power

{% embed url="<https://www.youtube.com/watch?v=mwVgqLM5Uvc>" %}

Most MCUs have at least one *onboard regulator* to provide a constant output voltage irrespective of a noisy/varying input, and at least one *output pin* to share this voltage with *low current draw* devices.

<figure><img src="/files/PBWGT4TwzvD4BQpym0co" alt=""><figcaption><p>Most Arduino boards have an onboard <a href="https://mm.digikey.com/Volume0/opasdata/d220001/medias/docus/5011/AMS1117.pdf">AMS1117</a>, which is a 5 V output voltage regulator. For up to ~12 V input, it will provide the board (and any of it's output pins) with a steady ~5 V. It is <em>not</em> capable of driving high loads (e.g. servos or motors).</p></figcaption></figure>

Using an Arduino board as a glorified battery to power low draw devices is perhaps the simplest thing you can do with it.

## Using Output Pins

Small loads - e.g. LEDs, daughter boards, sensors, etc. can be directly powered from onboard constant power pins using [jumper wires](https://www.exploringarduino.com/parts/jumper-wires/), or directly via the pins in the case of [Arduino shields](https://learn.sparkfun.com/tutorials/arduino-shields). In addition to a regulated $$5;\text{V}$$ output, most Arduino boards possess another, smaller regulator to provide a steady $$3.3;\text{V}$$ output for sensors.

<figure><img src="/files/lP297yF5UlWWH0L67URz" alt=""><figcaption><p>The 3V3 (3.3 V) and 5 V output pins on an Arduino MCU will each supply constant (always-on/non-programmable) power, and can be used e.g. to drive LEDs. Unsurprisingly, for the same current-limiting resistance, LEDs driven with the 5 V pin will be brighter than those driven by the 3.3 V pin.</p></figcaption></figure>

Note that all current must complete a circuit, and any devices driven by an output pin on your Arduino must return current to the board via a `GND` pin.

## Hardware

This module will utilises an [Arduino Mega](https://store.arduino.cc/products/arduino-mega-2560-rev3), which provides:

* two `+5V` supply pins and two `GND` pins along the right-hand edge of the board,
* one `+5V` supply pin, one `+3V3` supply pin, and two `GND` pins on the long-edge of the board without the button, and,
* one `GND` pin on the top-edge of the board,

for a total of 4 supply and five `GND` pins.

Note that all `+5V` pins are internally connected (i.e. are in parallel), as are all `GND` pins - meaning:

1. there is no difference between using any one or the other, and.
2. these can be further broken out via e.g. a breadboard.

<figure><img src="/files/DZVHALFpM6Ku5zgLt4P4" alt=""><figcaption><p>Arduino Mega power supply pins. Remixed from <a href="https://content.arduino.cc/assets/Pinout-Mega2560rev3_latest.pdf">https://content.arduino.cc/assets/Pinout-Mega2560rev3_latest.pdf</a> (CC-BY-SA).</p></figcaption></figure>

## Practical Considerations

### Current Limits

Even when chained together in parallel, there are practical limits on current that can be supplied by MCU power pins. These limits arise from a combination of:

1. what can be supplied by the power source to the board ([e.g. a computer via USB](https://docs.arduino.cc/learn/electronics/power-pins/), or a battery),
2. what can be sustained by [the MCU onboard voltage regulator](https://www.onsemi.com/pdf/datasheet/ncp1117-d.pdf),
3. what can be sustained by [the traces onboard the MCU](https://www.digikey.com.au/en/resources/conversion-calculators/conversion-calculator-pcb-trace-width), and,
4. what can be sustained by the [physical output pins](https://electronics.stackexchange.com/questions/352438/how-much-current-can-a-0-1-pitch-pin-header-pass) and [jumper wires](https://www.wiltronics.com.au/wiltronics-knowledge-base/what-are-jumper-wires/#:~:text=How%20much%20current%20\(I\)%20and,American%20Wire%20Gauge%20\(AWG\).).

{% hint style="danger" %}
:zap: **Warning:** An Arduino MCU should be able to supply up to $$500;\text{mA}$$ total across it's $$5;\text{V}$$ and $$3.3;\text{V}$$ outputs, with a further limit of only $$100-150;\text{mA}$$ on the $$3.3;\text{V}$$ output .

Exceeding these current limits can (at best) cause damage to the MCU and at worst, the connected source (e.g. your brand new laptop!).

1. <mark style="background-color:red;">**Always double check the expected draw of your circuit before power-on,**</mark>
2. <mark style="background-color:red;">**Always double check for short-circuits before power on, and,**</mark>
3. <mark style="background-color:red;">**Always take extreme care when powering your board via your computer!**</mark>
   {% endhint %}

### Common GND

It is important to remember that voltage potentials are always relative to a reference - usually `GND`.&#x20;

Where your circuit involves several power supplies (e.g. an Arduino powered by one battery, or USB, and a sensor by another), it is important to ensure they share a common reference `GND`. If e.g. your sensor board is powered by one battery, and your Arduino by another, it may (at best) not work, or (at worst) cause damage to either board.

A common `GND` is easily achieved by tying the negative/`GND` terminals of your Arduino, supplies, and sensor boards together.
