VIN PIN and USB connection at the same time and switching between both

Hello,

How the power supply through VIN PIN and USB port to PC works when connected at the same time and how the the switching between both works please?

I can see that when I connect the Arduino power supply via VIN PIN, then USB power supply is immediately disconnected (current drain on USB drops from 0.08A to 0A) and when I disconnect the power supply from VIN PIN the USB starts to be used as a power supply without the circuit even notices that.

Is there any description how that works?

Thanks a lot
Petr

Basically Vin is being monitored by a voltage comparator.

When Vin is present, a MOSFET P channel transistor turns OFF which disconnects USB 5v from running the Arduino; the output of the 5v voltage regulator (input being Vin) then powers the Arduino.

The switching occurs when "Vin" exceeds 6.6 V.

Note incidentally, that the FET is connected "back to front" - it still works however!

Look at the top left of the Arduino UNO schematic. https://content.arduino.cc/assets/UNO-TH_Rev3e_sch.pdf There is a comparator and a MOSFET. One side of the comparator is from the 3.3V regulator. The other side is from the Vin pin through a 2:1 voltage divider (two 10k resistors). When half the Vin pin voltage exceeds 3.3V, the MOSFET disconnects the Arduino UNO from USB power.

1 Like

On the earlier versions including Nano the switch was done with a diode. The reason for using the MOSFET is you no longer have the approximate 0.5V drop. This appeared on the +5 which became +4.5 when operating on USB. The FET basically performs the same function without the large voltage drop. The problem als estabarated itself when using the A/D as the +5V reference became +4.5V when using USB.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.