I've been looking all over but can't find just what I'm looking for: the smallest relay possible that's able to switch 5v.
Most relays I find are those chunky blue ones that can switch up to 250v and would take too much space in what I'm trying to build: a device that can independently switch multiple 5v USB ports. I have a number of very low amp 5V light strings that I would like to be able to switch on/off individually so was thinking of building one of these. But with the bulky blue relays it would be too big for my taste.
Anybody have any ideas or can point me in the right direction?
How about using mosfets instead of relays? If you don't need physical isolation they are way smaller than relays... for example IRLML series are in SOT-23 case:
IRLML0030TRPBF: max. 30V, 5.3A, or
IRLML6244TRPBF: max. 20V, 6.3A
are just two examples. Both can be triggered with 5V. But there are way more of them...
But if you want a relay perhaps THIS? (if i understand correct you won't switch 230V...)
I suggest transistor/fet approach as well.
But if for some reason you really want to go with relays, look for "SUBMINIATURE SIGNAL RELAY".
They are good for low voltage and max few amps, smallest ones are ~ 10x5x5mm.
Ya, what Neel wrote above about ordering from DigiKey (or Mouser, Arrow, Avnet, etc. or your local favorite electronic parts supplier.) You plug in the specs, they'll give about eleventy thousand parts to pick from. Narrow it down a bit by specifying parts that are in stock, not obsolete, and available in small quantities -- you don't want a reel of 10,000 even if the price per unit is really great.
If you do that, don't forget diodes for back EMF! Even an actual EE who's been doing software and firmware for too long can forget that once. Once.
True, diode is for relay coil spike blocking and it's not needed for transistor, but ONLY if mosfet doesn't switch inductive loads (like relay). If it does it will go into electronic heaven quite quickly...
I tend to use mosfets rather than relays if only possible. The reason (beside them being smaller and quicker in switching) is relay switching noise/spikes, which can cause real havoc, like unwanted resets, toggles of outputs, display garbles... etc...
I have a few mosfets switching on 5v motors and use a snubber diode. I have got in the habit of using N-type mosfets. I have used a couple of P-type power mosfets that have the diode built in.
I prefer N type also. One of reasons is that P type tends to switch on for a moment when circuit is powered on (i'm not talking about esp only, but in general), since P type is open when/if gate is at GND level.
Yeah, many mosfets have a diode built-in, but in case of using inductive loads additional one in parallel to inductive load is still necessary since two have a different functions. AI generated explanation:
The built-in "body diode" in a MOSFET handles inductive kickback, whereas a snubber suppresses high-frequency voltage spikes caused by circuit trace and transformer leakage inductance. You generally need both because they perform entirely different functions. [1, 2, 3, 4, 5]
Understanding when—and how—to use a snubber with a MOSFET's body diode depends on the circuit's specific demands.
The Body Diode
Purpose: Acts as a freewheeling/flyback path to safely dissipate continuous reverse currents, such as the inductive current from a motor. [1, 2]
The Catch: Standard MOSFET body diodes have a poor reverse recovery time (they take too long to turn off). In high-frequency or hard-switching circuits, this causes significant power loss and large voltage spikes. [1, 2, 3, 4, 5]
The Fix: In demanding applications (e.g., synchronous rectifiers, H-bridges), engineers frequently place an external, fast Schottky diode in parallel with the MOSFET. This bypasses the slow body diode entirely, taking advantage of the Schottky's faster switching and lower forward voltage drop. [1, 2, 3, 4, 5]
The Snubber Circuit
Purpose: Suppresses rapid voltage transients ((dV/dt)) and high-frequency ringing caused by the interaction of leakage inductance and parasitic capacitance when the MOSFET turns off. [1, 2, 3]
Usage: Even if you have a great freewheeling diode, it does not stop high-frequency ringing. An RC snubber (Resistor + Capacitor) absorbs this transient high-frequency energy and dissipates it as heat in the resistor. [1, 2, 3]
Placement: Snubber components must be placed as physically close to the MOSFET's drain and source pads as possible to minimize stray trace inductance. [1]
Yeah, that sounds more logical to me, too. I generally place relay diode directly across relay coil terminals (on bottom side of PCB). Placing it next to mosfet would result in spike going from relay coil all the way via pcb trace to mosfet and "transmitting" noise during it's travel...