User Tools

Site Tools


arduino:external-power-supply

This is an old revision of the document!


Power Arduino Nano with an external power supply

Introduction

The issue of powering an electronic circuit may seem more or less trivial. Yet, powering an Arduino project may not be such a straight-forward task. Just think about the case where you are powering your device with an external power supply connected to the 5V pin of the Nano and you are connecting the USB cable because you need to upload a new version of the program. The external power supply and the computer powering the USB port produce a different voltage. Yes, both are around the area of +5V, but different to each other. The one with the lower voltage will have to endure a current that passes through it, which is produced by the higher voltage power supply. Shall it survive? Who is going to be the victim, the external power supply or your precious PC?

This article provides a solution to this problem, with an easy and inexpensive solution.

WARNING:
This article refers only to Arduino Nano. 

For a discussion regarding Arduino UNO, see below

Schematic

Arduino Nano Power

Handmade schematic? See why..

Let's have a look at the power circuit within Arduino Nano. This is presented in the dotted box of the schematic. Note that I have excluded capacitors and other components of the power circuit because I want to focus on the principle. You may look at the official Arduino schematics if you need more details.

The Nano can be powered via the USB socket. In that case, current flows through a fuse that protects your computer from over-current, then through a SS13PL schottky diode and then powers the internal circuitry. In Arduino Nano clones, the diode can be an MBR0520 and the fuse may not exist at all. The forward voltage of the schottky diode is very small (in the area of 0.35V to 0.38V) and allows the ATmega controller of the Arduino to work within its voltage specifications.

The Nano module provides another option to be powered through pin Vin. According to the specifications, Vin can range from 7 to 12V. This range is imposed by the LM1117-5.0 regulator which receives as an input a voltage at least 1.2V higher than its output and delivers current up to a maximum of 800mA.

The output of the LM1117-5.0 and the output of the schottky diode are connected together and they power the internal circuitry. Either of them can by itself power the Nano, or even both of them at the same time. The circuit voltage will be the higher of the two sources. The LM1117 and the schottky make sure that current from one power source will not enter the other, because of the uni-directional nature of both circuits.

The pin of Arduino Nano marked as 5V is designed to be an OUTPUT, powering peripheral circuits such as a real time clock, an SD card reader etc. and not as an Input. The total consumption of the Arduino plus the peripherals should not exceed 800mA.

Now, we are getting to the real problem. What happens when the peripherals are Ethernet boards, relay boards etc that consume power exceeding the capabilities of the Nano? An external power supply is needed. Most peripherals designed for Arduino are powered by 5V. We end up with a situation where we need a 7-12V supply for the Arduino and another 5V supply for the peripherals, which is becoming an overkill for our project.

On top of that, LM1117 is a linear regulator. This means that the voltage difference between its input and its output is consumed as heat. This is really bad, especially when you are forcing the component to work close to the limit of 800mA, where the device suffers from the high temperature. There is absolutely no thought for enhancing the component with a heat sink, because of the limited space.

The above issues make several project designers who are already using an external 5V power supply for all devices of their project to take the short path and power the Nano via the 5V pin. This arrangement will work, provided that the designer has made sure that the USB port will never be used. But if not, disaster is just waiting to happen. And we all know that software development is a never ending process, requiring updates for bug corrections and upgrades.

The solution is very simple, inexpensive and I believe it is compliant to the Arduino architecture. If the external power supply is not directly connected to the 5V pin but through a diode, all three power sources (Vin, USB and the external power supply) will be protected from receiving inbound currents, thus protecting both themselves and the other power sources.

Such a diode should have a very low forward voltage to allow the ATmega to operate within its specified voltage range. Do not consider at all diodes such as the common 1N4001-1N4007. The most appropriate diode in our case is a 1N5817 Schottky Barrier rectifier which has a very low forward voltage drop and is able to withstand a maximum current of 1A. Another diode of the same family, 1N5819 can also be used, although its characteristics are not so good as the 1N5817. Both diodes have the same price and are easy to find in stores.

In my projects with an Arduino Nano, I always include a 1N5817 diode and use it exclusively for powering the Nano module. All other devices are powered directly by the external power supply, as shown in the schematic. This provides the capability to separate the power feeds and use bypass capacitors at each point of the circuit where they are required.

Can I use it for Arduino UNO?

Arduino UNO, according to its V3 schematic, has a bit more elaborate power circuit where an opamp comparator checks the voltage at pin Vin.

If the voltage is higher than 6.6V, the comparator blocks a FDN340P MOSFET which normally allows current to flow from the USB power supply to the circuit. But, if Vin is lower than 6.6V, the MOSFET conducts. Due to the fact that MOSFETs conduct in both directions, a voltage applied at the 5V pin might interfere with the USB voltage.

Therefore, the 5V Arduino UNO pin should be used only as Output.

My view on the subject is that I would not waste an UNO to operate as a controller somewhere inside a closet. The UNO board is suited mostly for development activities. If you want a pure controller board having the exact same functionality, with the same ATmega328p chip but in smaller size and with smaller price, go with a Nano.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
arduino/external-power-supply.1551455985.txt.gz · Last modified: 2019/03/01 17:59 by Ilias Iliopoulos