Electronic circuits · no code

Reverse Polarity Protection

A 1N4007 diode in series protects the circuit if you connect the battery the wrong way round: the LED stays off, but nothing gets damaged.

  • LevelBeginner
  • Time15 min
  • Power9 V DC
  • CategoryPower supplies

Bill of materials

Everything you need to build it, with the reference you will see on the schematic.

Bill of materials
Qty Part Ref.
1 Diode 1N4007 D1
1 470 Ω resistor (yellow-violet-brown) R1
1 red LED D2
1 9 V battery with snap clip BT1
1 Breadboard (400 tie-points or more)
2 Jumper wires

Missing parts? The kits recommended by Impeca Tech include almost all of them. See the kits

Schematic & wiring

On the left, the circuit diagram; on the right, the same circuit built on a breadboard. Both connect exactly the same things.

Circuit diagram of “Reverse Polarity Protection”
Circuit diagram
Breadboard layout of “Reverse Polarity Protection”
Breadboard layout

Wire it step by step

  1. Place the components
    • 1N4007 diode D1: the end with the silver stripe (cathode) in 8f and the other end (anode) in 5f.
    • 470 Ω resistor R1 (bands: yellow, violet, brown, gold): one leg in 8h and the other in 4h (either way round).
    • red LED D2: the long leg (+, anode) in 4f and the short leg (−, cathode, flat side) in 3f.
  2. Add the jumper wires
    • Red wire: from 5j to the + (red) rail.
    • Black wire: from 3j to the − (blue) rail.
  3. Connect the battery
    • Connect the 9 V battery to its clip: the clip’s red lead to the + (red) rail and the black one to the − (blue) rail. Do this last, once everything else is in place.
  4. Test the circuit
    • With the battery connected correctly the LED lights. To test the protection swap the battery leads (red to the − rail and black to the + rail): the LED should stay off and no part should get warm.

How to read the holes: the letter is the row and the number is the column of the breadboard (for example 7f). The red (+) and blue (−) rails are the two long lines along the edge.

How does it work?

  1. 1Battery the right way or reversed
  2. 2The diode only passes current one way
  3. 3With the battery reversed no current flows
  4. 4The LED lights only when it is connected correctly

A diode behaves like a one-way valve. With the battery connected correctly it conducts and only “costs” about 0.7 V, so the LED still gets about 14 mA. If the battery is reversed the diode is reverse biased and blocks the path: no current reaches the rest of the circuit. Many devices use this trick so that putting the batteries in the wrong way does not damage the components.

Testing & troubleshooting

What you should see

Battery connected correctly
LED current≈ 14 mA
1N4007 diode drop≈ 0.71 V
Battery reversed
Current reaching the LEDunder 1 µA
Voltage blocked by the diode≈ 0.01 V

Approximate values, calculated with typical parts. With real parts they can vary by 10 % or more.

If something does not work

The LED does not light even with the battery the right way?

Look at the silver stripe on the diode: it must be on the resistor side (cathode). If the stripe faces the battery the diode is backwards and always blocks.

The LED is a little dimmer than without the diode?

That is normal: the diode takes about 0.7 V. The difference is small with a 9 V battery.

Want to automate this circuit with code?

Learn how to program sensors and custom schedules in our e-book “Arduino from Scratch”.