2014년 10월 9일 목요일

이건희는 안 죽었다는데

이건희는 안죽었다는데
 (http://www.viewsnnews.com/article/view.jsp?seq=114668)

주가는 떨어지고, 환율은 오르고,
(http://www.viewsnnews.com/article/view.jsp?seq=114676)

박근혜는 "통일 이전에 남북 경제격차 줄여야"라고 하고
(http://www.viewsnnews.com/article/view.jsp?seq=114686)

경제는 수렁으로 빠져 엊 비슷하게 가고.
(http://www.viewsnnews.com/article/view.jsp?seq=114682)

2014년 9월 15일 월요일

원격의료 대비, 동네 의원들이 사용해 볼만한 E-health 시스템

안되는 것도 없고 되는 것도 없는 대한민국에서 원격 의료는 되지 않는 듯하면서 될 것 같다. 이것 또한 대부분의 의사(동네 의원) 및 서민들에게는 해택이 없다. 오히려 소외 될 것이다. 이러한 상황에 개미들이 대처하는 할 수 있는 방법은 원격 의료에 사용할 수 있는 저렴하고 공개된 시스템을 구성해서 대기업의 의욕을 꺽는 방법 뿐이다. 아래의 시스템은 소위 아두이노 기반의 플랫폼에 연결할 수 있는 적층형 보드이다. 혈압, 온도, 산소, 심박, ECG, 등등.... 원만한 간단한 검사는 가능할 듯하다. 가격도 450 유로다. 이 가격도 대량 구매 혹은 직접 구성한다면 더 저렴해 질 수 있다.


사용 가능한 센서들:


- e-Health Sensor Shield for Arduino and Raspberry Pi
- Pulse and oxygen in blood sensor (SPO2)
- Airflow sensor (breathing)
- Body temperature sensor
- Electrocardiogram sensor (ECG)
- Glucometer sensor
- Galvanic skin response sensor (GSR - sweating)
- Blood pressure sensor (sphygmomanometer) V2.0 New Sensor
- Patient position sensor (Accelerometer)
- Electromyography Sensor (EMG) New Sensor


[출처]


http://www.cooking-hacks.com/ehealth-sensors-complete-kit-biometric-medical-arduino-raspberry-pi

2014년 7월 29일 화요일

[번역중] 초분광 카메라 혹은 스펙트로 미터를 위한 분광기 설계

[출처 : http://www.ibsenphotonics.com/technology/spectrometer-design-guide#optics]

소개

이 문서는 diffraction grating 에 기반한 분광기 디자인과 다양한 diode array (리니어 센서) 들을 비교하고 평가하고 디자인하기 위한 공식과 디자인 가이드 라인을 사용하기 쉽고 간단하게 제공합니다.

디자인 과정에 투여되는 입력은 당신이 다루기 원하는 파장 범위와 당신의 스펙트럼에서 얼마나 다양한 구조들을 분석하는지에 따른 광학 분해능등이다.

주의 !

이 안내서를 사용해서 만드는 분광기 디자인은 당신의 디자인 과정의 초입단계에서만 사용되어져야 합니다. 하드웨어적으로 분광기를 구현하고자한다면 미세한 디자인이 가능한 수치적인 시뮬레이션 도구를 항상 사용해야만 합니다. (예를 들자면 geometrical ray tracing).

어떻게 diode array 분광가 작동하나


기본적으로 분광기는 감지부에 입력 슬릿으로 부터의 상을 생성하는 렌즈와 거울들로 구성되는 광학 시스템입니다. 렌즈와 거울 사이에는 서로 다른 각도로 다른 파장들을 분사하는 diffraction grating이 위치합니다. 이것은 입력 슬릿으로부터 들어오는 빛의 서로 다른 파장의 성분들이 감지부 array 센서에 서로 다른 위치에 상을 맺도록 합니다.

출처: http://www.ibsenphotonics.com/wp-content/uploads/Spectrometer-design-guide.pdf

다음의 내용에서 두 개의 일반적인 분광기 구조들을 설명합니다; transmission grating에 기반한 것과 꺽인 형태의 Czerny-Turner 구조입니다. 또한, 그림들은 분광기의 중요한 디자인 변수들을 정의 합니다.

출처 : http://www.ibsenphotonics.com/wp-content/uploads/Spectrometer-design-guide.pdf

최소 파장:
최대 파장:
파장 대역:
파장 해상도
중심 파장

입사각
반사각



2014년 6월 25일 수요일

스테레오 비젼 플랫폼

보통 bt.656 방식의 카메라 신호를 처리할 수 있는 임베디드 시스템은 의외로 구하기 힘들다. 심지어 두 개의 카메라 신호를 지원하는 시스템은 analog device사의 blackfin정도 가 있는 것 같다. 하지만, blackfin을 사용하기에는 좀 불편한 점들이 많다.

다행히 BeagleBone 시스템을 이용해서 스테레오 카메라 신호를 처리할 수 있다. 카메라 신호를 전용으로 처리할 수 있는 주변부는 없지만, PRU(Programmable Realtime Unit)라는 것이 두개가 있어서 용도에 따라 실시간 신호 처리가 가능하다. 자세한 것은 다음 링크를 살펴보면 된다.

http://processors.wiki.ti.com/images/1/18/PRUSS_Training_Slides.pdf

그리고 다른 방법으로 Cypress 사의  How to  Implement  an  Image  Sensor  Interface  Using  EZ-USB® FX3™ in a USB Video Class (UVC) Framework 문서를 살펴보면 9. Connecting Two Image Sensors 라는 항목에서 3D 이미지 생성, kinetics를 위한  두 개의 센서를 연결할 수 있는 방법을 소개하고 있다.

[참고자료]

http://hackaday.com/page/3/
http://www.embeddedrelated.com/showarticle/586.php
http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit_Subsystem
http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2013/08/18/bbb--imaging-with-a-pru-connected-camera
http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2013/05/22/bbb--working-with-the-pru-icssprussv2
http://www.cypress.com/file/123506/download

2014년 5월 21일 수요일

좀 걱정스러운 휴대폰의 지문정보 및 생체정보 관리

아이폰의 TouchID http://support.apple.com/kb/HT5883?viewlocale=ko_KR&locale=ko_KR

스마트폰 지문 인식. 선택이 아닌 필수가 될까? http://review.cetizen.com/5595/view/23/5595/rview/special

삼성 보급형에도 지문 인식 http://gigglehd.com/zbxe/11484009#1

삼성전자, 홍채인식 가능한 스마트폰 선보인다 http://news1.kr/articles/1419752

바야흐로 몇몇 대기업들(skt, samsung, 등등)이 거의 모든 국민 (산간 도서 지역 거주자 및 찌져지게 가난한 몇몇 계층을 제외한)의 지문정보와 생체정보를 구축할 수 있는 환경이 모두 갖추어 졌다.
 앞으로 휴대폰의 저 구석탱이에 있는 다음과 같은 메시지는 대부분 보지 못할 것이다.

............
진단 및 사용내용
 ............
 자동으로 보냄



2014년 4월 9일 수요일

새로운 논문을 위한 아이디어 노트

사과의 품종을 정하고 현재 규정되어 있는 등금에 따른 표준 구형 모델을 제작
혹은, 설정이 고정된 영상 시스템에서 크기별로 영상을 획득하고 그 영상들의 평균 영상을 추려내는 방식으로 사과 영상에 대한 표준화 과정을 거친다.

이러한 표준 영상을 기반으로 구형 모양의 사과에서 발생하는 난반사를 줄이는 정규화 방법을 모색해 보자.


2014년 3월 21일 금요일

아두이노에 마우스 센서 갖다 붙이기

로지텍 마우스에 붙어 있는 마우스 센서를 사용하기 위해서 우선 열어 보았다. 센서 같이 보이는 칩의 상단에 표기된 봐로는 H2000이라고 되어 있지만, 실제로 정확한 마우스 센서의 이름은 HDNS 2000이다. 저렴한 마우스를 직접 이용하는 것이 손 쉬은 것은 필요한 부품은 일일이 구하로 다닐 필요 없이 약간의 기판 쪼가리만 가지고 있으면 아두이노와 연결 할 수 있다는 점이다.

실제로 작업에 들어 가기에 앞서 HDNS 2000의 데이터 시트를 살펴보자. 아래의 회로는 데이터 시트에서 추천하는 인터페이스 회로이다. 두 개를 제안하고 있지만, 내가 사용하고자하는 용도에는 다음의 회로가 적합하다.


 위의 회로에서 Cypress사의 Cyxxxx라는 것은 무시하고 HDNS2000과3.3V용 레귤레이터 그리고 다섯개의 신호선만 사용할 것이다. 실제로 로지텍 마우스를 열어 보면 거의 동일하다. 다섯개의 신호선중 NRESET이라는 신호선은 실제로 사용하지 않아도 무관한 신호선이다. 그냥 내버려 두어도 무관한다. 나중에 아두이노에서 때때로 센서를 초기화 해야 할 경우가 발생하면 그 때 가서 연결해보 무방하다. 아무튼 지금은 간단하기 네 개의 신호선 XA, XB, YA, YB만 사용할 것이다. 이 네 신호선에 대한 설명도 데이터 시트를 살펴보면 복잡하다. 예전에 마이크로 마우스를 건드려 본 경험이 있거나, 모터를 만지작 해 보았다면 encoder라는 것을 들어 보았을 것이다. HDNS2000은 아주 간단히 설명하자면 X축과 Y축 방향으로 encoder가 하나씩 들어 있는 칩으로 보면 정확할 것이다. 실제로 코드도 encoder를 다루는 방식으로 접근한다.

 

XA, XB, YA, YB 핀은 각각 아두이노의 D8, D9, D10, D11핀에 연결한다. 보면 알겠지만, 아쉽게도 외부 인터럽트 핀은 INT0, INT1으로 두개 밖에 지원하지 않는다.












간단히 이야기 하자면 HDNS 2000 센서는 X축과 Y축을 위해 각각 두 개의 엔코더 신호선을 제공한다. 아쉽게도 직접 영상을 얻어 올 수 있는 통로는 제공되지 않는다. 아무튼 총 4 신호선을 외부 인터럽트로 다루기 위해서 코드가 복잡해 진다. 그래서 이미 만들어 져 있는 코드를 아두이노 IDE에 외부 라이브러리 형태로 설치해야 한다. 다음의 누리집에 가면 pinchangeint라는 라이브러리를 받아 볼 수 있다.

 http://code.google.com/p/arduino-pinchangeint/downloads/list  

가장 최신의 것을 다운로드하고 윈도우 시스템의 경우 다음의 경로에

 C:\Users\Anonymous\Documents\Arduino\libraries  

압축을 해제하고, 다음의 코드를 컴파일하자.


  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
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#include <PinChangeInt.h>
//#include <PinChangeIntConfig.h>
        
#define ledPin (13)
#define encoderXPinA (10)
#define encoderXPinB (11)
#define encoderYPinA (8)
#define encoderYPinB (9)

volatile unsigned int encoderXPos = 0;
volatile unsigned int encoderYPos = 0;
unsigned int lastReportedXPos = 1;
unsigned int lastReportedYPos = 1;
static boolean rotatingX = false;
static boolean rotatingY = false;

boolean XA_set = false;
boolean XB_set = false;
boolean YA_set = false;
boolean YB_set = false;

// the setup routine runs once when you press reset:
void setup() {                
  Serial.begin(9600);
  Serial.println("hello");

  pinMode(ledPin, OUTPUT);
  pinMode(encoderXPinA, INPUT);
  pinMode(encoderXPinB, INPUT);
  pinMode(encoderYPinA, INPUT);
  pinMode(encoderYPinB, INPUT);
  
  //digitalWrite(encoderXPinA, HIGH);
  //digitalWrite(encoderXPinB, HIGH);
  //digitalWrite(encoderYPinA, HIGH);
  //digitalWrite(encoderYPinB, HIGH);
  
  // Attach pin change interrupt service routines from the Wiegand RFID readers
  PCintPort::attachInterrupt(encoderXPinA, doEncoderXA, CHANGE); // attach a PinChange Interrupt to our pin on the rising edge
  PCintPort::attachInterrupt(encoderXPinB, doEncoderXB, CHANGE); // attach a PinChange Interrupt to our pin on the rising edge
  PCintPort::attachInterrupt(encoderYPinA, doEncoderYA, CHANGE); // attach a PinChange Interrupt to our pin on the rising edge
  PCintPort::attachInterrupt(encoderYPinB, doEncoderYB, CHANGE); // attach a PinChange Interrupt to our pin on the rising edge

}

// the loop routine runs over and over again forever:
void loop() {
  //rotatingX = true; // reset the debouncer
  //rotatingY = true; // reset the debouncer
  
  if (lastReportedXPos != encoderXPos ||
      lastReportedYPos != encoderYPos) {
    Serial.print("X:");
    Serial.print(encoderXPos, DEC);
    lastReportedXPos = encoderXPos;
    Serial.print(" Y:");
    Serial.println(encoderYPos, DEC);
    lastReportedYPos = encoderYPos;
  }
  
  digitalWrite(ledPin, HIGH);
  delay(200);
  digitalWrite(ledPin, LOW);
  delay(200);               // wait for a second
}

// Interrupt on A changing state
void doEncoderXA(void)
{
  // debounce
  if (rotatingX) delay (1);  // wait a little until the bouncing is done
  // Test transition, did things really change? 
  if (digitalRead(encoderXPinA) != XA_set) {  // debounce once more
    XA_set = !XA_set;
    // adjust counter + if A leads B
    if (XA_set && !XB_set) encoderXPos += 1;
    rotatingX = false;  // no more debouncing until loop() hits again
  }
}

// Interrupt on B changing state, same as A above
void doEncoderXB(){
  if (rotatingX) delay (1);
  if (digitalRead(encoderXPinB) != XB_set) {
    XB_set = !XB_set;
    //  adjust counter - 1 if B leads A
    if (XB_set && !XA_set) encoderXPos -= 1;
    rotatingX = false;
  }
}

// Interrupt on A changing state
void doEncoderYA(void)
{
  // debounce
  if (rotatingY) delay (1);  // wait a little until the bouncing is done
  // Test transition, did things really change? 
  if (digitalRead(encoderYPinA) != YA_set) {  // debounce once more
    YA_set = !YA_set;
    // adjust counter + if A leads B
    if (YA_set && !YB_set) encoderYPos += 1;
    rotatingY = false;  // no more debouncing until loop() hits again
  }
}

// Interrupt on B changing state, same as A above
void doEncoderYB(){
  if (rotatingY) delay (1);
  if (digitalRead(encoderYPinB) != YB_set) {
    YB_set = !YB_set;
    //  adjust counter - 1 if B leads A
    if (YB_set && !YA_set) encoderYPos -= 1;
    rotatingY = false;
  }
}

코드를 테스트 하기위해서 렌즈와 뚜껑을 덥고,  아두이노 IDE에서 실행 이미지를 다운로드 하여 실제로 마우스 처럼 굴러가는 지 확인해 보았다.













 아직은 정확도를 확인해 보지는 못하였다.


참고 자료
http://photonicsguy.ca/_media/projects/electronics/opticalmouse/h2000.pdf
http://www.pighixxx.com/pgdev/Temp/Arduino_uno_Pinout.pdf
http://playground.arduino.cc/Main/RotaryEncoders#.UysL-IUmk7k
http://forum.arduino.cc/index.php?topic=84040.0
http://code.google.com/p/arduino-pinchangeint/
http://arduino.cc/en/Guide/Libraries#.UysE2IUmk7k
http://codeformatter.blogspot.com/
http://hilite.me/