Learn More

전체상품카테고리

Cushion Sensor coding Kit

(해외배송 가능상품) New
공급사
공급사 공급사 바로가기
Basic Information
Product : Cushion Sensor coding Kit
Manufacturer : Self-production
Country : Republic of Korea
Price : $66.00
Code : P00000DX
Summary : Data acquisition about seated person's posture through Arduino
Domestic / International Shipping : oversea delivery
Payment for Shipping : Parcel Service
Shipping (Charge) : International Shipping Fee
수량 : 수량증가수량감소
Share
Share :
상품 옵션
Select item with details above
(Minimum Order : 1 or more / Maximum Order 0 or less) Size Charts

Select quantity

To add product, select an option in the above option box

Product List
Product Quantity Price
Cushion Sensor coding Kit up down 66 (  )
Total(Quantity) : 0 (0 item)

Combination Products

Buy together To purchase, please select the item.

 
Option Information
Select
Add
 
Option Information
Select
Add

Deals

Product Detail Information



This page will be updated in English.

Please see the technical document below. And see the Arduino source code in the bottom of this page


Link to Technical document(English) -Manual, CAD, ...








컬러맵으로 변환해서 보여줄 수 있는 예제입니다. 윈도우 PC용입니다.
프로세싱을 이용하여 코딩하며, 소스 코드를 제공합니다.




< 센서 보호 >
아래 그림처럼 센서를 방석 안에 넣어서 사용하면 파손을 방지할 수 있습니다.




예제) 압력 센서의 측정값을 시리얼 포트로 출력.
아두이노 나노를 사용하는 경우에는 16번째 줄의 'A3'를 'A7'로 바꿔주세요.
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
 //  mux ic : 74HC4067. it can connect 16 pins with 4 signal pins
//  This shield adopts 2 mux ic. so it can connect 32 pins with 4 signal pis and 2 enable pins
int S0  = 5;
int S1  = 4;
int S2  = 3;
int S3  = 2;
 
//  mux ic selection pins. This shield uses 2 mux ic.
int En0 = 7;  //  Low enabled
int En1 = 6;  //  Low enabled
 
int controlPin[] = {S0,S1,S2,S3,En0,En1}; // same to {5, 4, 3, 2, 7, 6}
 
 
// adc pin, read sensor value.
int ADC_pin = A3; // Arduino ProMicro : A3, Arduino NANO : A7
 
//  adc data buffer
const int NUM_OF_CH = 32;
int sensor_data[NUM_OF_CH];
 
 
 
void setup() {
  pinMode(En0, OUTPUT);
  pinMode(En1, OUTPUT);
 
  pinMode(S0, OUTPUT);
  pinMode(S1, OUTPUT);
  pinMode(S2, OUTPUT);
  pinMode(S3, OUTPUT);
 
  Serial.begin(115200);
}
 
 
void loop() {
 
  //  read adc value. scan 32 channels of shield.
  for(int ch = 0 ; ch < NUM_OF_CH ; ch++){
    sensor_data[ch] = readMux(ch);
  }
 
 
  //  print to serial port
  for(int ch = 0; ch < NUM_OF_CH; ch++){
    Serial.print(sensor_data[ch]);
    Serial.print(",");  // comma is used as a delimiter.
  }
  Serial.println(" ");  // end of line. carriage return.
 
  delay(10); // sleep for 10 milli seconds. It slow down the speed. You can delete this line.
}
 
 
int readMux(int channel){
 
  int muxChannel[NUM_OF_CH][6]={ //  6 means number of digital control pins for 2 mux ic.
    //  {S0,S1,S2,S3,En0,En1}
    {0,0,0,0,0,1}, //channel 0. '0': pin out low, 1 : pin out high.
    {0,0,0,1,0,1}, //channel 1 It means S0=0, S1=0, S2=0, S3=1, En0=0, En1=1
    {0,0,1,0,0,1}, //channel 2
    {0,0,1,1,0,1}, //channel 3
    {0,1,0,0,0,1}, //channel 4
    {0,1,0,1,0,1}, //channel 5
    {0,1,1,0,0,1}, //channel 6
    {0,1,1,1,0,1}, //channel 7
    {1,0,0,0,0,1}, //channel 8
    {1,0,0,1,0,1}, //channel 9
    {1,0,1,0,0,1}, //channel 10
    {1,0,1,1,0,1}, //channel 11
    {1,1,0,0,0,1}, //channel 12. It means S0=1, S1=1, S2=0, S3=0, En0=0, En1=1
    {1,1,0,1,0,1}, //channel 13
    {1,1,1,0,0,1}, //channel 14
    {1,1,1,1,0,1}, //channel 15
    {0,0,0,0,1,0}, //channel 16
    {0,0,0,1,1,0}, //channel 17
    {0,0,1,0,1,0}, //channel 18
    {0,0,1,1,1,0}, //channel 19
    {0,1,0,0,1,0}, //channel 20
    {0,1,0,1,1,0}, //channel 21. It means S0=0, S1=1, S2=0, S3=1, En0=1, En1=0
    {0,1,1,0,1,0}, //channel 22
    {0,1,1,1,1,0}, //channel 23
    {1,0,0,0,1,0}, //channel 24
    {1,0,0,1,1,0}, //channel 25
    {1,0,1,0,1,0}, //channel 26
    {1,0,1,1,1,0}, //channel 27
    {1,1,0,0,1,0}, //channel 28
    {1,1,0,1,1,0}, //channel 29
    {1,1,1,0,1,0}, //channel 30
    {1,1,1,1,1,0}  //channel 31
  };
 
 
  // config 6 digital out pins of 2 mux ic.
  for(int i = 0; i < 6; i ++){
    digitalWrite(controlPin[i], muxChannel[channel][i]);
  }
 
  //read sensor value
  int adc_value = analogRead(ADC_pin);
 
  return adc_value;
}
cs



