반응형

병원이 나오는 드라마나 영화를 보면 입원실 또는 수술실 환자의 심박수를 측정하고 모니터링 하는 장비가 있습니다. 심장박동이 그래프로 나타나기도 하고 BPM을 보여주기도 합니다. 그러다가 심박수가 떨어지거나 멈추면 경고음을 내거나 하는 경우도 있죠. 이런 비슷한 장치를 아두이노와 심박센서(Pulse Sensor)를 이용해서 만들 수 있습니다. 


이미지 출처: http://www.medicalpointindia.com/cariac-5paramonitor.htm

바로 이런 장치인데 심장박동뿐 아니라 혈압, 체온 등 여러가지 바이탈 사인(Vital Sign)을 보여주는 장치 입니다. 이런 비슷한 화면을 PC로 출력해 보는 것입니다.


'심장박동 센서의 사용 1편' 글에서는 시리얼 모니터에 데이터를 나타냈지만 이 데이터를 Processing 이라는 소프트웨어를 통해서 시각화 해서 보여주는 것입니다. 프로세싱(Processing)에 대해서는 예전에 한 번 저의 블로그에서 다룬 적이 있습니다. 바로 6축 자이로 센서의 사용 이라는 글에서 프로세싱에 대해서 상세하게 알아 보았었습니다. 그러므로 이 글에서는 심박센서와 프로세싱에 대해서는 자세히 다루지는 않겠습니다. 대신 아래의 링크를 먼저 참고 하시면 더욱 이해하기가 쉬울 것 입니다.



■ 연결 및 준비

아두이노와 심박센서의 연결은 1편에서 연결한 것과 같습니다. 아래와 같이 연결하면 됩니다.


 심장박동 센서

 아두이노 UNO

 Signal

 A0

 VCC

 5V

 GND

 GND



심박 데이터를 비주얼화 시켜줄 프로세싱 프로그램을 다운로드 받아서 설치해야 합니다.


Processing 다운로드 페이지의 모습입니다. 윈도우, 맥, 리눅스 모두 지원이 되니 자신의 OS에 맞는 소프트웨어를 다운로드 받으면 됩니다.  https://processing.org/download/?processing 이동해서 다운로드 받습니다. 


윈도우의 경우 별도의 설치과정은 없으며 압축을 풀고 폴더를 적절한 위치로 이동한 후  Processing.exe 를 실행하면 됩니다.


 


■ 소스

소스는 1편에서 아두이노에 업로드 했던 소스와 같습니다. 다만 시리얼 모니터에서 심박수를 제대로 보기 위해서 원래의 소스에서 변경했던 부분을 다운로드 당시의 소스로 원복해야 합니다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
/*  Pulse Sensor Amped 1.4    by Joel Murphy and Yury Gitman   http://www.pulsesensor.com
----------------------  Notes ----------------------  ---------------------- 
This code:
1) Blinks an LED to User's Live Heartbeat   PIN 13
2) Fades an LED to User's Live HeartBeat
3) Determines BPM
4) Prints All of the Above to Serial
Read Me:
https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/blob/master/README.md   
 ----------------------       ----------------------  ----------------------
*/
 
//  Variables
int pulsePin = 0;                 // Pulse Sensor purple wire connected to analog pin 0
int blinkPin = 13;                // pin to blink led at each beat
int fadePin = 5;                  // pin to do fancy classy fading blink at each beat
int fadeRate = 0;                 // used to fade LED on with PWM on fadePin
 
// Volatile Variables, used in the interrupt service routine!
volatile int BPM;                   // int that holds raw Analog in 0. updated every 2mS
volatile int Signal;                // holds the incoming raw data
volatile int IBI = 600;             // int that holds the time interval between beats! Must be seeded! 
volatile boolean Pulse = false;     // "True" when User's live heartbeat is detected. "False" when not a "live beat". 
volatile boolean QS = false;        // becomes true when Arduoino finds a beat.
 
