Friday, September 10, 2021

Arduino Pro Mini Vin/RAW vs. Vcc vs. FTDI

Goal

Connect an Arduino Pro Mini such that external devices get their power from an external power supply, while the Pro Mini remains connected via FTDI to a USB port on a computer, for programming, and serial-monitor uses.

Challenges

  • Powering the Pro Mini board + external devices totaling more than 200mA exceeds the rating for the on-board voltage regulator (VReg) on Vin/RAW.
  • Powering the Pro Mini board using Vin/RAW (i.e. VReg input > the board's operating voltage / 5v or 3.3v) sends voltage/current back, from the VReg output, through various routes, into the FTDI output pins, and in turn through the USB connector, risking damage to the USB port on a computer used for programming or a serial monitor.
    • Note: Disconnecting the FTDI +5v pin prevents the FTDI from communicating with the Pro Mini, and doesn't block all the backflow paths anyway.
  • Powering the Pro Mini board using its Vcc pin with an externally regulated voltage matching the board's operating voltage, basically attaches to the same "bus" as the output pin of the on-board VReg.  This conflicts with input voltage from the USB/FTDI and may backflow current into the USB port.
    • This might be tolerated, but still isn't an ideal, safe way to hook things up.
  • Logic voltage to control high-power external devices (e.g. motor, LED-array, or loud buzzer) must use the same reference +/- voltage as the board, or HIGH and LOW might make no sense.

Solution

While programming and developing, ONLY connect the GND of the external power supply to the GND of the Arduino Pro Mini, creating a common reference point for the Negative / NEG / "-" / Ground / 0v point, but _NO_ connection or conflict for the Positive / POS / "+" / Vcc.

Later, in order to run the external devices directly from the external power supply, and separately also run the Arduino Pro Mini from the same external power supply, completely remove the FTDI/USB device, and connect the external power supply to the Pro Mini via the appropriate pin, Vcc or Vin/RAW.

Explanation

The reason this works is that the difference in potential (voltage) observed relative to GND is polarized / directional based on which way current flows in the circuit.  If the GND reference point for both the board+USB and the external power supply are tied together, then the relative reference point for current flow, is also common.

Transistors (typically used to allow low-current logic to control a higher current device) trigger (amplify) based on current flow, so it only matters that the signal (base) current flows the same direction as the load (collector/emitter) current.  With the GND for both power sources (USB/FTDI and external) tied together, the current flow direction will match.

Connection Scenarios

  1. Programming / Development / Debugging
    • USB/FTDI Connected - supplies power to Arduino Pro Mini
    • Only Arduino Pro Mini GND pin connected to external power supply GND
      • i.e. Pos NOT connected
    • Pos and Neg from external power supply connected to supply power on external devices
  2. Standalone
    • USB/FTDI NOT connected to Arduino Pro Mini
    • Both Pos and Neg from external power supply connected to Pro Mini Vcc and GND
    • Pos and Neg from external power supply connected to supply power on external devices

Disclaimer:

The terminology used here, and maybe even some of the technical statements might not be expressed in the same terms as are used to explain electronics circuits and concepts elsewhere.  This was just my attempt at explaining things the way it makes sense to me, so that when I forget how this works, I can use this as a reminder.  Hope it helps someone else who is struggling with the same thing while developing with an Arduino Pro Mini.

Some of the discussions about this seem to go nowhere, or end in unresolved debate:
  • https://forum.arduino.cc/t/power-the-pro-mini-through-vin-and-serial-ftdi-chip/317067 
  • https://forum.arduino.cc/t/connecting-5v-vcc-to-an-arduino-pro-mini-or-to-any-arduino/340382
  • https://electronics.stackexchange.com/questions/97184/how-to-power-arduino-pro-mini-via-vcc-pin-12v-input
  • https://forum.arduino.cc/t/powering-pro-mini-and-ftdi-serial-question/252020