Build a Voice‑Controlled LED Wall Panel with Node‑RED and Arduino
Ever walked into a room and wished the lights could just listen to you? With a cheap Arduino, a strip of LEDs, and Node‑RED, that wish can become a reality – and you’ll learn a lot about wiring, cloud services, and voice APIs along the way. I built one for my home office last month, and the moment it lit up on “Hey Maya, brighten the wall,” I felt like a kid who just discovered a secret button. Let’s walk through the whole process, step by step.
What You’ll Need
Hardware
- Arduino Uno or Nano – the brain of the panel.
- WS2812B LED strip (also called NeoPixel) – 1 meter is enough for a small wall.
- 5 V power supply – at least 2 A if you plan to light many LEDs.
- Breadboard and jumper wires – for quick connections.
- Micro‑USB cable – to program the Arduino.
Software
- Arduino IDE – to upload the sketch.
- Node‑RED – a flow‑based programming tool that runs on your PC or a Raspberry Pi.
- Google Speech‑to‑Text API (or any free voice‑to‑text service).
- MQTT broker – Mosquitto works fine locally.
Why Node‑RED?
Node‑RED lets you drag blocks that represent inputs, outputs, and logic. It’s perfect for people who love to code but also enjoy visual wiring. I use it for almost every IoT project because it keeps the “what happens next” picture in front of me.
Step 1: Wire the LED Strip to the Arduino
- Power the strip – Connect the 5 V and GND wires from the strip to the power supply. Do NOT power the strip directly from the Arduino; the board can’t supply enough current.
- Data line – The green wire on the strip goes to pin 6 on the Arduino (you can pick another PWM‑capable pin, just change the code later).
- Common ground – Tie the Arduino’s GND to the power supply’s GND. This shared ground is what lets the Arduino talk to the LEDs reliably.
Tip: If you’re using a long strip, add a 100 µF capacitor across the 5 V and GND terminals of the strip. It smooths out voltage spikes and saves you from a flickering nightmare.
Step 2: Flash the Arduino Sketch
Open the Arduino IDE and install the Adafruit NeoPixel library (Sketch → Include Library → Manage Libraries). Then paste the following sketch:
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NUM_LEDS 30 // change to match your strip length
Adafruit_NeoPixel strip(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // turn all LEDs off
Serial.begin(115200);
}
void loop() {
if (Serial.available()) {
char cmd = Serial.read();
if (cmd == '1') {
setColor(255, 0, 0); // red
} else if (cmd == '2') {
setColor(0, 255, 0); // green
} else if (cmd == '3') {
setColor(0, 0, 255); // blue
} else if (cmd == '0') {
setColor(0, 0, 0); // off
}
}
}
void setColor(uint8_t r, uint8_t g, uint8_t b) {
for (int i = 0; i < NUM_LEDS; i++) {
strip.setPixelColor(i, strip.Color(r, g, b));
}
strip.show();
}
Upload the sketch. The Arduino now listens on the serial port for single‑character commands that set the whole strip to a solid color. You can expand this later to patterns, but keep it simple for the voice demo.
Step 3: Set Up Node‑RED
If you haven’t installed Node‑RED, run:
npm install -g --unsafe-perm node-red
node-red
Open the browser at http://localhost:1880. You’ll see a blank canvas.
3.1 Add an MQTT Input
- Drag an mqtt in node.
- Double‑click it, set the broker to
localhost(or the IP of your Raspberry Pi). - Topic:
led/control.
3.2 Add a Function Node
- Drag a function node next to the MQTT input.
- Name it “Translate command”.
- Paste this JavaScript:
// payload is the spoken text, e.g. "turn red"
var text = msg.payload.toLowerCase();
if (text.includes("red")) msg.payload = "1";
else if (text.includes("green")) msg.payload = "2";
else if (text.includes("blue")) msg.payload = "3";
else if (text.includes("off") || text.includes("stop")) msg.payload = "0";
else msg.payload = "";
return msg;
This turns natural language into the single‑character codes the Arduino expects.
3.3 Add a Serial Out Node
- Drag a serial out node.
- Configure it to use the COM port where the Arduino is connected (e.g.,
COM3on Windows or/dev/ttyUSB0on Linux). - Set the baud rate to
115200.
Wire the three nodes: MQTT → Function → Serial Out.
Deploy the flow. At this point, any MQTT message on led/control will be turned into a command and sent to the Arduino.
Step 4: Hook Up Voice Recognition
I like to keep the voice part on my laptop using the free Google Speech‑to‑Text API. You can also use the open‑source Vosk library if you prefer offline.
4.1 Capture Audio
Create a simple Node‑RED flow:
- mic input node (install
node-red-contrib-mic). - speech-to-text node (install
node-red-contrib-google-cloud-speech).
Configure the speech node with your Google Cloud credentials (you’ll need a project and an API key – the free tier gives you a few hundred minutes per month).
Connect the mic node to the speech node, then to an mqtt out node that publishes to led/control.
Now, when you speak into the mic, the words travel to Google, come back as text, and are published to the MQTT topic. The earlier function node translates them to LED commands.
Step 5: Test the Whole System
- Power the LED strip and the Arduino.
- Start Node‑RED and make sure all flows are deployed.
- Speak a command like “Hey Maya, turn the wall blue.”
If everything is wired correctly, the LEDs should glow blue within a second. Try “off” to turn them off. If you hear nothing, check the serial console in the Arduino IDE – it will show any characters it receives.
Troubleshooting Tips
- No light at all? Verify the strip’s 5 V line with a multimeter. A common mistake is a loose power connector.
- Flickering? Add the 100 µF capacitor mentioned earlier, and make sure the power supply can handle the current (each LED can draw up to 60 mA at full white).
- Voice not recognized? Speak clearly and keep background noise low. The Google API works best with a decent microphone; a USB headset is a cheap upgrade.
Going Further
Now that the basics work, you can add:
- Color gradients – send an array of RGB values instead of a single code.
- Web dashboard – Node‑RED’s dashboard nodes let you add sliders for brightness or speed.
- Multiple panels – Use different MQTT topics for each wall and control them independently.
I love how a simple voice command can make a room feel alive. The same pattern (voice → text → MQTT → device) works for blinds, fans, even coffee makers. Once you have the pipeline, you can plug almost any Arduino‑based gadget into it.
Happy building, and may your walls always listen when you need them to!
- → Build a Battery‑Powered Weather Station with Arduino: Complete Guide for Beginners @arduinoinnovator
- → How to Build a Self‑Balancing Robot with Arduino and Free Sensors @arduinoinnovator
- → How to Design and Print a Custom Enclosure for Arduino Projects Using Fusion 360 @techcraftworkshop
- → Build a Low-Cost Arduino Current Sensor for Real-Time Energy Monitoring @techpulse
- → Step‑by‑Step Guide: Building a Low‑Cost Relay‑Controlled Power Switch for Arduino @relaychronicles