// Regards Serial OutPut  -- Set This Up to your needs
static boolean serialVisual = false;   // Set to 'false' by Default.  Re-set to 'true' to see Arduino Serial Monitor ASCII Visual Pulse 
 
 
void setup(){
  pinMode(blinkPin,OUTPUT);         // pin that will blink to your heartbeat!
  pinMode(fadePin,OUTPUT);          // pin that will fade to your heartbeat!
  Serial.begin(115200);             // we agree to talk fast!
  interruptSetup();                 // sets up to read Pulse Sensor signal every 2mS 
   // IF YOU ARE POWERING The Pulse Sensor AT VOLTAGE LESS THAN THE BOARD VOLTAGE, 
   // UN-COMMENT THE NEXT LINE AND APPLY THAT VOLTAGE TO THE A-REF PIN
//   analogReference(EXTERNAL);   
}
 
 
//  Where the Magic Happens
void loop(){
  
    serialOutput() ;       
    
  if (QS == true){     // A Heartbeat Was Found
                       // BPM and IBI have been Determined
                       // Quantified Self "QS" true when arduino finds a heartbeat
        fadeRate = 255;         // Makes the LED Fade Effect Happen
                                // Set 'fadeRate' Variable to 255 to fade LED with pulse
        serialOutputWhenBeatHappens();   // A Beat Happened, Output that to serial.     
        QS = false;                      // reset the Quantified Self flag for next time    
  }
     
  ledFadeToBeat();                      // Makes the LED Fade Effect Happen 
  delay(20);                             //  take a break
}
 
void ledFadeToBeat(){
    fadeRate -= 15;                         //  set LED fade value
    fadeRate = constrain(fadeRate,0,255);   //  keep LED fade value from going into negative numbers!
    analogWrite(fadePin,fadeRate);          //  fade LED
  }
 
cs

위와 같이 원복해 주었습니다. 28행의 serialVisual 값을 false 로 바꾸어 주었고, 57행의 delay 값을 20으로 변경해 주었습니다. 소스를 새로 다운 받으신 분은 그냥 아무 수정 없이 아두이노에 업로드 하면 됩니다.


소스의 다운로드는 아래의 URL 에서 다운로드 받으면 됩니다. 소스를 받아서 압축을 풀고 아두이노 IDE 에서 파일 -> 열기를 눌러서 'PulseSensorAmped_Arduino_1dot4.ino' 파일을 열어서 아두이노에 업로드 하면 됩니다.


https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino

PulseSensor_Amped_Arduino-master.zip



이제 프로세싱의 소스를 다운로드 받아야 합니다.


아래의 URL에 들어가서 Pulse Sensor Visualizer 라는 프로그램을 다운로드 받습니다.

https://github.com/WorldFamousElectronics/PulseSensor_Amped_Processing_Visualizer

PulseSensor_Amped_Processing_Visualizer-master.zip



Download ZIP 을 눌러서 소스를 다운로드 받아 줍니다.


다운 받은 파일을 문서 -> Processing 폴더에 넣어 주었습니다. 아무 위치나 상관없지만 구분을 위해서 이렇게 해 주었습니다.


압축을 풀어 주었습니다.


프로세싱을 실행하고 파일 -> 열기를 하고 좀 전에 프로그램을 복사했던 위치로 들어가면 위와 같이 4개의 PDE 파일이 있습니다. 이 중에서 'PulseSensorAmpd_Processing_1dot1.pde' 를 열어 줍니다.


'PulseSensorAmpd_Processing_1dot1.pde' 소스 입니다. Java 로 짜여져 있습니다.


실행버튼 (▶ 모양) 을 눌러서 실행해 봅니다. 당연한 이야기지만 소스가 업로드된 심박센서를 연결한 아두이노가 PC에 연결되어 있어야 합니다. 그런데 위와 같이 소스에서 에러가 나고 동작이 되지 않습니다. 시리얼 포트를 찾는 부분에서 Array Index out of bounds 에러가 나네요. 잘 될 수도 있으나 저와 같이 에러가 나는 분들은 아래의 사항을 따라하면 됩니다.


에러가 발생한 코드 입니다. 59행 입니다. 'Serial.list()[9]' 을 'Serial.list()[0]' 으로 수정해 줍니다.


위와 같이 에러가 난 코드를 수정 하고 저장 후 다시 실행 버튼을 눌러 봅니다. 


