I am designing a device, and I want to be able to power it with either USB, or a 5.5mm DC plug.
I'm just wondering how I should implement protection in case someone accidentally plugs in both cables.
I am using a standard 5 pin micro USB jack, and a 3 pin 5.5x2.5mm DC Socket.
What is Your "device"? If it is an UNO i would suggest gluing a mechanical shield to the USB connector that couvers the DC plug connector. Than only one them can be connected.
Keep it simple has been said in many different environments. Don''t cross the river to find water we saye here.
Just arrange the plugs in a way that only one can be connected. A sliding door giving access to only one plug at the time.....
Don't make it rocket science if it csn be awoided.
Two Schottky diodes, one each in series with each supply is all you need. Supplies on the anodes, cathodes connected together and is the common supply point. The highest voltage supplies the current.
If you’re using AVR devices and you want to avoid the 0.3 volt drop created by the diode in the usb supply, look at the Uno R3 schematic. It uses a voltage comparator and a mosfet to disconnect the usb supply when it detects the barrel jack has more than about 7 volts present.
Solid state relays are totally inappropriate for the switching required.
LittleRain:
I am designing a device, and I want to be able to power it with either USB, or a 5.5mm DC plug.
I'm just wondering how I should implement protection in case someone accidentally plugs in both cables.
That is much the same as how the Arduino UNO, Mega, DUE etc are powered.