[IPST-SE] with Large Speaker

[IPST-SE] with Large Speaker

ต่อลำโพงขยายให้กับบอร์ด IPST-SE ด้วยวงจรง่ายๆ

ปกติ IPST-SE จะมีลำโพงขนาดเล็ก ZX-Speaker ให้มาในชุด ใช้เพื่อขับเสียงแสดงสถานะต่าง ๆ ได้  เชื่อมต่อง่ายๆ ดังรูปที่ 1
 IPST-with-ZX-Speaker 
รูปที่ 1 การเชื่อมต่อลำโพงเปียโซปกติจาก ZX-Speaker
คำสั่งสำหรับสั่งงานให้ลำโพงเปียโซส่งเสียงออกมาก็คือคำสั่ง sound() โดยมีรูปแบบการใช้งานคือ 
sound(PIN,FREQ,DURATION);

โดย 
PIN   คือตำแหน่งขาที่ต่อลำโพง

FREQ คือความถี่ที่ส่งไปยังลำโพง
DURATION คือระยะเวลาที่ต้องการให้เสียงดัง

แต่ข้อจำกัดของลำโพงเปียโซคือ จะตอบสนองความถี่เสียงช่วง 300-3kHz เท่านั้น และเสียงดังค่อนข้างเบา  

วงจรขยายเสียงอย่างง่าย

   รายการอุปกรณ์

ลำโพงขนาด 5-10W 8W                                       1 ตัว
ตัวต้านทาน 1/4W 5% 1kW                                   1 ตัว
ทรานซิสเตอร์เบอร์ BC337                   1 ตัว
สาย JST 3AA-8                         1 เส้น


จากข้อจำกัดนี้เอามาสร้างเป็น วงจรเล็กๆ เพื่อขยายเสียงให้มีความดังเพิ่มมากขึ้น ต่อเข้ากับลำโพงตัวใหญ่ๆ ได้แสดงการเชื่อมต่อในรูปที่ 2 โดยเอาต์พุตจากขา 17 จะส่งไปยังขาเบสของทรานซิสเตอร์ โดยมีตัวต้านทาน 1kW ทำหน้าที่จำกัดกระแส ไฟเลี้ยงที่ใช้ก็ใช้ไฟเลี้ยง 5V ภายในวงจรได้เลย

Large-Speaker-Circuit
รูปที่ 2 วงจรแสดงการเชื่อมต่อเครื่องขยายเสียงอย่างง่าย


ลองทดสอบเขียนโปรแกรมสั้น ๆ เป็นเสียงหวอรถพยาบาลตามโปรแกรมที่ 1 ทีนี้เสียงหวอของเราก็ดังไปทั่วแน่นอน

#include <ipst.h>
void setup(){

}
void loop()
{
  sound(17,500,500);
  sound(17,2500,500);
}
โปรแกรมที่ 1 ตัวอย่างโปรแกรมเสียงหวอรถพยาบาล



แถมอีกโปรแกรมสำหรับเสียงเมโลดี้ของเกมสุดคลาสสิคอย่างมาริโอ้ครับ