예제) 키보드 매핑 - 압력값에 따라 전후좌우 버튼이 눌리도록 설정됨.
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
//  방석 센서 키패드 Ver 180712
//  기술 문의 : sales@mdex.co.kr , 마블덱스
//  방석 센서를 깔고 앉아서 전후좌우로 움직이면, 키보드 이벤트를 발생시킵니다.
//  설정 1, 2를 변경해서 바로 원하는 동작을 만들어보세요.
 
#include "Keyboard.h"
 
 
//----------------------------------------------
//  설정 1 - 키맵) 방향키
char KEY_MAP_row_1st   = KEY_UP_ARROW;    // ↑
char KEY_MAP_row_3rd   = KEY_DOWN_ARROW;  // ↓
char KEY_MAP_COP_left  = KEY_LEFT_ARROW;  // ←
char KEY_MAP_COP_right = KEY_RIGHT_ARROW; // →
 
//----------------------------------------------
// 설정 2 - 키맵) FPS 슈팅 게임용
//char KEY_MAP_row_1st   = 'w';
//char KEY_MAP_row_3rd   = 's';
//char KEY_MAP_COP_left  = 'a';
//char KEY_MAP_COP_right = 'd';
 
//  특수키:  https://www.arduino.cc/reference/en/language/functions/usb/keyboard/keyboardmodifiers/
//  일반 문자 : http://www.asciitable.com/
 
//----------------------------------------------
//  설정 - 키이벤트를 발생하는 문턱값. 무게중심의 좌표값. (범위 : -1.0 ~ 1.0)
//        문턱값을 넘기면 키가 눌리게 됨. 0 에 가까울수록 민감하게 동작.
const float THRESHOLD_COP_forth   = 0.3;    // 앞 쏠림. Y가 이 값보다 커야 키이벤트 발생.
const float THRESHOLD_COP_back    = -0.85;  // 뒤 쏠림. Y가 이 값보다 작아야 키이벤트 발생.
const float THRESHOLD_COP_left    = -0.22;  // 좌 쏠림. X가 이 값보다 작아야 키이벤트 발생.
const float THRESHOLD_COP_right   = 0.22;   // 우 쏠림. X가 이 값보다 커야 키이벤트 발생.
 
//----------------------------------------------
//  무효 판정 문턱값. 측정값이 아래 문턱값보다 낮으면 무시함.
const int THRESHOLD_SUM_row_1st   = 60;   // 1st row, front row
const int THRESHOLD_SUM_row_3rd   = 60;   // 3rd row, back row
const int THRESHOLD_SUM_row_2nd   = 105;  // 2nd row, left and right
const int THRESHOLD_SUM_VERT      = 60; // SUM? PRESSURE?
 
//----------------------------------------------
//  상수 - 방석의 셀 개수
const int CONST_SEAT_CELL_NUM_TOTAL = 31; // Total number of sensor cells = 31.
const int CONST_SEAT_CELL_NUM_ROW_1ST = 6;
const int CONST_SEAT_CELL_NUM_ROW_2ND = 15;
const int CONST_SEAT_CELL_NUM_ROW_3RD = 10;
 
 
 
