Sub topic 12
Powering an Arduino Board: VIN, 5V, 3.3V, and USB
This chapter assumes you know the following:
- Ohm's law and the power formula P = V × I.
- Why linear regulators waste the voltage difference as heat.
- How to read a battery's nominal voltage and capacity.
Here we apply those ideas to an actual board. The examples use the Arduino Uno R3, whose power circuit is typical of classic 5 V boards. Other boards differ in the details, so check your board's schematic and datasheet before relying on a number.
The Power Paths on a Board
A board has several places where power can enter or leave. They are not interchangeable. Each one connects to a different point in the power circuit, and that decides what protection and regulation you get.
| Connection | Direction | Regulated by the board? | Typical use |
|---|---|---|---|
| USB connector | In | Partly (5 V from the host, through a fuse) | Programming, bench power |
| Barrel jack | In | Yes, by the 5 V regulator | Wall adapter, 9 V battery |
| VIN pin | In (or out) | Yes, by the 5 V regulator | Battery pack of 7 to 12 V |
| 5V pin | In or out | No when used as an input | Output of your own regulator |
| 3.3V pin | Out | Yes, by a small 3.3 V regulator | Powering low-current 3.3 V sensors |
VIN and the Barrel Jack
The barrel jack and the VIN pin are wired together. Both feed the board's on-board 5 V linear regulator. On the Uno R3 the jack passes through a series diode first, so connecting the jack backwards does not reach the regulator. The VIN pin has no such diode. A battery connected to VIN with the wrong polarity can destroy the board.
The Uno documentation recommends 7 to 12 V on VIN. The limits behind that range are:
- Below about 7 V, the regulator's dropout starts to matter. The regulator needs its input to be higher than 5 V by the dropout voltage, and the series diode costs a further 0.5 to 0.7 V. A 6 V pack of four fresh alkaline AA cells sags below that as it drains. The 5 V rail then droops and the board resets or behaves oddly.
- Above about 12 V, the regulator turns too much of the difference into heat. The absolute maximum is around 20 V, but you would not want to operate there.
The heat limit is the part people overlook. The regulator dissipates (VIN − 5 V) × I_load, as in the heat calculation from the linear regulator chapter. The helper below compares a supply with a load and flags marginal setups.
def vin_check(v_in, load_ma, v_out=5.0, min_vin=7.0, max_vin=12.0, max_heat_w=0.5):
"""Sanity-check a VIN supply against a 5 V linear regulator board."""
heat_w = (v_in - v_out) * load_ma / 1000.0
notes = []
if v_in < min_vin:
notes.append("below recommended VIN range: rail may droop")
if v_in > max_vin:
notes.append("above recommended VIN range")
if heat_w > max_heat_w:
notes.append("regulator will run hot")
return heat_w, notes or ["ok"]
print(vin_check(9.0, 100)) # (0.4, ['ok'])
print(vin_check(12.0, 200)) # (1.4, ['regulator will run hot'])
print(vin_check(6.0, 100)) # (0.1, ['below recommended VIN range: rail may droop'])The 0.5 W threshold is a rough rule of thumb for a small surface-mount regulator that relies on the board's copper for cooling. The Uno's regulator can survive more for short periods, but it will get too hot to touch.
The 5V Pin
The 5V pin is directly connected to the board's 5 V rail. It behaves in two ways depending on how the board is powered:
- As an output, when the board is powered through USB, the jack, or VIN. You can draw current from it to power sensors and modules. The limit is whatever the source can deliver. From USB, the host port (typically 500 mA) and the board's resettable fuse set the ceiling, and everything on the board shares that.
- As an input, when you feed regulated 5 V into it from your own regulator. This bypasses the board's regulator entirely, along with its protection diode and overvoltage tolerance.
This second use is the one to be careful with. Anything you apply to the 5V pin goes straight to the microcontroller. If the supply is 5.5 V or higher, or has voltage spikes, you can damage the chip. A battery that is not regulated must never be connected here. Three AA cells at 4.5 V would work for a while, but fresh alkaline cells start above 4.8 V and the voltage keeps changing as the cells drain. Power the pin only from a regulated 5 V source such as a buck, boost, or buck-boost converter module.
Feeding the 5V pin is often the efficient option. A switching converter outputs 5 V at 85 to 95 percent efficiency, whereas going through VIN and the linear regulator gives you 5 V at roughly (5 / V_in) efficiency. For a 2S LiPo pack (7.4 V nominal) that is about 68 percent. A buck converter into the 5V pin fixes this, with these caveats:
- Do not connect USB and the 5V pin supply at the same time unless you know how the board handles it. The board's USB power switch does not isolate the 5V pin, so two 5 V sources can fight each other.
- Check the converter's output with a multimeter before connecting it to the board.
- Add a fuse or a reverse-polarity diode on the battery side, because no onboard protection exists on this path.
USB Power
USB supplies 5 V and acts as a power source and programming link. The Uno connects it to the rail through a resettable polyfuse and a power selector. The selector is a comparator and a MOSFET. When VIN is above roughly 6.6 V, the board uses VIN. Otherwise it uses USB. This means you can plug in a battery or adapter and a USB cable at the same time without the two sources shorting together.
Practical consequences:
- A USB port limits you to about 500 mA (USB 2.0 hosts) before the host or the fuse cuts you off. Motors, LED strips, and radios can exceed this.
- A USB power bank can also feed the board through the USB connector. Some power banks shut off when the current is very low, which is a common failure for sleeping boards. Boards that draw only a few milliamps trigger the shutoff.
- USB voltage is nominally 5 V but can read 4.4 to 5.25 V depending on cable resistance and load. Long thin cables add more drop.
The 3.3V Pin and 3.3 V Logic
On the Uno, the 3.3V pin is an output only. A small regulator makes 3.3 V from the 5 V rail, and it can supply about 50 mA. That is enough for a sensor or a small radio module, but not for an ESP8266 or a Wi-Fi module that peaks at 300 mA or more. Never feed power into the 3.3V pin unless your board's documentation says you can.
Many modern boards run entirely at 3.3 V: the Arduino Due, the Nano 33 family, the Pro Mini 3.3 V variant, and ESP-based boards. These matter for battery projects, because a single lithium-ion cell (3.0 to 4.2 V) can power a 3.3 V board through a low-dropout regulator without a boost converter.
A rough guide for battery choices:
| Battery | Nominal voltage | Good connection | Notes |
|---|---|---|---|
| 9 V alkaline | 9 V | VIN or jack | Light loads only |
| 4 to 6 × AA | 6 to 9 V | VIN or jack | Check voltage at end of discharge |
| 2S LiPo | 7.4 V | VIN, or buck to 5V pin | Add protection circuit |
| 1S Li-ion/LiPo | 3.7 V | Boost to 5V pin, or 3.3 V board | Never exceeds 4.2 V |
| USB power bank | 5 V | USB connector | May shut off at low draw |
Current Limits on the Pins
The power pins are only half of the picture. Each I/O pin on an ATmega328P board is rated for 20 mA recommended and 40 mA absolute maximum, and the whole chip's total current has a limit. Do not power an LED strip or a motor from a pin. Power it from the battery or regulator rail and switch it with a transistor or MOSFET, with the grounds connected together.
A Safe Bring-Up Procedure
- Measure the source voltage with a multimeter under load before connecting it, not just open-circuit.
- Confirm polarity. Red goes to VIN or the positive input, and the ground wire to a GND pin.
- Connect only the board first, with no peripherals. Check that the 5V pin reads about 5.0 V.
- Add peripherals one at a time and watch for resets, which indicate the supply is sagging.
- Touch the regulator briefly. If it is too hot to keep your finger on, reduce VIN or move to a switching converter.
Exercise
You power an Uno from a 12 V pack on VIN. The board and sensors draw 150 mA at 5 V. How much heat does the on-board regulator dissipate, and what would you change if it runs too hot?
Show answer
The heat is (12 − 5) × 0.150 = 1.05 W, which is too much for the small regulator. Either lower the input voltage (for example, use a 7 to 9 V pack) or put a buck converter between the pack and the board, and feed its regulated 5 V output into the 5V pin. The 5V pin has no protection, so confirm the converter output reads 5 V before connecting it.
Exercise
You want to run a 3.3 V Wi-Fi module that peaks at 250 mA from the Uno's 3.3V pin. Will that work? What would you do instead?
Show answer
No. The Uno's 3.3V pin supplies only about 50 mA. Power the module from a separate 3.3 V regulator that can deliver more than 250 mA, with ground shared with the Uno. Because the Uno's pins are 5 V logic, also level-shift the signals going into the module.