User Tools

Site Tools


arduino:external-power-supply

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
arduino:external-power-supply [2019/03/01 17:58]
Ilias Iliopoulos [Can I use it for Arduino UNO?]
arduino:external-power-supply [2024/02/02 21:47] (current)
Ilias Iliopoulos
Line 1: Line 1:
 ====== Power Arduino Nano with an external power supply ====== ====== Power Arduino Nano with an external power supply ======
 +
 +{{htmlmetatags>​metatag-keywords=(arduino,​ nano, power, external power supply) ​
 +metatag-description=(Power Arduino Nano with an external power supply)
 +}}
  
 ===== Introduction ===== ===== Introduction =====
Line 26: Line 30:
 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 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 otherbecause ​of the uni-directional nature ​of both circuits. ​+The output of the LM1117-5.0 and the output of the schottky diode are connected together and they can both 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 schottky ​diode makes sure that current from the power source ​connected to Vin will not flow through ​the USB port. Unfortunatelythe LM1117-5.0 does not present such unidirectional characteristics. Just try powering an Arduino Nano via the USB port and measure with a voltmeter the voltage at Vin. **You will be surprised to find a voltage around 4.2V!** This means that our PC is trying to source current into the external power supply!  
 + 
 +Well, in "​normal"​ circumstances,​ the power supply connected to Vin should be higher than 7V, so this voltage will block the schottky diode and will power the circuit. Unfortunately,​ there is nothing __normal__ in electronics. We need to anticipate every possible situation and design our circuit accordingly. It is like software design where 90% of the code is written to cope with situations that may never occur. In the electronics design, the bug is identified by its burning smell!!! 
 + 
 +**WARNING:​** 
 +It is typical in new designs and repairs of old circuits to power the Arduino from a power supply that is also used for other purposes. Consider the case where you want to update your Arduino code, in-circuit. You turn off the power supply and connect a USB cable from your PC to the Arduino USB port. Although your intention would be that only the Arduino will power-up, you will find yourselves in a situation where your PC is providing power to all external circuitry that happens to be connected to Vin! A solution to this problem is easy and can be implemented using the method that I describe below. ​   
 +   
 + 
 +Now, let's go to the ''​5V''​ pin. 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 etcand not as an Input. The total consumption of the Arduino plus the peripherals should not exceed 800mA. 
 + 
 +An opposing argument would come from the Documentation section of the [[https://​store.arduino.cc/​arduino-nano|official Arduino web site]]:  
 + 
 +<​file>​ 
 +  Power 
 +  The Arduino Nano can be powered via the Mini-B USB connection,  
 +  6-20V unregulated external power supply (pin 30), or 5V regulated  
 +  external power supply (pin 27).  
 +  The power source is automatically selected to the highest voltage source.  
 +</​file>​ 
 + 
 +This states that the Nano can be powered from a 5V regulated external power supply on pin 27, so why do I believe that the pin is OUTPUT only? Because our designs must take into account all possible ​ circumstances and a combination of multiple modules. For example, if the USB powers the Nano with a voltage of 5.0V and at the same time we have a 4.9V voltage at pin 27, this means that a current will flow from USB into the external power supply. The Nano may not have a problem with that, but the external power supply will most certainly not be happy about this!    
  
-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. ​ 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. ​
Line 41: Line 65:
  
 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. 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.
 +
 +Remembering also the problem in back-powering circuits from USB to Vin that was discussed above, if we wish to power our circuit through Vin, we can also use a diode at the point of entry to Vin. This will ensure that current will never flow from our Arduino to other circuits. Any diode of the 1N400x series will do, provided that you have 0.7V to spare, otherwise a 1N5817 will do the job. 
  
 ===== Can I use it for Arduino UNO? ===== ===== Can I use it for Arduino UNO? =====
Line 46: Line 72:
 Arduino UNO, according to its V3 schematic, has a bit more elaborate power circuit where an opamp comparator checks the voltage at pin Vin.  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 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. ​ +If the voltage ​at Vin 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 ​and therefore, power is provided **only** by the Vin source. But, if Vin is lower than 6.6V, the MOSFET conducts ​and power is provided **only** by the USB port, since Vin is too low for the NCP1117 regulator to provide a proper 5V output (see note). Due to the fact that MOSFETs conduct in both directions, a voltage applied at the 5V pin might interfere with the USB voltage, creating a condition that we need to avoid for the sake of all power sources. (**Note**: When power is provided by the USB port, the 5V voltage is also applied to the output of the NCP1117ST50T3G regulator. Normally, such regulators require their input to be at least 1 to 2 Volts higher than the input, that is why the value 6.6V has been chosen for the source selection and transition. The Arduino design team has probably tested that the regulator blocks this "​reverse"​ voltage of 5V and does not allow it to interfere with Vin.)   
  
 Therefore, the 5V Arduino UNO pin should be used only as Output. 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.+My personal ​view on the subject is that I would never 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 ​as the UNO, with the same ATmega328p chip but in smaller size and with smaller price, go with a Nano. 
 + 
 +~~DISQUS~~
arduino/external-power-supply.1551455913.txt.gz · Last modified: 2019/03/01 17:58 by Ilias Iliopoulos