//----------------------------------------------
//  변수
int adc_value[32]; // 센서 측정값 버퍼
bool is_key_pressed[256];  // 특정 키가 눌렸는지를 기록.
 
//----------------------------------------------
//  하드웨어 핀
int En0 = 7;  //  4 to 16 decoder 0, Low enabled
int En1 = 6;  //  4 to 16 decoder 1, Low enabled
 
int S0  = 5;
int S1  = 4;
int S2  = 3;
int S3  = 2;
int SIG_pin = A3; // common output of two decoder
 
 
void setup() {
  Serial.begin(115200);
  pinMode(En0, OUTPUT);
  pinMode(En1, OUTPUT);
 
  pinMode(S0, OUTPUT);
  pinMode(S1, OUTPUT);
  pinMode(S2, OUTPUT);
  pinMode(S3, OUTPUT);
 
  ResetKeyboardLog();
  Keyboard.begin();
  Keyboard.releaseAll();
}
 
void loop() {
   // Read 32 sensor cells.
  for(int i = 0 ; i < 32 ; i++){
    adc_value[i] = readMux(i);
  }
 
  /*
   *    방석 센서의 번호. 센서는 총 31개가 가로로 3줄로 배열되어 있습니다.
   *    아래 그림은 adc_value에 담긴 측정값이 어느 위치의 센서값인지를 설명합니다.
   *    예를 들어 adc_value[14]는 1번째 줄의 3번째 센서의 측정값입니다.
   *    adc_value[2]는 3번째 줄의 3번째 센서의 측정값입니다.
   *  1st row (6 cells):                       10, 12, 14, 16, 18, 20
   *  2nd row (15 cells) :   5, 6, 7, 8, 9, 11, 13, 15(center), 17, 19, 21, 22, 23, 24, 25
   *  3rd row (10 cells) :                 0, 1, 2, 3, 4, 26, 27, 28, 29, 30
   *
   * 무게 중심의 X 좌표는 2번 줄의 측정값으로 계산합니다.
   * 무게 중심의 Y 좌표는 1, 3번 줄의 측정값으로 계산합니다.
   */
 //---------------------------------------------------------
 //     1, 3번 줄의 측정값으로 무게 중심의 Y 좌표 계산하기
 //---------------------------------------------------------
  int sum_row_1st = adc_value[10]+adc_value[12]+adc_value[14]+adc_value[16]+adc_value[18]+adc_value[20];
 
  int sum_row_3rd =   adc_value[0]+adc_value[1]+adc_value[2]+adc_value[3]+adc_value[4]
                    +adc_value[26]+adc_value[27]+adc_value[28]+adc_value[29]+adc_value[30];
 
  int sum_vertical = sum_row_1st + sum_row_3rd;
 
  double avg_row_1st = sum_row_1st / CONST_SEAT_CELL_NUM_ROW_1ST;
  double avg_row_3rd = sum_row_3rd / CONST_SEAT_CELL_NUM_ROW_3RD;
 
  //  무게 중심의 Y 좌표 계산
  float cop_vertical = 0.0;
  if( 0 < sum_vertical) {
    cop_vertical = (avg_row_1st * (1) + avg_row_3rd * (-1)) / (avg_row_1st + avg_row_3rd);
  }
 
  //  키 이벤트 발생 - 앞 쏠림, 뒤 쏠림
  if( sum_vertical < THRESHOLD_SUM_VERT) {
    KEY_Release(KEY_MAP_row_1st);
    KEY_Release(KEY_MAP_row_3rd);
  }
  else {
    if(THRESHOLD_COP_forth < cop_vertical) {
      KEY_Release(KEY_MAP_row_3rd);
      KEY_Press(KEY_MAP_row_1st);
    }
    else if(cop_vertical < THRESHOLD_COP_back) {
      KEY_Release(KEY_MAP_row_1st);
      KEY_Press(KEY_MAP_row_3rd);
    }
    else {
      KEY_Release(KEY_MAP_row_1st);
      KEY_Release(KEY_MAP_row_3rd);
    }
  }
 
 //---------------------------------------------------------
 //     2번 줄의 측정값으로 무게 중심의 X 좌표 계산하기
 //---------------------------------------------------------
  int sum_row_2nd =  adc_value[5]+adc_value[6]+adc_value[7]+adc_value[8]+adc_value[9]
                    +adc_value[11]+adc_value[13]+adc_value[15]+adc_value[17]+adc_value[19]
                    +adc_value[21]+adc_value[22]+adc_value[23]+adc_value[24]+adc_value[25];
 
  //  센서 2 번째 줄의 15개 센서의 측정값에 위치별 가중치(-7~7))를 부여하여 더합니다.
  //  그것을 7로 나눠서 좌표 범위를 -1~1 로 한정합니다.
  int sum_wp_horizon = (  (-7)*adc_value[5]+(-6)*adc_value[6]+(-5)*adc_value[7]
                          +(-4)*adc_value[8]+(-3)*adc_value[9]+(-2)*adc_value[11]
                          +(-1)*adc_value[13]+(0)*adc_value[15]
                          +(1)*adc_value[17]+(2)*adc_value[19]+(3)*adc_value[21]
                          +(4)*adc_value[22]+(5)*adc_value[23]+(6)*adc_value[24]
                          +(7)*adc_value[25] ) / 7.0; // divide 7.0 ==> unitize. (-7.0~7.0)
 
  float cop_horizon = 0.0;
  //  무게 중심의 X 좌표 계산
  if(0 < sum_row_2nd) {
    cop_horizon = sum_wp_horizon / (double)sum_row_2nd;
  }
 
  //  키 이벤트 발생 - 좌 쏠림, 우 쏠림
  if(sum_row_2nd < THRESHOLD_SUM_row_2nd) {
    KEY_Release(KEY_MAP_COP_right);
    KEY_Release(KEY_MAP_COP_left);
  }
  else {
    //  press left
    if(cop_horizon < THRESHOLD_COP_left) {
      KEY_Release(KEY_MAP_COP_right);
      KEY_Press(KEY_MAP_COP_left);
    }
    //  press right
    else if(THRESHOLD_COP_right < cop_horizon) {
      KEY_Release(KEY_MAP_COP_left);
      KEY_Press(KEY_MAP_COP_right);  
    }
    //  release left, right
    else {
      KEY_Release(KEY_MAP_COP_right);
      KEY_Release(KEY_MAP_COP_left);
    }
  }
 
  //  무게 중심 계산값을 출력하여 확인하기.
  //  Print_XY(cop_horizon, cop_vertical);  
 
  delay(10);//delay
}
 
