Using a voltage reference as input voltage protection

After further investigation… the current limits I mentioned are peak switching current, not average. Kinda lame, since it means that 350 mA is more like 60 mA. Much less than I’d like.

What’s interesting is that there’s another chip, the SX1308, which has the same SOT-23 package, is cheaper, but includes a whopping 4 A power MOSFET. That’s pretty solid. But it’s an “extended” part, and of course even if the controller is tiny, the supporting components (inductor and caps) are not necessarily so small.

So I think I may just depend on an external board. They’re common on Aliexpress. Need to figure out an appropriate mounting strategy, though.

Here’s what I’ve got for the high-side switch:
Imgur

Don’t need super fast switching speeds. If my read of the datasheet is correct, a Vgs of 5v should give a Vds of ~0.25v at 5A. More than good enough.

I was thinking there might be a way to avoid the second MOSFET, possibly by using the tri-state aspect of the GPIO pin. But I couldn’t figure out a topology that worked that didn’t either expose the pin to 5v or prevent it from being pulled past 3.3v. So I threw in another MOSFET.

R8 and R9 are unnecessary. For R8, If the port pin doesn’t want to go to zero volts, pulling it down with 10K isn’t going to fix that. As for R9, there’s no need for a “minimum load” on the PFET.

The microcontroller pins start in high impedance mode, so it seemed wise to ensure Q1 was in a deterministic state before they’ve been configured. I was undecided about R9. One diagram I saw put it in, and it seemed perhaps useful to not let it float. I’m not sure if leakage would cause it to float up to 5V when unconnected.

The design so far…
Imgur

U5 is the external interface. U1+U2 are the microcontroller headers. Features:

  • Switched >1A 5v supply
  • Switched >1A ground
  • Current measurement on switched and generic ground
  • Overvolt protection on 2x digital inputs and 2x analog inputs
  • 11:1 analog divisor (supports up to ~24v signals)
  • Optoisolator output
  • Serial TX/RX lines with green/red LEDs
  • I2C lines with pullups

TX/RX/SDA/SCL can be used as generic outputs if required. And three more if a 10k resistor in the way is acceptable.

I might refine this a bit more but I’m reasonably happy so far. Encompasses a half dozen previous projects much more simply. Even if I have to add stuff (I2C sensors, etc.), this handles a lot of the basic stuff. Fits on a 30x50mm PCB. BOM of <$1/board.

All done:
Imgur

$17 for 10, assembled and shipped. Not a bad price. I did have to swap out some components that turned out to have additional costs, but it wasn’t a big deal. Among other things, I apparently used a resistor value that wasn’t in their basic inventory (seems like they only guarantee the E6 series).

I used rectangular pads instead of thru-holes for the external contacts. I’ve never been very happy with thru-holes; if you have stranded wire or something they’re annoying to connect, and it’s hard not to burn the insulation on the wires. Also not great if you need multiple wires going to the same pad. With flat pads, you just make a solder blob and stick the wire(s) in it. Easy. Easy to desolder, too.

The board isn’t that efficiently designed, but due to some layout constraints it would be hard to go much smaller. Also, didn’t bother arranging the text, etc. to be perfect. And just used the auto-router. Fine for my purposes.