Product Details

Back

Cushion Sensor coding Kit

New

Product Info
Price 66
Discounted Price $66.00 ($66.00 discount)
Discounted Amount Total Discounted Amount KRW
(Mobile Purchase Discount KRW )
Reward Points

$0(0%)

Reward points from Payment by Wire Transfer without Bankbook KRW %

Reward points from Payment by Credit Card KRW %

Reward points from Payment by Reward Points KRW %

Reward points from Payment by Reward Points KRW %

Reward points from Payment by Mobile Phone KRW %

Reward points from Payment by Store Credits KRW %

Reward points from Payment by Escrow KRW 0 %

Reward points from Payment by Virtual Account KRW 0 %

Reward points from Payment by Virtual Account KRW %

Shipping Method Parcel Service
Shipping Cost International Shipping Fee
Description
Shipping
Quantity up down  

Buy togehter

  • Seat sensor (mdxs-16-5610)

    $47.14

    Product Option
    Select Product
  • 아두이노용 방석 센서 쉴드

    $9.43

    Product Option
    Select Product
Product List
Product Info Product Remove
Total(Qty) 0

Discounted amount of your subtotal will appear when you place your orders.

CheckoutBackorder
CheckoutBackorder



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


Link1) Archive,  Technical document(English) -Manual, CAD, ...

Link2) Mirror - BOX.COM - Manual, CAD, ... (You don't need to login or signup)





















Processing(https://processing.org/) - shows color map, COM(Center of Mass) gauge bar.
This SW displays 2 gauge bar. 1 for X direction(grey bar at just beneath the row 1) and 1 for Y (the most left grey bar)









Example 1) Basic, measures sensor values and output to the serial
In case of using Arduino NANO BLE 33, replace A3 with A7 in 16th line.  경우에는 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



Example 2) Keyboard mapping. Making keyboard arrow key signal according to the COP (Center of Pressure)
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
262
//    Seat cushion sensor keypad Ver 180712
//  Contact : sales@mdex.co.kr , Marveldex
//  Sitting and move forth, back, left, right then it makes keyboard event.
//  Change CONFIGURATION 1, 2 to make your event. 
 
#include "Keyboard.h"
 
 
//----------------------------------------------
//  CONFIGURATION 1 - Keymap) Arrow key
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; // →
 
//----------------------------------------------
//  CONFIGURATION 2 - Keymap) for FPS shooting game
//char KEY_MAP_row_1st   = 'w';
//char KEY_MAP_row_3rd   = 's';
//char KEY_MAP_COP_left  = 'a';
//char KEY_MAP_COP_right = 'd';
 
//  Function keys :  https://www.arduino.cc/reference/en/language/functions/usb/keyboard/keyboardmodifiers/
//  Ascii keys : http://www.asciitable.com/ 
 
//----------------------------------------------
//  CONFIGURATION 3 - Pressure threshold to make key event. the value in the cop range (-1.0 ~ 1.0)
//        If the value is bigger than the threshold, the key will be pressed. 
const float THRESHOLD_COP_forth   = 0.3;    // Make key event when COP Y is bigger than this value.
const float THRESHOLD_COP_back    = -0.85;  // Make key event when COP Y is smaller than this value.
const float THRESHOLD_COP_left    = -0.22;  // Make key event when COP X is smaller than this value.
const float THRESHOLD_COP_right   = 0.22;   // Make key event when COP X is bigger than this value.
 
//----------------------------------------------
//  CONFIGURATION 4 - Threshold to ignore. If the sum value is lower than this threshold, then ignore.
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?
 
//----------------------------------------------
//  Constant
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;
 
 
 
//----------------------------------------------
//  variables
int adc_value[32]; // Sensor value packet buffer
bool is_key_pressed[256];  // cacheing if pressed.
 
//----------------------------------------------
//  HW pins
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);
  }
 
 
  /*
   *    Sensor index.
   *    Sensor position and index.
   *    For example, adc_value[14], position is 3rd of 1st row.
   *    adc_value[2] is 3rd of 3rd row.
   *    adc_value[5] is 1st of 2nd row.
   *  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
   *
   *    COP of X is calculated by the 2nd row values.
   *    COP of Y is calculated by the 1st and 3rd row values.
   */
 //---------------------------------------------------------
 //     Calculate COP Y by 1st, 3rd row
 //---------------------------------------------------------
  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;
 
  float cop_vertical = 0.0;
  if0 < sum_vertical) {
    cop_vertical = (avg_row_1st * (1+ avg_row_3rd * (-1)) / (avg_row_1st + avg_row_3rd);
  }
 
  //  Make key event. 
  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);
    }
  }
 
 //---------------------------------------------------------
 //     Calculate COP X by 2nd row
 //---------------------------------------------------------
  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];
 
  //  Normalize to -1.0~1.0
  //  Normalized COP = SUM {Position x adc_value[i]} / (SUM[adc_value] x Half length)
  //  X Position : -7~7, Half length : 7
  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;
  if(0 < sum_row_2nd) {
    cop_horizon = sum_wp_horizon / (double)sum_row_2nd;
  }
 
  //  Make key event - left, right
  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
  //  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, false256);
}
 
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



Product Details
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
수량 수량증가수량감소

Payment

Shipping

  • Shipping Method : Parcel Service
  • Shipping Area : A Region.
  • Shipping Cost : International Shipping Fee
  • Shipping Time : 3 - 5 days
  • About Shipping :

Returns/Exchanges

Product Inquiry

Product Reviews

Post Your Review See All

There are no posts to show

상품 Q&A

Product Inquiry See All

There are no posts to show

Seller Info

Related Items


WORLD SHIPPING

PLEASE SELECT THE DESTINATION COUNTRY AND LANGUAGE :

GO
close
Top