int readMux(int channel){
  int controlPin[] = {S0,S1,S2,S3,En0,En1};
 
  int muxChannel[32][6]={
    {0,0,0,0,0,1}, //channel 0
    {0,0,0,1,0,1}, //channel 1
    {0,0,1,0,0,1}, //channel 2
    {0,0,1,1,0,1}, //channel 3
    {0,1,0,0,0,1}, //channel 4
    {0,1,0,1,0,1}, //channel 5
    {0,1,1,0,0,1}, //channel 6
    {0,1,1,1,0,1}, //channel 7
    {1,0,0,0,0,1}, //channel 8
    {1,0,0,1,0,1}, //channel 9
    {1,0,1,0,0,1}, //channel 10
    {1,0,1,1,0,1}, //channel 11
    {1,1,0,0,0,1}, //channel 12
    {1,1,0,1,0,1}, //channel 13
    {1,1,1,0,0,1}, //channel 14
    {1,1,1,1,0,1}, //channel 15
    {0,0,0,0,1,0}, //channel 16
    {0,0,0,1,1,0}, //channel 17
    {0,0,1,0,1,0}, //channel 18
    {0,0,1,1,1,0}, //channel 19
    {0,1,0,0,1,0}, //channel 20
    {0,1,0,1,1,0}, //channel 21
    {0,1,1,0,1,0}, //channel 22
    {0,1,1,1,1,0}, //channel 23
    {1,0,0,0,1,0}, //channel 24
    {1,0,0,1,1,0}, //channel 25
    {1,0,1,0,1,0}, //channel 26
    {1,0,1,1,1,0}, //channel 27
    {1,1,0,0,1,0}, //channel 28
    {1,1,0,1,1,0}, //channel 29
    {1,1,1,0,1,0}, //channel 30
    {1,1,1,1,1,0}  //channel 31
  };
 
  //loop through the 6 sig (muxChannel has 6 values)
  for(int i = 0; i < 6; i ++){
    digitalWrite(controlPin[i], muxChannel[channel][i]);
  }
 
  //read the value at the SIG pin
  int val = analogRead(SIG_pin);
 
  return val;
}
 
void Print_XY(float x, float y) {
  Serial.print("x= ");
  Serial.print(x);
  Serial.print(", y= ");
  Serial.println(y);  
}
 
