공급사 | 공급사 바로가기 |
---|
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 : | ![]() ![]() |
---|
![]() |
Select quantity
To add product, select an option in the above option box
Product | Quantity | Price |
---|---|---|
Cushion Sensor coding Kit |
![]() ![]() |
66 ( |
Total(Quantity) : 0 (0 item) |
Buy together To purchase, please select the item.
Please see the technical document below. And see the Arduino source code in the bottom of this page
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.
Example 1) Basic, measures sensor values and output to the serialIn case of using Arduino NANO BLE 33, replace A3 with A7 in 16th line. 경우에는 16번째 줄의 'A3'를 'A7'로 바꿔주세요.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 // 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 pinsint 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 enabledint En1 = 6; // Low enabledint 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 bufferconst 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 portfor(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 valueint 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)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 // 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 keychar 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 rowconst int THRESHOLD_SUM_row_3rd = 60; // 3rd row, back rowconst int THRESHOLD_SUM_row_2nd = 105; // 2nd row, left and rightconst int THRESHOLD_SUM_VERT = 60; // SUM? PRESSURE?//----------------------------------------------// Constantconst 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;//----------------------------------------------// variablesint adc_value[32]; // Sensor value packet bufferbool is_key_pressed[256]; // cacheing if pressed.//----------------------------------------------// HW pinsint En0 = 7; // 4 to 16 decoder 0, Low enabledint En1 = 6; // 4 to 16 decoder 1, Low enabledint S0 = 5;int S1 = 4;int S2 = 3;int S3 = 2;int SIG_pin = A3; // common output of two decodervoid 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;if( 0 < 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 : 7int 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, rightif(sum_row_2nd < THRESHOLD_SUM_row_2nd) {KEY_Release(KEY_MAP_COP_right);KEY_Release(KEY_MAP_COP_left);}else {// press leftif(cop_horizon < THRESHOLD_COP_left) {KEY_Release(KEY_MAP_COP_right);KEY_Press(KEY_MAP_COP_left);}// press rightelse if(THRESHOLD_COP_right < cop_horizon) {KEY_Release(KEY_MAP_COP_left);KEY_Press(KEY_MAP_COP_right);}// release left, rightelse {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 pinint 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
Post your review here.
There are no posts to show
Product related questions and answers
There are no posts to show
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.
BANKINDUSTRIAL BANK OF KOREA
ACCOUNT614-009295-56-00017
SWIFT CODEIBKOKRSE
TEL(+82)32.624.3870
FAX(+82)2.6442.7749