Node.js Raspberry Pi - အစိတ်အပိုင်းများ
အစိတ်အပိုင်းတွေက ဘာတွေလဲ။
အစိတ်အပိုင်းများသည် ပိုမိုကြီးမားသော အစိတ်အပိုင်းများဖြစ်သည်။ ဤအခန်းတွင် ကျွန်ုပ်တို့၏သင်ခန်းစာတွင် ကျွန်ုပ်တို့အသုံးပြုသည့် မတူညီသောအစိတ်အပိုင်းများကို ရှင်းပြထားပါသည်။
Raspberry Pi နှင့် GPIO Pins
ဤသည်မှာ Raspberry Pi 3 ၏ ပုံဥပမာဖြစ်သည်။
GPIO ပင်နံပါတ်များသည် Raspberry Pi ၏ညာဘက်ခြမ်းရှိ အနီရောင်စတုရန်းလေးများဖြစ်ပြီး တကယ့် Raspberry Pi တွင် ၎င်းတို့သည် သေးငယ်သောသတ္တုပင်များဖြစ်သည်။
Input pins များသည် ပြင်ပကမ္ဘာမှ ဖွင့်/ပိတ်နိုင်သော ခလုတ်များကဲ့သို့ဖြစ်သည် (အဖွင့်/အပိတ် မီးခလုတ်ကဲ့သို့)။
Output pins များသည် Raspberry Pi မှ အဖွင့်/အပိတ် ပြုလုပ်နိုင်သော ခလုတ်များနှင့် တူသည် (LED မီးဖွင့်/ပိတ် ကဲ့သို့)။
Raspberry Pi 3 တွင် GPIO pin 26 ခု ပါရှိပြီး ကျန် pins များမှာ ပါဝါ၊ မြေပြင် သို့မဟုတ် "အခြား" ဖြစ်သည်။
ပင်နံပါတ်နေရာများသည် အောက်ပါဇယားနှင့် ကိုက်ညီပါသည်။
Raspberry Pi B+၊ 2၊ 3 နှင့် သုည
3V3 | ၁ | ၂ | 5V |
GPIO ၂ | ၃ | ၄ | 5V |
GPIO ၃ | ၅ | ၆ | GND |
GPIO ၄ | ၇ | ၈ | GPIO ၁၄ |
GND | ၉ | ၁၀ | GPIO ၁၅ |
GPIO ၁၇ | ၁၁ | ၁၂ | GPIO ၁၈ |
GPIO ၂၇ | ၁၃ | ၁၄ | GND |
GPIO ၂၂ | ၁၅ | ၁၆ | GPIO ၂၃ |
3V3 | ၁၇ | ၁၈ | GPIO ၂၄ |
GPIO ၁၀ | ၁၉ | ၂၀ | GND |
GPIO ၉ | ၂၁ | ၂၂ | GPIO ၂၅ |
GPIO ၁၁ | ၂၃ | ၂၄ | GPIO ၈ |
GND | ၂၅ | ၂၆ | GPIO ၇ |
DNC | ၂၇ | ၂၈ | DNC |
GPIO ၅ | ၂၉ | ၃၀ | GND |
GPIO ၆ | ၃၁ | ၃၂ | GPIO ၁၂ |
GPIO ၁၃ | ၃၃ | ၃၄ | GND |
GPIO ၁၉ | ၃၅ | ၃၆ | GPIO ၁၆ |
GPIO ၂၆ | ၃၇ | ၃၈ | GPIO ၂၀ |
GND | ၃၉ | ၄၀ | GPIO ၂၁ |
ဒဏ္ဍာရီ
Physical Pin Number |
ပါဝါ+ |
မြေပြင် |
UART |
I2C |
SPI |
GPIO |
မချိတ်ဆက်ပါနှင့် |
ပေါင်မုန့်ပြား
breadboard ကို အီလက်ထရွန်းနစ်ပစ္စည်း ပုံတူရိုက်ခြင်းအတွက် အသုံးပြုပြီး ဆားကစ်များကို ဂဟေမပါဘဲ ဖန်တီးနိုင်စေပါသည်။ ၎င်းသည် အခြေခံအားဖြင့် ပလပ်စတစ်ဘုတ်ဖြစ်ပြီး ကြိုးမှတ်များ (အပေါက်များ) ပါရှိသည်။ ဘုတ်အဖွဲ့အတွင်းတွင် မတူညီသော ကြိုးအမှတ်များကို သီးခြားနည်းလမ်းများဖြင့် ချိတ်ဆက်ထားသော သတ္တုပြားများရှိသည်။
အောက်ဖော်ပြပါပုံတွင် ကျွန်ုပ်တို့သည် မတူညီသောအရောင်များဖြင့် ကဏ္ဍအချို့ကို မီးမောင်းထိုးပြထားသည်။ ဤသည်မှာ grid မည်ကဲ့သို့ ချိတ်ဆက်ထားသည်ကို သင့်အား ပြသရန်ဖြစ်သည်။
ပေါင်မုန့်ဘုတ်၏ မတူညီသော အပိုင်းများ-
- ဘယ်ဘက်၊ ညာဘက်တွင် တိုင်အမှတ် ၂ ခုရှိသည်။ ဤကော်လံတစ်ခုစီရှိ ကြိုးမှတ်များအားလုံးကို ချိတ်ဆက်ထားသည်။
- Power Bus - အနီရောင်ဖြင့် မီးမောင်းထိုးပြထားသော ကော်လံများ။ Breadboard သို့ ပါဝါချိတ်ဆက်ရန် အသုံးပြုလေ့ရှိပါသည်။ ကော်လံတစ်ခုလုံးကို ချိတ်ဆက်ထားသောကြောင့်၊ သင်သည် ကော်လံရှိ ကြိုးမှတ်များအားလုံးကို ချိတ်ဆက်နိုင်သည်။
- မြေပြင်ဘတ်စ်ကား - အပြာရောင်ဖြင့် မီးမောင်းထိုးထားသည့် ကော်လံများ။ Ground ကို Breadboard နဲ့ ချိတ်ဆက်ဖို့ အသုံးပြုလေ့ရှိပါတယ်။ ကော်လံတစ်ခုလုံးကို ချိတ်ဆက်ထားသောကြောင့်၊ သင်သည် ကော်လံရှိ ကြိုးမှတ်များအားလုံးကို မြေပြင်သို့ ချိတ်ဆက်နိုင်သည်။
- ချိတ်ဆက်ထားသော Tie-Points အတန်းများ - အစိမ်းရောင်ဖြင့် မီးမောင်းထိုးပြထားသော အတန်းများ။ ဤအတန်းတစ်ခုစီ၏ တူညီသောအမှတ်များသည် ချိတ်ဆက်ထားသော်လည်း အတန်းတစ်ခုလုံးမဟုတ်ပေ။ ဘယ်ဘက် ချိတ်မှတ်များကို ချိတ်ဆက်ထားသည် (ABCDE) နှင့် ညာဘက်ခြမ်း ချိတ်မှတ်များကို ချိတ်ဆက်ထားသည် (FGHIJ)။
- Breadboard ၏အလယ်တွင် Trench တစ်ခုရှိသည်၊ ၎င်းသည်ဘယ်နှင့်ညာဘက်အတန်းများကိုခွဲခြားထားသည်။ ကတုတ်ကျင်း၏ အကျယ်ကို ပေါင်းစည်းထားသော ဆားကစ်များစွာသည် ၎င်းနှင့် အံဝင်ခွင်ကျဖြစ်အောင် ဒီဇိုင်းထုတ်ထားသည်။
အခြားလျှပ်စစ်အစိတ်အပိုင်းများ
အပေါက် LED မှတဆင့်Light emitting diode (LED)။ LED သည် ဗို့အားတစ်ခုသက်ရောက်သောအခါ အလင်းထုတ်လွှတ်သည့် ဒိုင်အိုဒဖြစ်သည်။ ကျွန်ုပ်တို့၏ဥပမာတွင်၊ ကျွန်ုပ်တို့သည်အပေါက်ဖောက် LED ကိုအသုံးပြုသည်။ ၎င်းတို့တွင် အပြုသဘော (Anode ဟုခေါ်သည်) နှင့် အနှုတ် (Cathode ဟုခေါ်သည်) pin ရှိသည်။ LED ပေါ်ရှိ ပိုရှည်သောခြေထောက်သည် positive pin ကိုညွှန်ပြသင့်သည်။ |
|
RGB LEDLight emitting diode (LED). An LED is a diode that emits light when a voltage is applied to it. An RGB LED has 4 pins. One for each color (R = Red, G = Green, and, B = Blue), and a common cathode/anode. This one LED can display the pure colors, or with PWD to modulate and mix colors. |
|
Push ButtonA push button is a type of switch. A switch makes or breaks a connection an an electric circuit. |
|
Jumper Wire - Female to MaleShort pieces of wire called jumper wires are used to make connections. Female to Male jumper wires can be used to connect from the GPIO on the Raspberry Pi to the Breadboard. |
|
Jumper Wire - Male to MaleShort pieces of wire called jumper wires are used to make connections. Male to Male jumper wires can be used to make connections between different parts of the Breadboard. |
|
Resistor - 68 OhmResistors are used to reduce current, adjust signal levels, etc. This is a 68 Ohm resistor. |
|
Resistor - 220 OhmResistors are used to reduce current, adjust signal levels, etc. This is a 220 Ohm resistor. |
|
Resistor - 1k OhmResistors are used to reduce current, adjust signal levels, etc. This is a 1k Ohm resistor. |
Node.js Modules
onoff - GPIO access and interrupt detection with Node.js |
|
Socket.IO - real-time bidirectional event-based communication |
|
pigpio - wrapper for pigpio C library. Enables GPIO, PWM, servo control, state change notification and interrupt handling with Node.js |