Control RGB LEDs with Alexa and Node-RED

Learn how to control RGB LEDs in your home with Alexa and Node-RED for a smarter living space.

Posted by Nina Alvarez on April 19, 2025 · 5 mins read

Control RGB LEDs with Alexa and Node-RED

Introduction

Hey there, fellow DIY enthusiast! Have you ever wanted to add a splash of color to your living space and control it with your voice? Well, you’re in luck! In this post, we’re diving into the world of smart home automation by showing you how to control RGB LEDs using Alexa and Node-RED. This project is perfect for beginners looking to explore the possibilities of home automation, and trust me, it’s a lot easier than it sounds!

Whether you’re wanting to set the mood for movie night or flash some vibrant colors during a party, controlling RGB LEDs with Alexa offers a fantastic way to enhance your smart home experience. So, without further ado, let’s get started!

Step-by-step setup guide

What You’ll Need

  1. RGB LED Strip: Make sure it’s compatible with 12V power supply and has GPIO (General Purpose Input/Output) access.
  2. Microcontroller: A popular choice is the NodeMCU or Raspberry Pi.
  3. Node-RED: If you haven’t installed this yet, head over to the official Node-RED documentation for guidance.
  4. Alexa Device: You’ll need an Amazon Alexa-enabled device for voice control.
  5. Internet Connection: Make sure everything is connected to the internet.

Setup Steps

  1. Wiring the RGB LEDs:
    • Connect your RGB LED strip to your microcontroller (like NodeMCU or Raspberry Pi).
    • Ensure that you connect the correct GPIO pins for the LED control. Typically, this includes the red, green, and blue wires.
  2. Install Node-RED:
  3. Add Node-RED Contrib Modules:
    • In your Node-RED editor, go to the menu and select “Manage Palette.” From there, search for node-red-contrib-alexa-remote2 to add it to your workspace. This module will enable communication between your RGB LED setup and Alexa. You can find various node-red contrib modules to expand the functionality of your project.
  4. Create a Flow to Control RGB Colors:
    • Open the Node-RED interface and create a new flow.
    • Drag and drop the appropriate nodes onto the canvas:
      • An “Inject” Node to trigger the color changes.
      • A “Function” Node to set the RGB values.
      • An “Output” Node to connect with the GPIO of your microcontroller.
    • Wire these nodes together to form a complete flow.
  5. Configure Alexa Skills:
    • Use the Alexa app on your smartphone. Navigate to the skills section and enable the skill for your Node-RED setup. Follow the prompts to link your account.
    • Once linked, customize the commands that will control your RGB LEDs (e.g., “Set lights to red”).
  6. Test Your Setup:
    • With everything wired and configured, use the Alexa voice command to control your RGB LEDs. Say, “Alexa, set the lights to blue” and watch the magic happen!

Helpful Tip Block

  • Color Mixing: RGB LEDs can produce millions of colors by mixing different intensities of red, green, and blue. Don’t hesitate to play around with different values to customize your light setup!

  • Temperature Control: If you’re using a Raspberry Pi, consider adding a temperature sensor to automate color changes based on the ambient temperature using Node-RED flows.

  • Use Node-RED Dashboard Examples: Explore various node-red dashboard examples available online for inspiration on how to visualize and control your RGB setup.

Common Issues & Troubleshooting

  • Alexa Not Responding: Make sure your Node-RED flow is deployed and functioning correctly. Check the connection between your microcontroller and Node-RED.

  • Incorrect Colors: Double-check the wiring of your RGB LED strip. Ensure that the right GPIO pins are connected to the correct LED wires. Sometimes, swapping the connections can resolve the issue.

  • Skill Not Found: If you can’t find your skill in the Alexa app after enabling it, make sure you’ve followed all setup instructions and that your devices are on the same network.

Final Thoughts

Controlling RGB LEDs with Alexa and Node-RED is a thrilling project that can kickstart your journey into the world of smart home automation. Not only does it add flair to your space, but it also empowers you to customize your environment effortlessly using just your voice.

Remember to keep exploring and experimenting with different setups, as Node-RED offers endless possibilities with its robust community and numerous Node-RED flow examples available for learning and inspiration.

Happy automating, and here’s to creating a colorful atmosphere in your home!