Arduino Emotion Stress Tester 檢測情緒的壓力感測器

21

2

9B 曾語昕 Amber Tseng

檢測皮膚電流的情緒壓力感測器

GSR stands for Galvanic Skin Response, it is a kind of method that measures the electrical conductance of the skin. Strong emotion causes stimuli in your body to trigger the SNS (sympathetic nervous system), which results in sweating. In which the electrodes on the GSR Metal Pad spots emotions from the two fingers that were attached to the sensor.

*我本來是用Arduino UNO做的,但在做的過程中我發現現在有賣那種麵包板做成現成的接頭,直接利用母頭的杜邦線連接到我在做的感測器就可以取代麵包板。It is known as the Base Shield, it is placed on the top of the Arduino UNO Plus. It is directly plugged into the analog and digital pin to replace breadboard. Thus, I decided to use the Base Shield instead of the breadboard, while using the datasheet LM324. 一組不同顏色的杜邦線是代表不同的插孔。舉例來說黑色的是GND,紅色的是5V,黃色是Digital/Analog Pin,白色的則是空接。

Step 1: Step 1:Prepare for Your Materials

  • Arduino UNO Plus
  • Buzzer
  • Base Shield
  • Cardboard Box
  • 棉紙套
  • 繞線
  • 杜邦線
  • GSR Metal Pad
  • Decoration Paper
  • Styrofoam

Step 2: Step 2:Plug in All the Lines

  • 將Base Shield插入Arduino UNO Plus
  • 將杜邦線插入Base Shield的D3另一頭接上蜂鳴器
  • 將杜邦線插入Base Shield的A1另一頭接上GSR Senor
  • 在Sensor上接上繞線並跟感測器連接

Step 3: Step 3:Type Out the Code

const int BUZZER=3;
const int GSR=A1;
int threshold=0;
int sensorValue;

void setup(){
  long sum=0;
  Serial.begin(9600);
  pinMode(BUZZER,OUTPUT);
  digitalWrite(BUZZER,LOW);
  delay(1000);

  for(int i=0;i <= 500;i++)
  {
  sensorValue=analogRead(GSR);
  sum += sensorValue;
  delay(5);
  }
  threshold = sum/500;
   Serial.print("threshold =");
   Serial.println(threshold);
  }

void loop(){
  int temp;
  sensorValue=analogRead(GSR);
  Serial.print("sensorValue=");
  Serial.println(sensorValue);
  temp = threshold - sensorValue;
  if(abs(temp) > 30)
  {
    sensorValue=analogRead(GSR);
    temp = threshold - sensorValue;
    if(abs(temp) > 30){
    digitalWrite(BUZZER,HIGH);
    Serial.println("YES!");
    delay(500);
    digitalWrite(BUZZER,LOW);
    delay(1000);}
  }
  }

Share

    Recommendations

    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Beauty Tips Contest

      Beauty Tips Contest
    • 1 Hour Challenge

      1 Hour Challenge

    2 Discussions