시리얼 포트를 잘 찾고 잘 되네요. 왼쪽에 그래프로 심박수의 변화를 볼 수 있으며 하트 표시로 심박수가 BPM 으로 표시가 됩니다.


프로세싱에 비주얼하게 표시되는 저의 심박수의 변화를 동영상으로 캡쳐해 봤습니다. 



이상으로 프로세싱(Processing)을 이용해서 심장박동 센서의 값을 비주얼하게 표시해 보았습니다. 심장 건강을 위해서 운동 열심히 해야 겠네요. ^^



반응형
반응형

아두이노의 센서 중에 심장박동을 측정할 수 있는 센서가 있습니다. 손가락 등 몸에 부착하면 심장박동과 심장박동수(Heart Rate, BPM - Beats Per Minute)를 측정할 수 있는 센서 입니다. 이 센서는 말 그대로 심장박동수를 관찰하는 기기를 만들 수 있으며 블루투스, 와이파이 모듈 등과 연동하면 스마트폰 등과 연동해서 건강관리 기능을 하는 앱을 만들 수도 있습니다. 심장박동으로는 심장의 이상, 부정맥 등의 질병을 진단할 수 있습니다. 아래 표는 위키피디아 에서 발췌한 자료로서 휴식기 기준 심박수 기준 데이터라고 합니다. 저도 한 번 측정해 봐야 겠네요.

 

남성나이
18–2526–3536–4546–5556–6565+
운동선수49–5549–5450–5650–5751–5650–55
뛰어남56–6155–6157–6258–6357–6156–61
좋음62–6562–6563–6664–6762–6762–65
평균 이상66–6966–7067–7068–7168–7166–69
평균70–7371–7471–7572–7672–7570–73
평균 이하74–8175–8176–8277–8376–8174–79
나쁨82+82+83+84+82+80+

여성나이
18–2524–3536–4546–5556–6565+
운동선수54–6054–5954–5954–6054–5954–59
뛰어남61–6560–6460–6461–6560–6460–64
좋음66–6965–6865–6966–6965–6865–68
평균 이상70–7369–7270–7370–7369–7369–72
평균74–7873–7674–7874–7774–7773–76
평균 이하79–8477–8279–8478–8378–8377–84
나쁨85+83+85+84+84+85+


위의 표를 보고 이 센서가 아니더라도 자신의 심박수를 체크할 수 있는 장치가 있다면 건강체크를 해 보는 것도 좋을 것 같습니다.

센서의 뒷면 입니다. 3개의 단자가 있으며 Signal, VCC (5V), GND 로 이루어져 있습니다. 연결선은 구입 시부터 납땜되어 붙어 있습니다. 아두이노에 바로 연결하면 됩니다.


심박 감지부 입니다. 가운데 LED 에서 밝은 녹색의 빛이 나오고 바로 아래 반사되는 빛을 감지하는 빛 감지 센서가 있습니다. 심장박동 시 혈류가 증가하면 반사되는 빛의 양이 줄어드는 점을 이용해서 심박을 측정 합니다. 자세한 원리는 [여기] 에 가보시면 설명이 되어 있습니다. 고로 손가락, 귀 등 심박에 따라 혈류의 변화가 잘 보이는 부위에서 더욱 잘 작동 합니다.


심박센서의 원리, 출처: http://www.raviyp.com/embedded/140-learn-how-a-heart-beat-sensor-works

 

이 센서는 특이하게도 별도의 웹사이트가 존재 합니다. http://pulsesensor.com/ 라는 사이트 인데요. 여기에서 센서의 정보 및 사용법에 대한 많은 정보를 얻을 수 있습니다. 이 사이트에 링크되어 있는 GitHub 의 예제를 실행해 보겠습니다.

■ 연결
연결은 간단 합니다. Signal 은 아날로그 Input 단자인 A0 에 연결하고 VCC 는 5V에 GND는 GND에 연결하면 됩니다. 그리고 심박의 관찰을 위해 D13에 LED를 하나 연결 합니다. 하지만 LED는 굳이 연결하지 않아도 됩니다. 아두이노 자체에 13번 LED가 달려 있으니까요. 그리고 소스를 보면 주석에 D5 에 LED를 하나 더 달아주라고 되어 있는데 무엇 때문인지 모르겠지만 저의 경우는 계속 켜져있기만 하고 제대로 작동하지 않네요.

 심장박동 센서

 아두이노 UNO

 Signal

 A0

 VCC

 5V

 GND

 GND


 
