In this article, we are going to take an in-depth look into the Arduino Uno power supply subsystem. It is important to understand the power supply routes on the Arduino so that we can properly leverage the onboard facilities to optimize the overall power sourcing of our projects.
The article could get a bit technical for beginners, but I still recommend that you go through it. I have formatted the article in a way that would help all kinds of readers find what they are looking for.
The Arduino Uno power supply subsystem can be divided into two main parts. The first part is the system that generates the 5V that is required for the microcontroller to run, and the second part is the system that manages power supply when more than one inputs are connected to the Arduino. (Yes the Arduino can be powered in multiple ways). The latter system is also responsible for generating the 3.3V on-board voltage.
So, two main parts
- Voltage Regulator subsystem – This is the part that generates 5V.
- Multiple Input Management subsystem – This is the part that manages multiple inputs.
Let’s take a look at the official schematic to locate our Arduino Uno power supply subsystem.
We will start with the first part.
Voltage Regulator Subsystem
This is the part of the Arduino Uno power supply subsystem where stable and constant 5V power is generated. This 5V is required by the microcontroller, shields and other necessary components on the board.
Understanding the hardware of the Voltage Regulator Subsystem
The 5V supply is produced by a low drop-out (LDO) voltage regulator. Voltage regulators take in input, step it down and give stable DC output. In the process of stepping down, the difference between output and input is given off as heat in normal voltage regulators. So we have to factor this loss into designing our circuits.
But on the Arduino Uno, we have a low drop-out voltage regulator. It dissipates less power in the form of heat allowing us to have an output that is very close to the input. Basically, you can get a 5V output even if the input is as low as 6V. Let us take a look at the schematic of this subsystem along with the physically mounted positions of the components.
The rectangular block on the left, titled X1, is the barrel connector. The barrel connector must be supplied a constant DC voltage in the range of 6-12V. The barrel connector also needs to have a certain kind of polarity as shown below. The center should be positive, and the outer covering should be negative, or in our case, GND.
The barrel connector is connected to the diode D1. This is a safety mechanism. The diode ensures that if you use a barrel connector with a different polarity than the one specified, the reverse polarity supply doesn’t get into the system and you don’t fry up your board.
The power supplied at X1 can be accessed at the Vin pin on the power expansion rail. You can use it to power any other external components in your project.
The diode is connected to the LDO voltage regulator. The voltage regulator converts the input to 5V, and this is sent to power on the board. The 5V generated here can be accessed at the 5V pin on the power expansion rail.
There are two electrolytic capacitors and a ceramic capacitor. These capacitors are called bypass capacitors. They are used to remove any unwanted AC ripples and give a clean noise-free DC output.
Working of the Voltage Regulator Subsystem
Input supplied at the barrel connector passes forward only if the polarity is correct, it can be accessed at Vin. Moving along, the input signal passes through the LDO voltage regulator and along with help from the capacitors a clean and stable 5V is obtained.
Let us now move on to the second part of the Arduino Uno power supply subsystem
Multiple Input Management Subsystem
If the barrel connector is supplying power to our Arduino project and we decide to update the program or get some values from the sensors on our screen, we can just plug-in the USB cable and do that without having to remove the AC-DC adapter. Behind this ease of use, functionality is a very intuitive circuit that makes a split second decision to ignore the power from the USB port, keep its data line intact and keep drawing power from the barrel connector. The Arduino obviously cannot accept both the inputs because that would lead to a surge in voltage and damage the board. So there is a selection mechanism present. This is the multiple input management subsystem.
Understanding the hardware of the Multiple Input Management Subsystem
The selection mechanism discussed above is hardware based. A comparator is used to select the aptest power supply for the board. The comparator on the Arduino Uno is (an IC) a device that compares two inputs and then drives the output to either 5V or ground (In our case).
The output of the comparator is connected to a p-channel MOSFET. The transistor acts as a switch and depending on the output of the comparator it makes the decision to either get its 5V from the comparator or the USB power line.
The output of the MOSFET then connects to the 5V line at the output of the LDO voltage regulator (not shown in above diagram) and to the on-board 3.3V regulator.
Working of the Multiple Input Management Subsystem
The comparator is given two inputs, Vin from the barrel connector and 3.3V from the onboard voltage regulator. The Vin, before getting connected to the comparator, goes through a voltage divider circuit. The voltage divider circuit divides the Vin voltage to exactly half of its original value. So if Vin = 6V, then Vin at the comparator’s input will be 3V. If you want to draw power from the barrel connector, Vin should be greater than 3.3V so that the comparator decides in its favor. Hence Vin should be at least 6.6V.
If Vin > 3.3V, the comparator is driven to 5V and the P-MOSFET turns on to allow power to flow in through the barrel connector.
If Vin < 3.3V, the comparator is driven to GND, and the P-MOSFET turns off to allow power to be sourced from the USB port.
The MOSFET acts as a switch here and sources the right power supply. It either supplies power from the USB connection. Or it supplies power from the barrel connector, keeping the serial communication part of the USB intact. The output from the MOSFET is fed to the on-board 3.3V regulator which then generates the 3.3V that we can use. In this way, multiple inputs are handled by the comparator-MOSFET duo, and we have one less thing to worry about.
This article should now enable you to understand how the power expansion rail is wired. It should also help you answer the question of how is it possible to have the barrel connector power up the Arduino and simultaneously attach a USB cable to transfer data to the Arduino microcontroller. With this we wrap up the Arduino Uno power supply subsystem, in the next post we will, look at the ATmega16U2 subsystem.