---
# System prepended metadata

title: SPST開關
tags: [硬體組]

---

# 單刀開關
###### tags:'硬體'
>[name=硬體組凌翊傑]

#### :bulb:單通道模擬開關
Refernce:https://blog.csdn.net/m0_62877864/article/details/125790897

:::success
測試SPST開關模組
:::

## :book:SPST工作原理
利用單片機控制IN端的高低電平變化就可以控制NO與COM的通斷
![](https://i.imgur.com/pOEksAO.png)


### TS5A3166DBVR 單通道模擬開關
![](https://i.imgur.com/anUt80V.png)


### ADG411BR 四通道單刀開關
![](https://i.imgur.com/w6hcB7p.png)
![](https://i.imgur.com/oEmVa7S.png)





####使用Arduino UNO板測試
以下為測試的程式碼

int in = 2;
int NO=3;
int led = 13;
void setup() {
 Serial.begin(9600);
 pinMode(in, INPUT);
 pinMode(NO,INPUT);
 pinMode(led, OUTPUT);
} 
void loop() {
 int buttonState = digitalRead(in);
int buttonState1 = digitalRead(NO);
 if (buttonState == LOW) {
  
 //digitalWrite(led, LOW); 
 //digitalWrite(led, HIGH); 
 Serial.println(buttonState);
 } 
 if(buttonState1==HIGH) { 
 //digitalWrite(led, HIGH);
 Serial.println(buttonState1);
 }
}

已確定這兩種開關皆符合需求，可以用於PCB的印製

 



