Skip to content
If this is your first visit, please click here to learn about shipping and delivery.
If this is your first visit, please touch here to learn about shipping and delivery.
Red and green bicolour through-hole LEDs

Design a Clear Red–Green Status Indicator with a 5 mm Bicolour LED

A red–green LED can show whether a classroom experiment is ready, a measurement is valid or a model railway section is occupied. The difficult part is often deciding what the light should mean. A green LED that stays on after a sensor disconnects is electrically functional but communicates the wrong result.

The PMD Way bicolour red/green LEDs include 5 mm variants with common-anode or common-cathode wiring. This guide develops a low-voltage status indicator around that three-lead arrangement. Select the correct size and common connection when ordering; a two-lead, polarity-reversing bicolour LED needs a different circuit.

Define the states before choosing resistor values

Write down the system conditions that matter to its user. For a small sensor instrument, these might be starting, valid reading, missing sensor and waiting for a new reading. Decide whether each condition needs a persistent indication or whether it should disappear automatically.

A useful rule is that green means a checked condition is currently true. It should not merely mean that the program reached its setup routine once. If a reading becomes too old, the indicator should leave the valid state even when no explicit error message arrives.

For an educational instrument, an example scheme could use a steady green light for a recent valid result, a steady red light for a known fault, and an unlit indicator while the system is not ready. Display a written status alongside the light when the distinction matters. An unlit LED alone cannot distinguish startup, loss of power and a broken indicator.

Identify the common connection

A common-cathode version joins the two cathodes internally; a common-anode version joins the anodes. The individual colour terminals remain separate. Manufacturer drawings, such as Kingbright's three-lead bicolour LED example, show why the internal circuit and package view should be checked together. That example is not a pinout guarantee for another supplier's part.

Use the drawing for the actual LED and verify the colour terminals at a suitably limited test current. Do not assume the middle or longest lead always has the same function across all bicolour products. Record the result before trimming the leads.

For a compatible direct GPIO arrangement, common cathode normally connects to ground and a high output illuminates the selected branch through its resistor. Common anode normally connects to a compatible positive supply and a low output sinks the selected branch current. Check both the LED and controller specifications before using either arrangement.

Give each colour its own resistor

Place one series resistor in the red branch and another in the green branch. A single resistor in the common connection makes the currents interact when both colours are on. It also makes independently adjusting their brightness difficult.

Use the voltage available across each branch, its forward voltage at the chosen current and the driver's output drop when calculating resistance. As an illustrative 5 V calculation ignoring driver drop, a red LED dropping 2 V at 2 mA needs about 1.5 kΩ. A green LED dropping 3 V at 2 mA needs about 1 kΩ. Check minimum forward voltage, maximum supply, resistor tolerance and actual GPIO output behaviour before accepting those values.

These examples are not fixed recommendations for every red or green LED. Forward voltage varies with technology, current and temperature. Start with modest current and measure the result. A catalogue specification measured at 20 mA does not require operating a panel indicator at 20 mA.

Match the driver to the supply

Check the microcontroller's per-pin limits, combined port limits and total device limits. Arduino's official digital-pin documentation explains sourcing, sinking and input states, but the exact board and microcontroller datasheet determine the usable electrical limits.

A common-anode LED powered from 5 V is not automatically compatible with direct connections to 3.3 V GPIO. The branch may fail to turn fully off, and an output or input can be exposed to an unsuitable voltage. Use a properly designed driver stage where the supply and GPIO levels do not align.

If both colours are enabled, budget for both branch currents. For the illustrative 2 mA branches above, the common connection carries approximately 4 mA. Increasing one colour's brightness must remain within its LED rating and the driver's limits, even if the mixed colour looks more balanced.

Keep wiring polarity out of the application logic

Create one indicator-control function that accepts meaningful states such as READY or FAULT. Inside that function, translate the state into the two electrical output levels. This keeps common-anode inversions from spreading throughout the program.

Logical requests before translating them into GPIO levels
Requested indication Red branch Green branch
Off Off Off
Fault On Off
Ready Off On
Combined colour, if useful On On

Do not assume the combined state produces a precise yellow. Its appearance depends on the two emitters, their currents, the lens and viewing angle. Use it only after checking that people can distinguish it reliably in the intended environment.

Test startup, stale data and failures

Observe the indicator while power rises, during reset and while new firmware is loaded. GPIO pins may be inputs or perform boot-related functions before application code takes control. Choose pins and driver biasing appropriate to the board so these periods produce acceptable behaviour.

Then deliberately disconnect the sensor, stop updates and restore them. Confirm that the light follows the validity of the information rather than the last successful event. Test a broken LED connection too: the product should remain diagnosable through another indication when its status light fails.

Check whether the message is understandable

Evaluate the assembled indicator in daylight and typical room lighting, through its final bezel or panel. Ask someone unfamiliar with the circuit to interpret it using the supplied labels. The W3C's guidance on avoiding colour-only information addresses web content, but its underlying usability principle is also useful here: provide another cue when colour carries meaning.

When choosing alternatives from the 5 mm round LED collection, repeat the electrical and visibility checks. A successful status light reports a defined, current condition clearly; its colour is only one part of that design.

Previous article Battery Power for Arduino Projects: Voltage Range, Runtime and Regulator Heat