Electronic circuits · no code

Two-LED Polarity Tester

Two LEDs of different colours tell you which way the current arrives: green if the polarity is right, red if it is reversed.

  • LevelBeginner
  • Time10 min
  • Power9 V DC
  • CategoryLights & LEDs

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 1 kΩ resistor (brown-black-red) R1
1 green LED D1
1 red LED D2
1 9 V battery with snap clip BT1
1 Breadboard (400 tie-points or more)
3 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 “Two-LED Polarity Tester”
Circuit diagram
Breadboard layout of “Two-LED Polarity Tester”
Breadboard layout

Wire it step by step

  1. Place the components
    • 1 kΩ resistor R1 (bands: brown, black, red, gold): one leg in 8f and the other in 5f (either way round).
    • green LED D1: the long leg (+, anode) in 5h and the short leg (−, cathode, flat side) in 4h.
    • 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 8j to the + (red) rail.
    • Orange wire: from 3j to 5j.
    • Black wire: from 4j 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 as in step 3 only the green LED should light. To test the other direction swap the two battery leads (red to the − rail and black to the + rail): now only the red one should light.

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. 1You apply a voltage
  2. 2Only one LED faces the right way
  3. 3That LED conducts
  4. 4Green or red lights up

The two LEDs are wired back to back (anti-parallel): one with its anode towards the resistor and the other the opposite way. An LED only conducts in one direction, so with one polarity the green one lights and with the opposite the red one does; the other stays blocked and dark. The 1 kΩ resistor, shared by both, limits the current to about 7 mA either way.

Testing & troubleshooting

What you should see

Correct polarity (+ on the resistor side)
Green LED current≈ 7 mA
Red LED currentunder 0.1 mA
Reversed polarity
Red LED current≈ 7.1 mA
Green LED currentunder 0.1 mA

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

If something does not work

Does the red one light with the correct connection?

Either both LEDs face the same way or the battery leads are crossed. One LED must have its long leg towards the resistor and the other its short leg.

Do both light at the same time?

It should not happen: check that both LEDs are in the same pair of columns but facing opposite ways, and that no leg is touching another column.

Want to automate this circuit with code?

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