Microbit | Sensor Series 19 – Dual Color LED Sensor

01

Introduction

The dual color LED sensor is an LED that can display two colors.

It has three states: off; color 1 on; color 2 on.

Depending on the color combinations, dual color LEDs can be red-blue, yellow-blue, red-green, etc.

Dual color LEDs are commonly used as status indicator lights, such as indicating whether an electronic device is charging or fully charged.

Based on the principle of the three primary colors of light (red, green, blue), it can also control the intensity of two colors to mix into other colors. For example, equal parts of red and green light will produce yellow light.

Microbit | Sensor Series 19 - Dual Color LED SensorMicrobit | Sensor Series 19 - Dual Color LED Sensor

02

Principle

It is encapsulated in 3mm or 5mm epoxy resin. It has three pins, available in common cathode or common anode configurations. The dual color LED has two LED terminals or pins arranged in a reverse parallel manner in the circuit and connected through the cathode/anode. A positive voltage can be directed to one of the LED terminals, causing that terminal to emit the corresponding color of light; when the voltage direction is reversed, it emits another color of light. In a dual color LED, only one pin can accept voltage at a time. Therefore, this type of LED is often used as indicator lights in various devices, including televisions, digital cameras, and remote controls.

Microbit | Sensor Series 19 - Dual Color LED Sensor

03

Wiring

  • + : Positive power supply, connect to 3.3V
  • G: Green control pin, connect to P0
  • R: Red control pin, connect to P1

04

Program

Microbit | Sensor Series 19 - Dual Color LED Sensor Program Explanation:

When we press button A on the microbit, it displays green; pressing button B displays red; pressing both buttons A and B simultaneously displays yellow.

Writing a digital value to the pin controls the light to be fully on or off; writing an analog value from 0 to 1023 can adjust the brightness of the light.

Microbit | Sensor Series 19 - Dual Color LED Sensor

05

Demonstration

Leave a Comment