■ 소스
소스는 아래의 사이트에서 다운로드 받을 수 있습니다. Download ZIP 을 클릭해서 다운로드 받습니다.

PulseSensor_Amped_Arduino-master.zip



압축을 풀면 위와 같이 4개의 소스가 나오는데 라이브러리화가 되어 있지 않아서 PulseSensorAmped_Arduino_1dot4.ino 이외에는 참조파일들 입니다. 즉, 4개의 소스가 하나의 폴더에 있어야 작동이 됩니다.


파일 -> 열기를 눌러서 PulseSensorAmped_Arduino_1dot4.ino 를 열어 줍니다. 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 
/*  Pulse Sensor Amped 1.4    by Joel Murphy and Yury Gitman   http://www.pulsesensor.com
----------------------  Notes ----------------------  ---------------------- 
This code:
1) Blinks an LED to User's Live Heartbeat   PIN 13
2) Fades an LED to User's Live HeartBeat
3) Determines BPM
4) Prints All of the Above to Serial
Read Me:
https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/blob/master/README.md   
 ----------------------       ----------------------  ----------------------
*/
 
//  Variables
int pulsePin = 0;                 // Pulse Sensor purple wire connected to analog pin 0
int blinkPin = 13;                // pin to blink led at each beat
int fadePin = 5;                  // pin to do fancy classy fading blink at each beat
int fadeRate = 0;                 // used to fade LED on with PWM on fadePin
 
// Volatile Variables, used in the interrupt service routine!
volatile int BPM;                   // int that holds raw Analog in 0. updated every 2mS
volatile int Signal;                // holds the incoming raw data
volatile int IBI = 600;             // int that holds the time interval between beats! Must be seeded! 
volatile boolean Pulse = false;     // "True" when User's live heartbeat is detected. "False" when not a "live beat". 
volatile boolean QS = false;        // becomes true when Arduoino finds a beat.
 
// Regards Serial OutPut  -- Set This Up to your needs
static boolean serialVisual = true;   // Set to 'false' by Default.  Re-set to 'true' to see Arduino Serial Monitor ASCII Visual Pulse 
 
 
void setup(){
  pinMode(blinkPin,OUTPUT);         // pin that will blink to your heartbeat!
  pinMode(fadePin,OUTPUT);          // pin that will fade to your heartbeat!
  Serial.begin(115200);             // we agree to talk fast!
  interruptSetup();                 // sets up to read Pulse Sensor signal every 2mS 
   // IF YOU ARE POWERING The Pulse Sensor AT VOLTAGE LESS THAN THE BOARD VOLTAGE, 
   // UN-COMMENT THE NEXT LINE AND APPLY THAT VOLTAGE TO THE A-REF PIN
//   analogReference(EXTERNAL);   
}
 
 
//  Where the Magic Happens
void loop(){
  
    serialOutput() ;       
    
  if (QS == true){     // A Heartbeat Was Found
                       // BPM and IBI have been Determined
                       // Quantified Self "QS" true when arduino finds a heartbeat
        fadeRate = 255;         // Makes the LED Fade Effect Happen
                                // Set 'fadeRate' Variable to 255 to fade LED with pulse
        serialOutputWhenBeatHappens();   // A Beat Happened, Output that to serial.     
        QS = false;                      // reset the Quantified Self flag for next time    
  }
     
  ledFadeToBeat();                      // Makes the LED Fade Effect Happen 
  delay(1000);                             //  take a break
}
 
void ledFadeToBeat(){
    fadeRate -= 15;                         //  set LED fade value
    fadeRate = constrain(fadeRate,0,255);   //  keep LED fade value from going into negative numbers!
    analogWrite(fadePin,fadeRate);          //  fade LED
  }
cs

위와 같이 소스가 나오는데 원래 소스에서 수정해준 부분은 29행의 static boolean serialVisual = true; 부분 입니다. Default 는 false 로 되어 있습니다.  그리고 측정 속도가 너무 빨라서 58행의 delay 값을 200 에서 1000으로 높여 주었습니다. 이렇게 설정해주면 자신의 심박수를 시리얼 모니터를 통해서 볼 수 있습니다.