#include <ipst.h>
void setup(){
}
void loop()
{    sound(17,660,100);
   delay(75);sound(17,660,100);
   delay(150);sound(17,660,100);
   delay(150);sound(17,510,100);
   delay(50);sound(17,660,100);
   delay(150);sound(17,770,100);
   delay(275);sound(17,380,100);
   delay(287);sound(17,510,100);
   delay(225);sound(17,380,100);
   delay(200);sound(17,320,100);
   delay(250);sound(17,440,100);
   delay(150);sound(17,480,80);
   delay(165);sound(17,450,100);
   delay(75);sound(17,430,100);
   delay(150);sound(17,380,100);
   delay(100);sound(17,660,80);
   delay(100);sound(17,760,50);
  delay(75);sound(17,860,100);
   delay(150);sound(17,700,80);
   delay(75);sound(17,760,50);
   delay(175);sound(17,660,80);
   delay(150);sound(17,520,80);
   delay(75);sound(17,580,80);
   delay(75);sound(17,480,80);
   delay(175);sound(17,510,100);
   delay(275);sound(17,380,100);
   delay(200);sound(17,320,100);
   delay(250);sound(17,440,100);
   delay(150);sound(17,480,80);
   delay(165);sound(17,450,100);
   delay(75);sound(17,430,100);
   delay(150);sound(17,380,100);
   delay(100);sound(17,660,80);
   delay(100);sound(17,760,50);
   delay(75);sound(17,860,100);
   delay(150);sound(17,700,80);
   delay(75);sound(17,760,50);
   delay(175);sound(17,660,80);
   delay(150);sound(17,520,80);
   delay(75);sound(17,580,80);
   delay(75);sound(17,480,80);
   delay(250);sound(17,500,100);
   delay(150);sound(17,760,100);
   delay(50);sound(17,720,100);
   delay(75);sound(17,680,100);
   delay(75);sound(17,620,150);
   delay(150);sound(17,650,150);
   delay(150);sound(17,380,100);
   delay(75);sound(17,430,100);
   delay(75);sound(17,500,100);
   delay(150);sound(17,430,100);
   delay(75);sound(17,500,100);
   delay(50);sound(17,570,100);
   delay(110);sound(17,500,100);
   delay(150);sound(17,760,100);
   delay(50);sound(17,720,100);
   delay(75);sound(17,680,100);
   delay(75);sound(17,620,150);
   delay(150);sound(17,650,200);
   delay(150);sound(17,1020,80);
   delay(150);sound(17,1020,80);
   delay(75);sound(17,1020,80);
   delay(150);sound(17,380,100);
   delay(150);sound(17,500,100);
   delay(150);sound(17,760,100);
   delay(50);sound(17,720,100);
   delay(75);sound(17,680,100);
   delay(75);sound(17,620,150);
   delay(150);sound(17,650,150);
   delay(150);sound(17,380,100);
   delay(75);sound(17,430,100);
   delay(75);sound(17,500,100);
   delay(150);sound(17,430,100);
   delay(75);sound(17,500,100);
   delay(50);sound(17,570,100);
   delay(110);sound(17,500,100);
   delay(150);sound(17,760,100);
   delay(50);sound(17,720,100);
   delay(75);sound(17,680,100);
   delay(75);sound(17,620,150);
   delay(150);sound(17,650,200);
   delay(150);sound(17,1020,80);
   delay(150);sound(17,1020,80);
   delay(75);sound(17,1020,80);
   delay(150);sound(17,380,100);
   delay(150);sound(17,500,100);
   delay(150);sound(17,760,100);
   delay(50);sound(17,720,100);
   delay(75);sound(17,680,100);
   delay(75);sound(17,620,150);
   delay(150);sound(17,650,150);
   delay(150);sound(17,380,100);
   delay(75);sound(17,430,100);
   delay(75);sound(17,500,100);
   delay(150);sound(17,430,100);
   delay(75);sound(17,500,100);
   delay(50);sound(17,570,100);
   delay(210);sound(17,585,100);
   delay(275);sound(17,550,100);
   delay(210);sound(17,500,100);
   delay(180);sound(17,380,100);
   delay(150);sound(17,500,100);
   delay(150);sound(17,500,100);
   delay(75);sound(17,500,100);
   delay(150);sound(17,500,60);
   delay(75);sound(17,500,80);
   delay(150);sound(17,500,60);
   delay(175);sound(17,500,80);
   delay(75);sound(17,580,80);
   delay(175);sound(17,660,80);
   delay(75);sound(17,500,80);
   delay(150);sound(17,430,80);
   delay(75);sound(17,380,80);
   delay(300);sound(17,500,60);
   delay(75);sound(17,500,80);
   delay(150);sound(17,500,60);
   delay(175);sound(17,500,80);
   delay(75);sound(17,580,80);
   delay(75);sound(17,660,80);
   delay(225);sound(17,870,80);
   delay(162);sound(17,760,80);
   delay(300);sound(17,500,60);
   delay(75);sound(17,500,80);
   delay(150);sound(17,500,60);
   delay(175);sound(17,500,80);
   delay(75);sound(17,580,80);
   delay(175);sound(17,660,80);
   delay(75);sound(17,500,80);
   delay(150);sound(17,430,80);
   delay(75);sound(17,380,80);
   delay(300);sound(17,660,100);
   delay(75);sound(17,660,100);
   delay(150);sound(17,660,100);
   delay(150);sound(17,510,100);
   delay(50);sound(17,660,100);
   delay(150);sound(17,770,100);
   delay(225);sound(17,380,100);  
}
Facebook Comments Box