Reverse Polarity Protection
Reverse Polarity Protection is a runnable microcontroller simulation example on SensBench — open the wired circuit, inspect the code, and compile real firmware in your browser, no install needed. Last updated Aug 14, 2026.
FREE SIMULATOR EXAMPLE · BEGINNER
Reverse Polarity Protection
This example shows reverse-polarity protection with a 1N5817 Schottky diode — the one-component insurance policy every battery-powered circuit should carry. The protected circuit runs normally, and a reversed battery simply does nothing.
| Board | Arduino Uno (ATmega328P) + analog SPICE circuit |
|---|---|
| Difficulty | beginner |
| Category | circuits |
| Libraries | None — just the Arduino core |
| Runs in | Sensbench browser simulator — free, no account |

The exact circuit you get when you open this example — already wired, ready to run.
The sketch
// Schottky reverse-polarity protection
// 1N5817: low Vf = 0.3V, minimal power loss
void setup() { Serial.begin(9600); }
void loop() {
Serial.println("Protected circuit running...");
delay(1000);
}
How it works
The 1N5817 sits in series with the supply: forward-biased with correct polarity, it conducts with a small 0.3 V drop; reversed, it blocks completely. The sketch prints “Protected circuit running…” once per second — the program itself is trivial because the protection is entirely in the hardware.
The power loss is the design trade-off: the 0.3 V drop costs a little voltage and dissipates a little heat in exchange for making every reversed battery a non-event. The comment names the exact trade: “low Vf = 0.3V, minimal power loss”.
Before you build it for real
The protection costs a permanent 0.3 V from the supply — in a 3.3 V system fed by 3.7 V lithium cells that margin matters, and in high-current circuits the diode also dissipates I × 0.3 V of heat (a 1 A load burns 0.3 W in the diode). The diode’s reverse rating must exceed the supply: a 40 V 1N5817 is plenty for 9 V batteries, but a series stack needs a higher rating. And a reversed battery is not “safe” — it is blocked, not shorted; a truly reversed battery just sits there, and the circuit stays unpowered until the polarity is fixed.
Get the parts
Related examples
FAQ
Why a Schottky instead of a regular diode?
A Schottky diode’s forward drop is about 0.3 V versus 0.7 V for a silicon diode. In a battery circuit that difference is the difference between the circuit seeing 4.7 V or 4.3 V — often the margin between working and brownout. The 1N5817 also switches fast, though that matters less here.
What actually happens when the battery is reversed?
The diode becomes reverse-biased and blocks the current entirely — the protected circuit sees nothing, no current flows, nothing is damaged. The full reverse voltage appears across the diode, which is why the diode’s reverse rating must exceed the battery voltage.