저의 심박수를 측정한 결과 입니다. 대략 80 정도를 유지하고 있네요. 위의 정상 심박수 결과와 비교해보니 평균 이하의 값 입니다. 운동을 열심히 해야 겠네요. ㅠㅠ 측정 결과값은 1분 정도는 지나야 제대로 나오는 것 같습니다. 처음에는 심박수가 너무 높게 나오는 경향이 있네요.


이 동영상은 심장박동에 따라서 LED까 깜빡이는 모습 입니다. D5 에 연결된 LED 는 작동하지 않네요. 원인은 모르겠습니다. 소스를 좀 더 들여다봐야 할 듯 합니다.


원래는 이렇게 작동되어야 합니다.



이상으로 심장박동 센서(심박센서)의 기본적인 원리와 활용에 대해서 알아보았습니다. 다음 글에서는 이 센서를 활용해서 좀 더 비주얼하게 심장박동을 보여주는 방법을 알아보려고 합니다.




■ 추가사항 (2016년 11월 5일) : 위의 글에 보면 D5에 연결된 LED 가 제대로 동작하지 않는다는 언급이 있다. 이에 대해 어느 분이 댓글을 달아주셨는데 delay(1000) 으로 임의로 변경한 부분을 delay(20)으로 변경하면 정상적으로 작동이 된다고 한다. 현재 직접 연결해서 테스트는 못 해 본 상태.

반응형
반응형

현재 가지고 있는 아두이노 센서류와 부품들을 정리해 보았다.


1. 소리감지센서 (KY-038)

마이크로 감지된 소리를 아날로그와 디지털로 출력해준다.

가변조절기로 감도 조절도 가능하다.

핀배열: 사진에 보이는 좌측부터 D0, VCC, GND, A0

Schematic

Pin + to Arduino 5+

Pin - to Arduino -

Pin A0 to Arduino A0 (for analog program)

Pin D0 to Arduino 13 (for digital program)



Example code: Digital output

int Led = 13 ;// define LED Interface

int buttonpin = 3; // define D0 Sensor Interface

int val = 0;// define numeric variables val

 

void setup ()

{

  pinMode (Led, OUTPUT) ;// define LED as output interface

  pinMode (buttonpin, INPUT) ;// output interface D0 is defined sensor

}

 

void loop ()

{

  val = digitalRead(buttonpin);// digital interface will be assigned a value of pin 3 to read val

  if (val == HIGH) // When the sound detection module detects a signal, LED flashes

  {

    digitalWrite (Led, HIGH);

  }

  else

  {

    digitalWrite (Led, LOW);

  }

}



Example Code : analog outputs

int sensorPin = A0; // select the input pin for the potentiometer

int ledPin = 13; // select the pin for the LED

int sensorValue = 0; // variable to store the value coming from the sensor

 

void setup () 

{

  pinMode (ledPin, OUTPUT);

  Serial.begin (9600);

}

 

void loop () 

{

  sensorValue = analogRead (sensorPin);

  digitalWrite (ledPin, HIGH);

  delay (sensorValue);

  digitalWrite (ledPin, LOW);

  delay (sensorValue);

  Serial.println (sensorValue, DEC);

}


출처: https://tkkrlab.nl/wiki/Arduino_KY-038_Microphone_sound_sensor_module




2. 온도센서 (LM35)

온도를 감지해 디지털로 출력해준다.

핀배열: 하기그림 참조

이 센서를 이용해 현재 온도 구하기: http://deneb21.tistory.com/199






3. RGB LED (KY-016)

Red, Green, Blue 3가지 색을 내는 LED 모듈

PIN Connect

Arduino pin 11 --> Pin R module

Arduino pin 10 --> Pin G module

Arduino pin 9 --> Pin B module

Arduino pin GND --> Pin - module


Example Code

//KY016 3-color LED module

int redpin = 11; // select the pin for the red LED

int bluepin = 10; // select the pin for the blue LED

int greenpin = 9 ;// select the pin for the green LED

int val;

