I know all dev boards are different but on a well designed dev board (from a major company like STM) do you think it's appropriate to add a diode to prevent the 5V pin on a secondary USB connector from "seeing" the 5V provided by the primary USB connector? What pros/cons are there to this?

E.g. in this picture, we see two USB connections both of which are capable of powering the board if connected on their own. The board is a NUCLEO-F303K8 (manual here) and it has two USB cables connected (the one, that I'm calling the primary one, on the left and the secondary one, on the right, where the USB wires have been broken out, soldered onto to a small bit of header and then connected to the appropriate pins on the dev board).

enter image description here

Here we can see a diode between the 5V of the secondary connector and the 5V pin of the board.

This seems sensible - I can imagine that's it's not good for the secondary connector to see the 5V of the primary connector if the primary connector is plugged in and powering the board.

Is this the case? But I also wonder about the voltage drop introduced by the diode. The diode is something like this 1N4001 which has "about 0.7V drop for typical usage". This would drop the 5V of the USB to 4.3V - well below the 4.75V lower threshold listed in the manual for powering the board via the 5V pin - and so make the secondary USB connector unsuitable for ever powering the board on its own.

And I see that there is no similar diode protecting the primary USB connector (either on the breadboard or the PCB).

schematic for board's USB connector

And in-fact the manual has fairly explicit warnings about the order in which one should connect power to the 5V pin and then connect the primary USB (with dire warnings if you fail to follow their stated ordering - "the PC may be damaged or current supplied is limited by the PC").

So two issues really - I can't see that the secondary USB can provide the necessary minimum of 4.75V if the diode is in place and it looks like a risky business to have 5V coming from two different USB connectors at the same time.

I'm inclined to think the best thing to do is to get rid of the diode and only ever connect the 5V red jumper wire from the secondary USB connector iff the primary USB connector is not plugged in.

Sorry for letting this question get a bit meandering. I've just been looking at this tutorial (the source of the photo up above) and been wondering if the setup shown is really appropriate. The tutorial is by Shawn Hymel - his work is always super informative and educational and I'm sure any misunderstanding in set up or application is on my part.

  • \$\begingroup\$ Hmm... just after posting, I've found a very similar question. I'll leave my question here for a while as it's not quite identical but I can understand any move to close. \$\endgroup\$ Commented Dec 25, 2020 at 13:11
  • \$\begingroup\$ A single diode as shown is not completely safe either. If the voltage coming in from the right side cable is Vf higher then the other one excessive current can still flow. \$\endgroup\$ Commented Dec 25, 2020 at 13:22
  • \$\begingroup\$ The tutorial you mention is about a virtual COM port. I'm assuming the right side cable is the actual virtual COM port and the left side cable is only for development/programming purposes? In that case a quick solution for development would be to simply not connect the right side cable's 5V at all. Always have the board powered from the left side cable during development. Once development is finished you can power the board from the right side cable as the other one is no longer needed. \$\endgroup\$ Commented Dec 25, 2020 at 13:35
  • \$\begingroup\$ @Unimportant - yes, that's what I'm inclined to do (and what I outlined in the second last paragraph). \$\endgroup\$ Commented Dec 25, 2020 at 15:11


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.