กลับไปหน้ารวมไฟล์
turn-on-different-color-leds-with-voice-command-10425a.md

ในโปรเจกต์นี้ พี่จะพาน้องๆ มาสั่งเปิดไฟ LED สีต่างๆ ด้วยเสียงกัน! ใช้อุปกรณ์ง่ายๆ แค่ [Arduino](https://s.shopee.co.th/7fUgFAWSki) UNO R3, Bluetooth module HC-05 กับ LED สี่สี พี่พูดสีไหน ไฟสีนั้นก็จะติดอัตโนมัติ หล่อเท่เลยงานนี้

แนวคิดโปรเจกต์

การทำ Voice Recognition บนไมโครคอนโทรลเลอร์ตัวเดียวแบบ Arduino Uno นี่มันงานยากนะน้อง เพราะมันจำกัดเรื่องความจำและพลังประมวลผล แต่โปรเจกต์นี้เราหลบข้อจำกัดนั้นด้วยการใช้ สมาร์ทโฟนเป็น "สมอง" ในการจับเสียงแทน โทรศัพท์จะแปลงคำพูดเป็นข้อความแล้วส่งผ่าน Bluetooth ไปหา Arduino

ส่วนประกอบของระบบ

  • Arduino Uno: ตัวควบคุมหลักที่คอยสั่งงานเปิดปิด LED
  • HC-05 Bluetooth Module: ตัวกลางส่งข้อมูลระหว่างมือถือกับ Arduino
  • Arduino Voice Controller App: แอปในมือถือ (มีทั้ง Android/iOS) ที่ใช้ระบบแปลงเสียงเป็นข้อความของมือถือ (เช่น Google Assistant หรือ Siri)
  • LEDs: LED สี่สี (เช่น แดง, เขียว, น้ำเงิน, เหลือง) แต่ละสีต่อกับ Digital pin ของ Arduino

วิธีการสื่อสาร

  1. แปลงเสียงเป็นข้อความ: ผู้ใช้กดปุ่มไมโครโฟนในแอปแล้วพูดชื่อสี (เช่น "Red")
  2. ส่งผ่าน Bluetooth: แอปจะส่งข้อความ "red" ผ่าน Bluetooth
  3. Arduino ประมวลผล: Arduino รับข้อมูลข้อความผ่านไลบรารี SoftwareSerial
  4. ตรรกะตรวจสอบ: ใช้คำสั่ง if หรือ switch ตรวจสอบข้อความ ถ้าได้ข้อความ "red" Arduino ก็จะสั่ง digitalWrite(RED_LED_PIN, HIGH) ไฟสีแดงก็ติด!

วิธีการต่อวงจร

ต่อ HC-05 module เข้ากับ Arduino:

  • RX (Bluetooth) -> TX (Arduino) (อย่าลืมใช้ Level Shifter หรือ Voltage Divider นะ)
  • TX (Bluetooth) -> RX (Arduino)
  • VCC/GND -> 5V/GND

หมายเหตุ: สำหรับขา RX ของ HC-05 เพื่อความปลอดภัยควรใช้ตัวต้านทาน 1k/2k ohm ทำเป็น Voltage divider เพื่อลดสัญญาณ 5V จาก Arduino TX ลงมาเหลือ 3.3V ที่โมดูลต้องการ ห้ามช็อตนะตัวนี้!

ไอเดียต่อยอด

ใช้หลักการเดียวกันนี้ควบคุมเครื่องใช้ไฟฟ้าแรงสูงได้เลย แค่เปลี่ยนจาก LED เป็น Relay Module เราก็สามารถสั่งเปิดพัดลม ไฟในบ้าน หรืออุปกรณ์อื่นๆ ด้วยเสียงได้แล้ว สะดวกสุดๆ ไปเลย!

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

title: "Turn ON different color LEDs with Voice Command"
description: "Speak color and Switch ON that color LED"
author: "munir03125344286"
category: ""
tags:
  - "voice control"
  - "hc-05"
  - "voice control leds"
  - "bluetooth module"
  - "voice command"
views: 1363
likes: 0
price: 699
difficulty: "Intermediate"
components:
  - "4x LED (generic)"
  - "1x Jumper wires (generic)"
  - "1x Arduino UNO"
  - "1x HC-05 Bluetooth Module"
tools: []
apps:
  - "1x Arduino Voice controller"
downloadableFiles: []
documentationLinks: []
passwordHash: "0a2276ff4b8ace897cc3d344209400ac85d30f0930caf054838bf1471963f67c"
encryptedPayload: "U2FsdGVkX1++swzHzPWXTpcMdFQb2qYtlUrjNUfwXm+gkBVeYiSlCuB1ezhRD7MjdGOPey8ErTgdAhHOA/HopyPe+OEGqXtdFSF6ytH6SvM="
seoDescription: "Control LEDs using Voice Command. Build an Arduino project to switch on different color LEDs by speaking the color name."
videoLinks:
  - "https://www.youtube.com/embed/kr97QE4tzQA"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/turn-on-different-color-leds-with-voice-command-10425a_cover.jpg"
lang: "th"