void setup () {

  pinMode (redpin, OUTPUT);

  pinMode (bluepin, OUTPUT);

  pinMode (greenpin, OUTPUT);

  Serial.begin (9600);

}

void loop ()

{

  for (val = 255; val> 0; val --)

  {

    analogWrite (11, val);

    analogWrite (10, 255-val);

    analogWrite (9, 128-val);

    delay (10);

    Serial.println (val, DEC);

  }

  for (val = 0; val <255; val ++)

  {

    analogWrite (11, val);

    analogWrite (10, 255-val);

    analogWrite (9, 128-val);

    delay (10);

    Serial.println (val, DEC);

  }

}



출처: https://tkkrlab.nl/wiki/Arduino_KY-016_3-color_LED_module






4. 5V Relay Module (KY-019)

Schematic

Arduino digital pin 10 --> module pin S

Arduino GND --> module pin -

Arduino +5V --> module pin +


Example Code

//KY019 5V relay module

int relay = 10; // relay turns trigger signal - active high;

void setup ()

{

  pinMode (relay, OUTPUT); // Define port attribute is output;

}

void loop ()

{

  digitalWrite (relay, HIGH); // relay conduction;

  delay (1000);

  digitalWrite (relay, LOW); // relay switch is turned off;

  delay (1000);

}


출처: https://tkkrlab.nl/wiki/Arduino_KY-019_5V_relay_module





5. RTC 모듈 (Real Time Clock Module)

아두이노 우노는 날짜, 시간 등을 알 수가 없어 이 모듈을 사용하여 시간, 날짜 등을 알 수 있다.

백업 배터리는 CR2032 사용.




6. Dual Axis XY 조이스틱 모듈 (KY-023)

핀배열: 사진 위부터 GND, +5V, X, Y, Button Switch




7. Temperature Humidity(온도 습도) 모듈 (KY-015)

핀배열: 사진에 보이는 좌측부터 Signal, 5V, GND

데이터시트: 

DHT11.pdf

라이브러리:

DHT11_library.zip


Specifications

Supply voltage: 3.3 ~ 5.5V DC

Output: single-bus digital signal

Measuring range: Humidity 20-90% RH, Temperature 0 ~ 50 ℃

Accuracy: Humidity + -5% RH, temperature + -2 ℃

Resolution: Humidity 1% RH, temperature 1 ℃

Long-term stability: <± 1% RH / Year


Schematic

Arduino pin 8 --> Pin S module

Arduino GND --> Pin - module

Arduino +5 --> Pin Middle


Example Code

//KY015 DHT11 Temperature and humidity sensor 

int DHpin = 8;

byte dat [5];

byte read_data () {

  byte data;

  for (int i = 0; i < 8; i ++) {

    if (digitalRead (DHpin) == LOW) {

      while (digitalRead (DHpin) == LOW); // wait for 50us

      delayMicroseconds (30); // determine the duration of the high level to determine the data is '0 'or '1'

      if (digitalRead (DHpin) == HIGH)

        data |= (1 << (7-i)); // high front and low in the post

      while (digitalRead (DHpin) == HIGH); // data '1 ', wait for the next one receiver

     }

  }

return data;

}

 

void start_test () {

  digitalWrite (DHpin, LOW); // bus down, send start signal

  delay (30); // delay greater than 18ms, so DHT11 start signal can be detected

 

  digitalWrite (DHpin, HIGH);

  delayMicroseconds (40); // Wait for DHT11 response

 

  pinMode (DHpin, INPUT);

  while (digitalRead (DHpin) == HIGH);

  delayMicroseconds (80); // DHT11 response, pulled the bus 80us

  if (digitalRead (DHpin) == LOW);

  delayMicroseconds (80); // DHT11 80us after the bus pulled to start sending data

 

  for (int i = 0; i < 4; i ++) // receive temperature and humidity data, the parity bit is not considered

    dat[i] = read_data ();

 

  pinMode (DHpin, OUTPUT);

  digitalWrite (DHpin, HIGH); // send data once after releasing the bus, wait for the host to open the next Start signal

}

 

void setup () {

  Serial.begin (9600);

  pinMode (DHpin, OUTPUT);

}

 

