กลับไปหน้ารวมไฟล์
amazon-alexa-arduino-yun-smart-home-light-sample-eca37c.md

ชื่อโปรเจกต์: Amazon Alexa / Arduino YÚN Smart Home Light Sample

ผมคิดว่า The Alexa and Arduino Smart Home Challenge นั้นเจ๋งมาก และอยากมีส่วนร่วมแม้ว่าจะไม่สามารถแข่งขันได้ ดังนั้น ผมจึงหยิบ Arduino YÚN ที่มีอยู่มาใช้ และซื้อ NeoPixel compatible light array ที่ราคาถูกที่สุด แล้วก็เริ่มลงมือทำ

โปรเจกต์ตัวอย่างนี้ใช้ Arduino YÚN ร่วมกับ Alexa Smart Home Skill เพื่อควบคุมไฟ LED ด้วยเสียง โปรเจกต์นี้ยังมีการใช้ Amazon Web Services (AWS) IoT thing เพื่อแสดงสถานะของไฟ และใช้ MQTT เพื่อสื่อสารสถานะนั้นกับ Arduino YÚN บน Arduino YÚN, Python client จะคอยรับฟังการเปลี่ยนแปลงสถานะและสื่อสารข้อมูลเหล่านั้นไปยัง sketch ที่กำลังทำงานอยู่ผ่าน Bridge โดย sketch จะใช้ Adafruit NeoPixel Library เพื่อควบคุมไฟ LED ในสีสันและระดับความสว่างที่หลากหลาย

ภาพรวมสถาปัตยกรรมและการสาธิต

สามารถดูโค้ดได้บน GitHub ที่ https://github.com/mikemaas-amazon/alexa-smarthome-arduino-yun.

รายละเอียดทางเทคนิคเพิ่มเติม

ระบบอัตโนมัติบนคลาวด์ที่ควบคุมด้วยเสียง

โปรเจกต์ Bridge นี้สาธิตการทำงานร่วมกันระหว่าง Arduino YÚN กับ Amazon Alexa Ecosystem เพื่อการควบคุมระบบแสงสว่างในที่พักอาศัยที่ซับซ้อน

  • การเชื่อมต่อ AWS IoT: Linux processor ของ YÚN ทำหน้าที่จัดการการสื่อสาร MQTT อย่างปลอดภัยกับ AWS IoT Core โดยใช้ Shadow document เพื่อติดตามสถานะปัจจุบันของไฟจริง
  • ลอจิกที่ขับเคลื่อนโดย Lambda: AWS Lambda function ทำหน้าที่เป็นลอจิกสำหรับการดำเนินการ Skill โดยจะแปลคำสั่งเสียงของ Alexa (เช่น "Alexa, turn on the kitchen light") ให้เป็นสัญญาณดิจิทัลที่ส่งไปยัง ATmega32p microcontroller ของ YÚN

ฮับฮาร์ดแวร์

  • การควบคุมสำรอง: มี physical override switch; Arduino จะตรวจสอบสถานะของสวิตช์โดยอิสระจาก cloud ทำให้มั่นใจได้ว่าสามารถเปิดปิดไฟได้แม้ในกรณีที่ internet outage

ข้อมูล Frontmatter ดั้งเดิม

title: "Amazon Alexa / Arduino YÚN Smart Home Light Sample"
description: "A sample that uses an Arduino YÚN with an Alexa Smart Home Skill to provide voice control to LED lights."
author: "Noctuvigilus"
category: "Internet of Things, BT & Wireless"
tags:
  - "lights"
  - "home automation"
  - "internet of things"
views: 9037
likes: 4
price: 2450
difficulty: "Intermediate"
components:
  - "1x Keyestudio 40 RGB LED 2812 Pixel Matrix Shield for Arduino"
  - "1x Arduino Yun"
tools: []
apps:
  - "1x Alexa Skills Kit"
  - "1x AWS Lambda"
  - "1x AWS IoT"
downloadableFiles:
  - "https://github.com/mikemaas-amazon/alexa-smarthome-arduino-yun"
documentationLinks: []
passwordHash: "bdfc3b24811a0b60f03ca11cf8f4f8eaa51a97e41366f38169fce832eb2c1c0b"
encryptedPayload: "U2FsdGVkX18C3UreY0bRBC0WnxhlVoQUsVqe7oXJa4p+eCMEnUIJQe/1z8jig9E81iRIWUT2Ma3IOBe7KuH+/W1ccOq7gMFeHDDChoCc2P32IXGdLf7Mq6/wi9OY4Gp0QTyZBTL8ZLqt9XVSWHpWcg=="
seoDescription: "Control LED lights using Arduino YÚN and Alexa Smart Home Skill with voice commands in this Smart Home project."
videoLinks:
  - "https://www.youtube.com/embed/vOXkt3TpdjQ"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/amazon-alexa-arduino-yun-smart-home-light-sample-eca37c_cover.png"
lang: "th"