Interfacing Bi-Color LED with Arduino
Bi-Color LED Display
A Bi-Color LED is a compact light-emitting diode capable of producing two different colors from a single package. It adds a visual communication layer to Arduino-based systems, perfect for status indicators, signal lights, and compact visual alerts.
Working Principle of Bi-Color LED
A Bi-Color LED contains two LED chips connected in opposite directions. By changing the direction of the current, you can switch between two distinct colors. Using Arduino, you can control the color output programmatically to reflect system states or user input.
Types of Bi-Color LEDs
Common Cathode Bi-Color LED
- Connect common cathode to GND.
- Supply voltage to either anode to emit different colors.
- Arduino controls color by toggling digital pins.
Common Anode Bi-Color LED
- Connect common anode to +5V.
- Ground either cathode through Arduino to emit specific color.
- Control colors via digital pin logic.
Requirements
1. Arduino
2. Bi-Color LED Module
3. Resistors for current limiting
4. Jumper wires
Pin Configuration of Bi-Color LED
Bi-Color LED Module
- Pin 1: Connect to Digital Output (Color 1).
- Pin 2: Common Anode or Cathode depending on type.
- Pin 3: Connect to Digital Output (Color 2).
- Use appropriate resistors to limit current.
- Control each color individually from Arduino.
Wiring the Bi-Color LED to Arduino
To connect a Bi-Color LED to Arduino, use two digital pins to drive the two terminals and connect the common pin to either GND or +5V, depending on the LED type. Add current-limiting resistors to protect the LEDs and control the colors using code.
Algorithm
Initialize Components
- Connect Bi-Color LED pins to digital pins on the Arduino.
- Use resistors to prevent overcurrent damage.
Write the Code
- Define LED pins as outputs in the setup().
- Use digitalWrite() to switch colors.
- Add timing or condition-based color changes in loop().
Implement Interactivity
- Use buttons or sensors to trigger color changes.
- Map sensor values to LED color states.
- Create flashing or alternating color patterns.
Test the Interface
- Upload code to Arduino board.
- Observe color change based on logic.
- Confirm functionality with various input scenarios.
Arduino Code
Applications of Bi-Color LED Modules
- Status indicators for sensors or devices
- Power or error signal lights
- Simple traffic light models
- Notification alerts in embedded systems
- User input feedback in DIY gadgets
- Learning projects for beginners
Conclusion
Interfacing a Bi-Color LED with Arduino adds dynamic visual feedback to your project. Whether you're building a status notifier or a simple signal system, it's a simple yet powerful way to enhance interactivity.