กลับไปหน้ารวมไฟล์
ultrasonic-theremin-830063.md

สรุปสั้นๆ ง่ายๆ

ก็แค่ Theremin โปรเจกต์แรกสุดง่ายๆ ใช้เซ็นเซอร์วัดระยะกับบัซเซอร์นั่นแหละ วิธีทำก็แค่ต่อ Ultrasonic distance [sensor](https://s.shopee.co.th/7VBG2rX65j) (พี่ใช้ SR04 เพราะมันมากับเซ็ตเริ่มต้นที่พี่ซื้อมา) กับ passive [buzzer](https://s.shopee.co.th/6pvZFdZdRf) (ห้ามใช้ active นะ น้อง ตัว passive ใช้ได้ดีกว่าเยอะ) เข้ากับบอร์ด [Arduino](https://s.shopee.co.th/7fUgFAWSki) ของเรา ในรูปพี่ใช้ prototype shield ด้วย แต่มันไม่จำเป็นก็ได้ ใช้บอร์ดเปล่าๆ ก็ได้จ้า

วิธีต่อสาย (Wiring)

เซ็นเซอร์วัดระยะ:

  • GND ต่อกับ GND
  • VCC ต่อกับ +5V
  • Echo ต่อกับ PWM12
  • Trig ต่อกับ PWM11

บัซเซอร์:

ลงรายละเอียดเทคนิคให้ฟัง

Non-Contact Musical Synthesis

ได้แรงบันดาลใจจากเครื่องดนตรีอิเล็กทรอนิกส์คลาสสิก Theremin ตัวนี้ใช้คลื่นเสียงสร้างเสียงดนตรีจากตำแหน่งมือของเรา

  • ตรวจจับระยะ (Proximity Detection): ใช้ HC-SR04 Ultrasonic sensor Arduino จะคำนวณระยะห่างจากมือเราไปยังเซ็นเซอร์แบบเรียลไทม์
  • กำหนดระดับเสียง (Pitch Mapping): ค่าระยะห่าง (เช่น 5cm ถึง 50cm) จะถูกแมปไปยังช่วงความถี่เสียง (เช่น 100Hz ถึง 2000Hz)

การสร้างเสียง (Sound Generation)

  • ฟังก์ชันสร้างเสียง (Tone Function): Arduino ใช้ฟังก์ชัน tone() เพื่อส่งสัญญาณคลื่นสี่เหลี่ยมไปยังลำโพงหรือบัซเซอร์
  • การโต้ตอบ (Interactivity): แค่ขยับมือเราเข้าใกล้เซ็นเซอร์ ผู้ใช้ก็สามารถเล่นทำนองเพลงได้เหมือนเครื่องดนตรีจากอนาคตเลย เวอร์ชันขั้นสูงอาจใช้เซ็นเซอร์ตัวที่สองเพื่อควบคุมความดังเสียง สร้างเป็นอินเทอร์เฟซดนตรีแบบไม่สัมผัสที่ควบคุมได้ 2 แกนเลยทีเดียว หล่อเท่เลยงานนี้!

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

title: "Ultrasonic Theremin"
description: "A Theremin utilizing a passive buzzer using tone(); and the SR04 ultrasonic distance sensor"
author: "squrril"
category: "Audio & Sound"
tags:
  - "audio"
  - "music"
  - "toys"
views: 11473
likes: 7
price: 1499
difficulty: "Easy"
components:
  - "1x Buzzer"
  - "1x Ultrasonic Sensor - HC-SR04 (Generic)"
  - "1x Arduino Mega 2560"
tools: []
apps:
  - "1x TinkerCAD - Free!"
downloadableFiles:
  - "https://projects.arduinocontent.cc/0b6f9488-6d13-4ca9-bfda-1efc1a74432f.ino"
documentationLinks: []
passwordHash: "54cb79d3ca1bdcb559d0c3d20dd79861e1ac658df1458bfaf9e23d9dc5c48bed"
encryptedPayload: "U2FsdGVkX1+2czPbABJ0cV7GF2Zp8LNID6Nx3uB4FV/CEbZA9DrX5hxFoFSu0/vs5iaEY/lOVuCh/bYxTGIRcva6sxfvd7LV3q8fbo96eaU="
seoDescription: "Build an Ultrasonic Theremin with Arduino using SR04 ultrasonic distance sensor and passive buzzer. Control sound with tone(); function."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/ultrasonic-theremin-830063_cover.jpg"
lang: "th"