# Grove – 皮膚電GSR反應感測器

<figure><img src="/files/CHUTsmDdVUAMaoWcLu3D" alt="" width="374"><figcaption></figcaption></figure>

{% hint style="danger" %} <mark style="color:red;">**注意：**</mark>

* &#x20;<mark style="color:red;">**本感測器不能用於醫療目的。**</mark>
* <mark style="color:red;">**Grove-GSR 感測器測量的是人體的電阻，而不是電導率！**</mark>
  {% endhint %}

### 測量前準備

1. GSR(皮膚電反應感測器)將布套分別套在食指和中指(或中指與無名指)，以此來測量人體的電阻值。

<figure><img src="/files/YUxQ7TxZUbpt3jq4tbiT" alt="" width="238"><figcaption></figcaption></figure>

2. 電極的插座接感測器

<figure><img src="/files/aulQQHDMsXl2yF5mw8BZ" alt="" width="303"><figcaption></figcaption></figure>

3. Grove 接公 – 母 杜邦線

<figure><img src="/files/6EXIHUVKA7wUuHSYgkgG" alt="" width="320"><figcaption></figcaption></figure>

### **Grove – 皮膚電GSR反應感測器電路圖**

* Raspberry Pi Pico W
* Raspberry Pi Pico W 擴充板
* Grove – 皮膚電GSR反應感測器
* 公 – 母 杜邦線

{% hint style="success" %}
***Grove – 皮膚電 GSR 反應感測器是類比訊號輸入。本範例模組的 SIG 腳位需接至Raspberry Pi Pico擴充板 A0/D26 腳位。***
{% endhint %}

<figure><img src="/files/ljtCpVOYxTVyoesMQ7Bv" alt="" width="563"><figcaption></figcaption></figure>

### **Arduino 程式如下**

```
const int GSR = A0;
int sensorValue = 0;
int gsr_average = 0;

void setup() {
  analogReadResolution(12);   // 設定為 12-bit → 0~4095
  Serial.begin(9600);
}

void loop() {
  long sum = 0;

  // 取 10 次平均
  for (int i = 0; i < 10; i++) {
    sensorValue = analogRead(GSR);
    sum += sensorValue;
    delay(5);
  }

  gsr_average = sum / 10;

  Serial.print("GSR : ");
  Serial.print(gsr_average);
  Serial.print("  |  State:");

  // ---------- 狀態判斷區(數值可以調整) ----------
  if (gsr_average >= 2800) {
    Serial.println("Relax");
  }
  else if (gsr_average >= 1600) {
    Serial.println("Normal");
  }
  else if (gsr_average >= 800) {
    Serial.println("Stress");
  }
  else {
    Serial.println("High Stress");
  }
  // -------------------------------------

  delay(200);
}

```

### **程式執行結果**

在序列埠監控視窗會顯示數值，根據類比數值高低，判斷使用者的皮膚乾濕程度與交感神經反應，並輸出「Relax」、「Normal」、「Stress」或 「High Stress」四種狀態。

高數值代表皮膚較乾燥且較放鬆，低數值則代表皮膚導電度上升、壓力較高。

<figure><img src="/files/U93BUtMcOgUUDgB1XLoR" alt="" width="315"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cavedu.gitbook.io/cavedu/sheng-wu-yi-xue-cai-liao-bao/grove-pi-fu-dian-gsr-fan-ying-gan-ce-qi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
