Arduino uno 2-color LED module:
Arduino UNO's control over a 2-color LED module, cycling smoothly between red and green. It employs PWM (Pulse Width Modulation) for gradual color transitions, enhancing visual appeal.
The Arduino code manages the LED's colors, illustrating basic electronics interfacing and programming techniques for beginners in embedded systems.
Components Needed:
- Arduino UNO Board
- 2-Color LED Module
- Resistors (220 ohms)
- Breadboard
- Jumper Wires
- 12v power supply adapter
Hardware Wiring Explanation:
Connect the red LED pin to digital pin 11 on the Arduino.
Connect the green LED pin to digital pin 10 on the Arduino.
Connect the common cathode (or anode, depending on your LED module) to the GND pin on the Arduino through a 220-ohm resistor for each LED color.
Software (Arduino IDE):
setup:
If you haven’t already, download and install the Arduino IDE on your computer.
Connect your Arduino Uno to your computer using a USB cable.
Verify your code by clicking the checkmark icon (Verify) in the Arduino IDE.
Once verified successfully, upload the code to your
Arduino by clicking the right arrow icon (Upload).
Power the Arduino:
Plug the Arduino into a USB port or power it with an external adapter.
operation:
The LED module will alternate between red and green colors with a smooth transition effect once the Arduino is powered and the code is uploaded.
The LEDs smoothly transition between red and green colors. One color dims while the other glows, creating a smooth blending effect.
Learning Points:
Learn how to blend two primary colors (typically red and green) to create intermediate colors like yellow through software control of PWM signals.
Gain proficiency in using Pulse Width Modulation (PWM) to adjust the intensity of each LED, allowing for smooth transitions between colors and varying brightness levels.