Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide

Components and supplies

Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide
Raspberry Pi 3 Model B
×1
Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide
Arduino UNO
×1
Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide
LED (generic)
×2
Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide
Resistor 100 ohm
×1
Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide
Breadboard (generic)
×1
Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide
Amazon Alexa Amazon Echo
×1

Apps and online services

Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide
Arduino IDE
Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide
Node-RED

About this project

Introduction

It turns out that it is quite easy to get Alexa communicate with Arduino via Raspberry Pi with Node-RED. All you have to do is installing two Node-RED modules and setup up a Node-RED Flow with Alexa Local and Arduino nodes. Here I have a project which has Alexa turn on and off two LED lights as a demo.

Step 1. Setup Raspberry Pi

Follow this step to get your Raspberry Pi ready.

Step 2. Install Node-RED

Follow this step to install Node-RED.

Step 3. Install the Arduino node

Follow this step to install the Arduino node for Node-RED. I am using Firmata in this project. You need to upload the Standard Firmata to the Arduino Uno, follow this link to accomplish that.

Step 4. Install the Alexa Local

Follow this step to install the Alexa Local Node-RED module.

Step 5. Setup the Node-RED Flow

Import the Node-RED Flow from the code section below.

Testing Time

Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide

Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide

.

Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide

Code

  • noderedflow.js
noderedflow.jsJavaScript
import this to node-red editor
[{"id":"7cfb7d9e.1371f4","type":"alexa-local","z":"8496b3f6.919b5","devicename":"yellow light","inputtrigger":false,"x":177.10000610351562,"y":175,"wires":[["b9b6f9c0.383058","677a99d9.49b6c8"]]},{"id":"b9b6f9c0.383058","type":"debug","z":"8496b3f6.919b5","name":"","active":true,"console":"false","complete":"true","x":336.10005950927734,"y":233.00000476837158,"wires":[]},{"id":"23e77dc0.c2d532","type":"alexa-local","z":"8496b3f6.919b5","devicename":"green light","inputtrigger":false,"x":157.10000610351562,"y":287,"wires":[["b9b6f9c0.383058","b7bd4e01.3cc47"]]},{"id":"677a99d9.49b6c8","type":"arduino out","z":"8496b3f6.919b5","name":"","pin":"11","state":"OUTPUT","arduino":"4326cda4.263274","x":530.1000633239746,"y":172.6000099182129,"wires":[]},{"id":"b7bd4e01.3cc47","type":"arduino out","z":"8496b3f6.919b5","name":"","pin":"12","state":"OUTPUT","arduino":"4326cda4.263274","x":531.1000366210938,"y":290.6000061035156,"wires":[]},{"id":"4326cda4.263274","type":"arduino-board","z":"","device":"/dev/ttyACM0"}]

Schematics

Control LEDs with Alexa via Raspberry Pi – Easy Step‑by‑Step Guide

Manufacturing process

  1. Build a Bluetooth‑Controlled Raspberry Pi Robot with Audio Feedback
  2. DHT11 Temperature & Humidity Sensor Project with LED Indicators and Piezo Speaker
  3. Build an Android‑Controlled Remote Vehicle with Raspberry Pi Motor Shield
  4. Find Me: Smart Item Locator with Arduino and Bluetooth
  5. MobBob: Build Your Own Arduino Robot, Controlled Seamlessly via Android Smartphone
  6. PiBot: The Arduino‑Powered Piano Robot for Precision Music Performance
  7. Build a Custom Arduino Joystick Steering Wheel for Gaming
  8. Control LED Lights with Alexa via Arduino Yun – A Smart Home Tutorial
  9. PhoneLocator: Securely Locate Your Phone Anywhere
  10. Controlling 32 LEDs with Arduino Nano and 4x 74HC595 Shift Registers – A Beginner’s Guide