Control LED with Voice via IBM Watson and Node-RED
Learn to connect devices using IBM Watson and Node-RED, enabling voice commands to control an LED. Instructions and code available on GitHub.
File
IBM Watson Speech to Text IoT demo (HD)
Added on 01/29/2025
Speakers
add Add new speaker

Speaker 1: Hi folks, this is Nathan Friedley with the IBM Watson Developer Cloud team. I have a demo showing you how to use voice commands to blink an LED over the internet. So let's try it out. LED on. LED off. Perfect. So, to set this up, there are a few moving parts. First, we have this web page. It's hosted on a Bluemix server. And most of the heavy lifting actually happens in JavaScript on the page. It makes a WebSocket connection directly to the Watson speech-to-text service and pipes my audio from my microphone straight to that, so there's nothing in between to add latency. And then it gets the JSON responses back over that same WebSocket and it parses those for the on and off commands. And then once it finds a command, it makes a JSONP request out to this Node-RED server that's running on a different Bluemix instance. And there's a few different things going on in here. Node-RED is a kind of visual flow-based programming tool. So, it accepts the JSONP request and sends out a response. It formats the command and forwards that on. I also have it listening for status events. And if I turn this on, it'll start debugging them and showing me the status events on the side. And lastly, I have a couple of ways to inject commands so I can turn things on and off. And there we go. There's the latest status. So, after it formats this command, it sends it on to the IBM Internet of Things Foundation Cloud. And this is a service that IBM has set up to help you connect all of your devices and manage them. It uses the MQTT protocol, which is designed for embedded devices. It's a very lightweight publish-subscribe protocol. The device I'm using here is the SparkFun ESP8266 thing. It's a nice little microcontroller with built-in Wi-Fi. It's fairly inexpensive, so I like it. But you can connect just about anything you can imagine to the Internet of Things Foundation Cloud because MQTT is a very lightweight protocol. So, if it's programmable and has an internet connection, you can probably make it work. They have quick start guides for hundreds of different devices. And if you want to set this up yourself, either with this device or with a different one, we have all the code online on GitHub in the Watson Developer Cloud organization. So, try it out and let me know how it goes.

ai AI Insights
Summary

Generate a brief summary highlighting the main points of the transcript.

Generate
Title

Generate a concise and relevant title for the transcript based on the main themes and content discussed.

Generate
Keywords

Identify and highlight the key words or phrases most relevant to the content of the transcript.

Generate
Enter your query
Sentiments

Analyze the emotional tone of the transcript to determine whether the sentiment is positive, negative, or neutral.

Generate
Quizzes

Create interactive quizzes based on the content of the transcript to test comprehension or engage users.

Generate
{{ secondsToHumanTime(time) }}
Back
Forward
{{ Math.round(speed * 100) / 100 }}x
{{ secondsToHumanTime(duration) }}
close
New speaker
Add speaker
close
Edit speaker
Save changes
close
Share Transcript