Ultra-fast, resettable smart fuse driven by Microchip’s new PIC16F13145. On-chip comparators, ADC & Configurable Logic Block cut trip latency to 31 ns and total shutdown to ≈200 ns
1. Why bother with a “smart” fuse?
An ordinary glass fuse reacts in tens of milliseconds; a mechanical breaker is even slower. Sensitive lab gear, Li-ion batteries and motor drives can destroy themselves in micro-seconds.
My goal was to create a compact, resettable protector that:
- Detects a hard short in ≤1 µs
- Allows brief inrush surges (“slow-blow” behaviour)
- Consumes almost no standby power
- Runs on a single low-cost 8-bit MCU
The PIC16F13145 is a perfect fit for this application, offering two 50 ns comparators, a 10-bit ADC with computation, and a hardware Configurable Logic Block (CLB), which enables faster response times than a microcontroller alone.
I only used through-hole parts because I wanted a quick prototype, but using SMD on a custom PCB would allow for greater precision.
3. Schematic overview
Below is the schematic of the components connected to the development board.
Here’s a picture of my prototype board with all components soldered in. Note that the diode is missing because I didn’t use any inductive loads during testing.
Regarding the digital hardware inside the CLB, I use an SR latch whose primary input is the comparator output. The comparator trips when Vₛₕᵤₙₜ, the voltage across the sense resistor, exceeds 1.024 V (taken from the on-chip voltage reference). With a 0.1 Ω resistor, this corresponds to roughly 10 A. You can, of course, adjust the reference voltage or the resistor value to set different trip currents. A second input to the latch comes from the overflow signal of Timer 2. When the latch sets, it triggers an interrupt that disables the PWM driving the MOSFET gate and turns on the LED. Pressing the button resets the latch and re-enables PWM with a soft-start ramp.
Because the latch in the CLB is clocked at 32 MHz, the over-current trip latency is only one cycle (about 31 ns), which is orders of magnitude faster than polling a flag in C.
4. Building & testing
1. Flash the Nano – MPLAB X > “Make and Program Device”.
2. Soft-start – PWM ramps from 0 % to ~70 % over 400 ms.
3. Force a short – briefly short the load to ground; PWM stops, LED lights instantly.
4. Press reset – latch clears, PWM soft-starts again.
The total time, from the comparator trip to shut down should be about ~200 ns including MOSFET turn-off.
5. What I learned about CLBs
- A single SR-latch + comparator can replace dozens of lines of C and race-critical ISR code.
- Direct inputs (no synchroniser) are essential for sub-µs response.
- You can reload a new bit-stream on the fly, imagine field-upgrading protection logic without touching hardware.
6. Improvements & ideas
- Dual-threshold logic: instant trip at 2 × IN, timed trip at 1.2 × IN.
- UART fault logger using the PIC’s ADC to capture peak current before shut-off.
7.Conclusion
The Configurable Logic Block turned a humble 8-bit PIC into a hardware-deterministic protection IC. With barely 500 bytes of code and a few passives I now have a re-usable, micro-second breaker that costs under $5.
Happy making!