void loop () {

  start_test ();

  Serial.print ("Current humdity =");

  Serial.print (dat [0], DEC); // display the humidity-bit integer;

  Serial.print ('.');

  Serial.print (dat [1], DEC); // display the humidity decimal places;

  Serial.println ('%');

  Serial.print ("Current temperature =");

  Serial.print (dat [2], DEC); // display the temperature of integer bits;

  Serial.print ('.');

  Serial.print (dat [3], DEC); // display the temperature of decimal places;

  Serial.println ('C');

  delay (700);

}


출처: https://tkkrlab.nl/wiki/Arduino_KY-015_Temperature_and_humidity_sensor_module





8. 4X4 Matrix Keypad Keyboard Module Micro Switch

16개의 스위치 모듈인데 자세한 스펙 등은 찾지 못하였음.




9. SUPER RED LED DOT MATRIX - Ф3.7MM / 8×8 / 1.3 INCH (33.3MM)

데이터시트 파일: 

A-1588AS.pdf


활용 예:


출처: https://www.youtube.com/watch?v=YIcebSrfGek





10. Stepper Driver Board (X113647)

스테핑모터 연결의 예: 


출처: http://electronics.stackexchange.com/questions/152356/import-alternative-stepper-motor-in-my-fritzing-sketch






11. Ultrasonic Ranging Module (HC-SR04)

초음파를 이용해 거리, 사물의 유무를 측정하는 센서

유저매뉴얼: 

HC-SR04Users_Manual.pdf





12. Water Sensor, Water Level Sensor

수분 감지, 수위감지 센서


활용예:

출처: https://www.youtube.com/watch?v=TuDxAyV2oBY





13. 1 Digit LED Module (5161AS)

데이터시트: 

5161as.pdf





14. 4 Digit LED Module (5461AS)

데이터시트:

A-5461AS.pdf





15. Step Motor (28BYJ-48)

규격: 

28BYJ-48.pdf

활용예:

출처: https://www.youtube.com/watch?v=asv5-kYzSsE

자료사이트: http://42bots.com/tutorials/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno/





16. IIC 1602 LCD (16 X 2)

개발 라이브러리 (16x2, 20x4)

LiquidCrystal_I2C1602V1.zip

LiquidCrystal_I2C2004V1.zip


표현예:

출처: http://www.hardcopyworld.com/ngine/aduino/index.php/archives/181

참고 사이트: http://www.hardcopyworld.com/ngine/aduino/index.php/archives/181


IIC 1602 LCD (16 X 2) 뒷면





17. Servo Motor (SG90)

규격: 

SG90.pdf

활용예:

출처: https://www.youtube.com/watch?v=2A_Ux9rJBD0





18. 적외선 테스트용 리모콘 (IR Infrared Remote Controller)





19. RFID Test Kit: RFID Module, RFID keychain, RFID White card





20. 가변저항





21. Switch





22. Buzzer





23. 시프트 레지스터(74HC595)

아두이노 우노는 14개의 디지탈 입출력 핀을 보유하고 있지만. 종종 핀이 부족한 경우가 생긴다. 쉬프트 레지스터는 아두이노의 출력 핀이 모자랄 때 사용하여 출력 핀 수를 늘릴 수 있다. 74HC595는 3개의 입력 핀과 8개의 출력 핀을 가지고 있어 74HC595를 1개 사용하면 아두이노의 출력 핀을 5개 더 늘려주는 효과가 있다....

출처: http://blog.naver.com/damtaja/220101498289

데이터시트: 

74HC_HCT595.pdf





24. 적외선 감지 센서 (VS1838B)

데이터시트: 

Infrared receiver vs1838b.pdf


적외선 감지 센서 (VS1838B) 뒷면

아두이노 연결예:

출처: http://arduino.stackexchange.com/questions/3926/using-vs1838b-with-arduino





25. Photo Resistor (빛의 세기를 감지)





26. RGB LED





27. Flame Sensor (화염 감지 센서)





28. 각종 저항





29. 숫놈 - 숫놈 연결 케이블





30. 연결 단자





31. 암놈 - 숫놈 연결 케이블 (듀폰 케이블)





32. 각종 LED들

반응형

+ Recent posts