> For the complete documentation index, see [llms.txt](https://docs.aic-eec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aic-eec.com/embedded-systems/resources/basic-hardware-and-firmware/lab1-oscilloscope/waveform/lab-oscilloscope-and-function-generator.md).

# LAB: Oscilloscope and Function Generator

## **จุดประสงค์**&#x20;

1. สามารถอ่านค่า Oscilloscope ที่แสดงค่าสัญญาณที่ได้จาก function generator&#x20;
2. สามารถตั้งค่า function generator สร้าง Waveform ได้

## LAB:  Function generator สร้าง Waveform

ทดลองอ่านค่า Oscilloscope แสดงค่าสัญญาณที่ได้จาก function generator &#x20;

### อุปกรณ์ทดลอง

<table><thead><tr><th width="397">Component </th><th>Quantity</th></tr></thead><tbody><tr><td>myDAQ</td><td>1</td></tr></tbody></table>

![www.ni.com](https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MClo3nC-1US0rbK8Qau%2Fuploads%2F3mkskn6mMYzGkHWCZXBP%2FGUID-844A5226-CCA4-47E2-8018-625553A4D342-5.5x8.5%20-%20a5.png?alt=media\&token=46aac14a-f79f-4191-a9f5-020901170b29)

### โปรแกรม

1. Arduino IDE
2. โปรแกรม NI ELVISSmx

### Circuit Diagram

![](https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MClo3nC-1US0rbK8Qau%2Fuploads%2FYA8mcrFeXELLGs9EILyT%2F3-1png.png?alt=media\&token=7cd4c859-ccac-4ebd-9083-3425d0508a2f)

### ตัวอย่าง Function generator สร้าง Square wave&#x20;

ตั้งค่าโปรแกรม Function generator NI ELVISmx สร้าง Square wave ความถี่ 50Hz , Vpp 2V

* เปิดโปรแกรม NI ELVISmx InStrument Launcher >> Function generator
* ตั้งค่า โปรแกรม Function generator NI ELVISmx โดยไปที่ Waveform Settings และตั้งค่าตามรูปด้านล่าง

![Function generator NI ELVISmx](https://paper-attachments.dropbox.com/s_E32BE90F8E91E354B14DB9C10815D4F44640981FA0FE48AEE8513B5268D06F13_1600072286176_Function_set.png)

### ตัวอย่าง Oscilloscope แสดงสัญญาณที่ได้จาก Function generator&#x20;

ตั้งค่า Scale Volt/Div เท่ากับ 1V, Time/Div เท่ากับ 5 ms

* ปิดโปรแกรม NI ELVISmx InStrument Launcher >>Oscilloscope>>RUN

![Oscilloscope NI ELVISmx](https://paper-attachments.dropbox.com/s_E32BE90F8E91E354B14DB9C10815D4F44640981FA0FE48AEE8513B5268D06F13_1600072652495_Reading+guide2.png)

&#x20;  จากกราฟด้านบนแสดงค่าที่ Oscilloscope ได้รับค่าสัญญาณจาก Function Generator สังเกตที่ค่าใต้กราฟที่ Oscilloscope อ่านได้จะเท่ากับค่าที่ Function Generator สร้างสัญญาณขึ้น

### **บันทึกผลการทดลอง**&#x20;

1. ให้ทดลองตั้งค่า Function Generator เพื่อได้ผลลัพท์เหมือนกับกราฟที่แสดงผลบน Oscilloscope ดังภาพที่ a, b, c ด้านล่าง&#x20;
2. บันทึกผลการทดลองและอธิบายขั้นตอนการตั้งค่า Function Generator ลง template ที่ได้รับมอบหมาย&#x20;

![a.](https://paper-attachments.dropbox.com/s_E32BE90F8E91E354B14DB9C10815D4F44640981FA0FE48AEE8513B5268D06F13_1600073302894_image.png)

![b.](https://paper-attachments.dropbox.com/s_E32BE90F8E91E354B14DB9C10815D4F44640981FA0FE48AEE8513B5268D06F13_1600072850932_image.png)

![c.](https://paper-attachments.dropbox.com/s_E32BE90F8E91E354B14DB9C10815D4F44640981FA0FE48AEE8513B5268D06F13_1600073038647_image.png)