void ResetKeyboardLog(){
  memset(is_key_pressed, false, 256);
}
 
void  KEY_Press(byte key_index) {
  if(is_key_pressed[key_index] == false) {
      Keyboard.press(key_index);
      is_key_pressed[key_index] = true;
  }
}
 
void KEY_Release(byte key_index){
    Keyboard.release(key_index);
    is_key_pressed[key_index] = false;
}
 
cs

Reviews

Post your review here.

There are no posts to show

Q & A

Product related questions and answers

There are no posts to show

Terms & Policy

  • Payment

    We accept the following forms of payment:
    - Credit Card
      - Visa
      - MasterCard
      - American Express
      - Discover
    - PayPal
  • Shipping

    Shipping Method : Parcel Service

    Shipping Area : A Region.

    Shipping Cost : International Shipping Fee

    Shipping Time : 3 - 5 days

    Please take into consideration that some products may take additional time for delivery and processing.
    Important: Your order is shipped once your payment has been cleared. Please contact our customer service center if you would like to request an exchange or return on your order.

    - Customs and Duties

    The recipient will be held responsible for international shipments which may be subject to import duties and taxes. Please be advised that these charges are levied by the destination country and we do not have control over them. In the case that the recipient refuses to receive the parcel, the order will be returned to Korea and will not be re-shipped. Relevant expenses (round-trip shipping, customs, etc.) will be deducted from the refund.

  • Returns & Exchanges

    1. Requirements:

    Please take into consideration that we only accept qualifying returns but not exchanges. Refunds are issued once the returned products clear our inspection.

    1) An item is eligible for cancellation if:
    -you posted a Return request within 24 hours of payment and your order is still under “Pending” status (if your order is under “Queued for Shipment” status, please contact our customer service center) or
    -the order is delayed for more than 10 days since payment and you have not received any notification regarding the delay; or
    -the ordered item is out of stock.

    2) We accept return(s) if:

    -you receive a product different from your order; or

    -you receive a defective product.

    **Return Instructions

    (1) Post a return request on our Return forum within three days of receipt. You are required to attach the photos of the received product(s) and include the item code, the order number, and the reason for the return.

    (2) A customer service representative will be in contact to assist you by email or phone.

    (3) Items returned must be in their original condition, which includes tags and any packaging. Also, you need to include a note of your order number, name, and user ID.

    *Please be advised that returns are accepted ONLY IF you followed the instructions above and your return request has been approved by our staff. Returns that are shipped to us without any prior consent are not accepted.

    *Please note that EVEN the defective/incorrect item(s) must be returned with all of the tags and labels intact. The item(s) must be sent in their original packaging and unworn.

    *Please include all contents of the original package and free gifts (if applicable) in your return packaging.

    * Shipping fee for any return caused by our fault will be paid by the company. However, if EMS’ cash on delivery is not possible then you can scan the return receipt and either mail it with the item to return or post an image of it on the forum. The shipping fee will be refunded once the returned item has arrived.

    3) We do not accept return(s) if:

    -you are returning the items just because you changed your mind (on size, color, etc.)
    -you are returning shoes, bags, or any other accessories
    -the products are damaged due to your mishandling
    -your return request is not approved by our staff

    The following items are not considered defective:

    * Items that are originally manufactured without tags or labels
    * Items with creases that may have been made while shipping
    * Items with unsatisfactory/incomplete finish due to mass production

    4) If there is a missing item from your order:

    *Contact our customer service center by phone or by forum (if you cannot reach us by phone) within 1 day of delivery.
    *Please keep all contents of the original package including packaging material (boxes, plastic bags etc.) with you until you are instructed otherwise.

    Please note that we may not be able to process the refund for your missing item if you lose or damage any packaging material.

Shop Community

Shop Notice

Shop Notice

MORE

FAQ

FAQ

MORE

sales@mdex.co.kr

  • (+82)32.624.3870
  • FAX
  • AM 09:00 ~PM 05:30 (Holiday weekends off) / Lunch hour PM 12:30 ~PM 01:30
  • INDUSTRIAL BANK OF KOREA
  • ACCOUNT : 614-009295-56-00017
  • SWIFT Code : IBKOKRSE
  • Marveldex Inc.

MORE

BANK INFO

BANKINDUSTRIAL BANK OF KOREA

ACCOUNT614-009295-56-00017

SWIFT CODEIBKOKRSE

CS Center

TEL(+82)32.624.3870

FAX(+82)2.6442.7749

Private Contact