Cov txheej txheem:

Tsho Tsho: Lub Sij Hawm Tiag Tiag Wearable Posture Detection: 9 Kauj Ruam
Tsho Tsho: Lub Sij Hawm Tiag Tiag Wearable Posture Detection: 9 Kauj Ruam

Video: Tsho Tsho: Lub Sij Hawm Tiag Tiag Wearable Posture Detection: 9 Kauj Ruam

Video: Tsho Tsho: Lub Sij Hawm Tiag Tiag Wearable Posture Detection: 9 Kauj Ruam
Video: Ib lo lus Remix Dj - Super zab _ Mob lub siab ua luaj no - Nkauj tshiab 2023 2024, Hlis ntuj nqeg
Anonim
Image
Image
Tsho Tsho: Lub Sij Hawm Tiag Tiag Wearable Posture Detection
Tsho Tsho: Lub Sij Hawm Tiag Tiag Wearable Posture Detection

Lub tsho tshaj tawm yog lub sijhawm tiag tiag wireless pom lub cev pom uas xa tawm thiab cais cov ntaub ntawv ntsuas kev ntsuas los ntawm Adafruit Feather mus rau Android daim ntawv thov ntawm Bluetooth. Cov kab ke ua tiav tuaj yeem tshawb pom hauv lub sijhawm tiag tiag yog tias tus neeg siv muaj lub cev tsis zoo thiab tsim kev ceeb toom thawb thaum tus neeg siv pib slouch, kev kuaj pom tseem ua haujlwm thaum taug kev.

Khoom siv

Electronics

1 x Android Smartphone

1 x Adafruit Tsiaj

1 x Lithium Ion Polymer Battery - 3.7v 100mAh (yeem rau kev siv wireless)

2 x ADXL335 triple-axis accelerometer

Khoom siv

Hookup hlau

Yob kab xev

Kauj Ruam 1: Txhim Kho Cov Cai IDEs thiab Cov Tsev Qiv Ntawv

Adafruit Tsiaj

Ua ntej teeb tsa Arduino IDE thiab tom qab ntawd ua raws cov kauj ruam rau nruab Adafruit nRF51 BLE Library

Jupyter Phau Ntawv

Ua ntej teeb tsa Jupyter Phau Ntawv thiab tom qab ntawd cov tsev qiv ntawv xav tau hauv qab no

  • https://scikit-learn.org/stable/
  • https://github.com/nok/sklearn-porter

Hauv

Nruab Android Studio

Txoj Cai Code

Rub tawm txhua txoj haujlwm txoj cai los ntawm GitHub

Kauj Ruam 2: Xaim Cov Accelerometers rau Plaub

Hlau tus Accelerometers mus rau Plaub
Hlau tus Accelerometers mus rau Plaub
Hlau tus Accelerometers mus rau Plaub
Hlau tus Accelerometers mus rau Plaub

Txhawm rau nyeem cov ntaub ntawv tawm ntawm ADXL335s txuas cov hlua txuas rau Vin, hauv av, Xout, Yout, thiab Zout pins. Rau ob qho kev ntsuas nrawm txuas rau lwm qhov kawg ntawm Vin xov hlau rau 3V tus pin ntawm Tsiaj thiab lwm qhov kawg ntawm tus pin hauv av mus rau tus pin hauv av ntawm Tsiaj. Txuas Xout, Yout, thiab Zout xov hlau ntawm thawj qhov ntsuas cua mus rau A0, A1, thiab A2 pins ntawm Tsiaj. Txuas Xout, Yout, thiab Zout xov hlau ntawm qhov ntsuas qhov ntsuas thib ob rau A3, A4, thiab A5 pins ntawm Tsiaj.

Cov ntsuas hluav taws xob tuaj yeem txuas nrog txhua txoj hauv kev tab sis muab cov xov hlau txuas thiab ua kom sov los yog qhwv cov kab xev hluav taws xob nyob ib puag ncig cov ntsiab lus sib txuas tau pom zoo kom tiv thaiv kab mob kis los ntawm kev sib cuag.

Kauj Ruam 3: Txuas Accelerometers rau Tsho

Txuas Accelerometers rau Tsho
Txuas Accelerometers rau Tsho

Siv daim kab xev txuas qhov ntsuas qhov ntsuas mus rau tom qab ntawm lub tsho. Lub ntsuas hluav taws xob txuas mus rau tus pin A0-2 yuav tsum tau muab tso rau hauv kab rov tav nruab nrab ntawm nruab nrab sab nraub qaum. Lub ntsuas cua txuas mus rau tus pin A3-5 yuav tsum tau muab tso rau hauv nruab nrab ntawm nruab nrab ntawm lub caj dab tom qab. Ob lub accelerometers yuav tsum ua kom zoo ib yam li cov pins nyob rau sab hauv qab thiab lub ntsuas yuav tsum tau kaw ncaj thiab ruaj ntseg tiv thaiv lub tsho.

Faj seeb: Rau qhov hnav tau ruaj khov dua cov ntsuas tuaj yeem xaws rau ntawm cov khaub ncaws tab sis lawv yuav tsum tau kaw thiab ntsuas ua ntej kom ntseeg tau tias qhov ntsuas qhov ntsuas tau zoo.

Kauj ruam 4: Khiav Code ntawm Arduino

Khiav Code ntawm Arduino
Khiav Code ntawm Arduino

Txhawm rau pib sau cov ntaub ntawv ntawm Feather pib Arduino IDE thiab qhib cov ntaub ntawv GestureDataSender raws li ntu Arduino ntawm txoj haujlwm txoj haujlwm. Nrog cov ntaub ntawv no qhib teeb tsa lub rooj tsavxwm thiab chaw nres nkoj tau siv thiab tom qab ntawd xaiv "Txheeb Xyuas" thiab "Tshaj Tawm" txhawm rau xa cov lej rau Feather.

Kauj ruam 5: Khiav Code ntawm Android

Khiav Code ntawm Android
Khiav Code ntawm Android

Txhawm rau khiav daim ntawv thov ntawm Android thawj zaug pib Android Studio thiab tom qab ntawd xaiv qhov kev xaiv qhib qhov haujlwm Android uas twb muaj lawm. Nkag mus rau qhov phiaj xwm phiaj xwm thiab xaiv "Android" nplaub tshev. Android Studio yuav siv sijhawm me ntsis los ua cov phiaj xwm phiaj xwm thiab thov thov teeb tsa qee lub tsev qiv ntawv uas xav tau, lees txais cov kev xaiv no. Thaum txoj haujlwm tau npaj tiav ntsaws lub cuab yeej Android rau hauv lub khoos phis tawj thiab xaiv qhov kev xaiv khiav nyob rau sab saum toj ntawm lub qhov rais. Xaiv lub cuab yeej los ntawm qhov hais kom sai uas qhia thiab tom qab ntawd cia daim ntawv thov tsim rau lub cuab yeej.

Kauj Ruam 6: Xeem Bluetooth Teeb Meem Kev Sib Txuas

Kev Xeem Teeb Meem Bluetooth Txuas
Kev Xeem Teeb Meem Bluetooth Txuas
Kev Xeem Teeb Meem Bluetooth Txuas
Kev Xeem Teeb Meem Bluetooth Txuas
Kev Xeem Teeb Meem Bluetooth Txuas
Kev Xeem Teeb Meem Bluetooth Txuas

Thaum lub app tau qhib ua kom ntseeg tau tias lub Plaub Hlis tau qhib thiab tom qab ntawd xaiv Adafruit Bluefruit LE los ntawm cov npe khoom uas tshwm hauv lub xov tooj. Tos rau lub cuab yeej txuas, yog tias kev txuas tsis ua thawj zaug rov txuas dua ua ntej ua lwm yam kev debugging. Tom qab lub cuab yeej tau txuas nrog xaiv tus qauv "Posture Detector" uas yog ua haujlwm tau zoo yuav tso saib daim duab hloov tshiab nyob nrog rau qhov kev kwv yees tam sim no ntawm lub cev thiab txav mus los. Txhawm rau sim tias arduino sib txuas lus cov ntaub ntawv ntsuas kom raug txav ob lub nrawm nrawm hauv cov lus qhia tsis raug thiab txheeb xyuas yog tias txhua txoj kab ntawm kab teeb hloov. Yog tias qee txoj kab nyob tiaj tus tas li kom ntseeg tau tias qhov ntsuas qhov ntsuas tau txuas nrog Fais. Yog tias txhua yam ua haujlwm muab tso rau ntawm lub tsho thiab kuaj pom tias lub cev qoj ib ce zoo yog kwv yees koj lub cev. Nrog koj zoo siab! Koj tau ua tiav teeb tsa kev pom lub cev hnav. Ua mus ntxiv los ntawm cov lus qhia no kom kawm paub yuav tsim koj li ntaub ntawv li cas thiab hloov kho koj tus kheej lub cev kom pom.

Kauj Ruam 7: Sau Koj Cov Ntaub Ntawv

Sau Koj Cov Ntaub Ntawv
Sau Koj Cov Ntaub Ntawv
Sau Koj Cov Ntaub Ntawv
Sau Koj Cov Ntaub Ntawv

Txhawm rau sau koj tus kheej cov ntaub ntawv rov qab mus rau lub vijtsam xaiv tus qauv thiab qhib lub Data Recorder module. Thaum lub vijtsam no tau qhib sau rau hauv daim ntawv lo rau cov ntaub ntawv koj yuav sau; txhawm rau yooj yim cob qhia koj cov ntaub ntawv koj yuav tsum suav nrog lo lus "zoo" nyob rau hauv lub npe ntawm cov kaw lus nrog lub cev zoo thiab "tsis zoo" hauv ib qho kaw nrog lub cev. Txhawm rau pib sau coj mus rhaub khawm "Sau Cov Ntaub Ntawv" thiab ua tiav koj lub hom phiaj, thaum koj ua tiav coj mus rhaub khawm dua kom tiav thiab khaws cov ntaub ntawv. Txhua yam ntawm cov ntaub ntawv kaw tseg yuav muab khaws cia rau hauv daim nplaub tshev hu ua "GestureData" hauv qab cov ntaub ntawv ntawm koj lub kaw lus. Thaum koj ua tiav kaw tag nrho koj cov ntaub ntawv theej cov ntaub ntawv mus rau koj lub computer rau kev qhia ua qauv.

Kauj Ruam 8: Qhia Koj Cov Ntaub Ntawv ntawm Jupyter Notebook

Kev Qhia Koj Cov Ntaub Ntawv ntawm Jupyter Phau Ntawv
Kev Qhia Koj Cov Ntaub Ntawv ntawm Jupyter Phau Ntawv
Kev Qhia Koj Cov Ntaub Ntawv ntawm Jupyter Phau Ntawv
Kev Qhia Koj Cov Ntaub Ntawv ntawm Jupyter Phau Ntawv

Thawj qhov phiaj xwm phiaj xwm muaj cov ntaub ntawv tseem ceeb siv rau kev qhia hauv daim nplaub tshev "cov ntaub ntawv" hauv ntu Jupyter Notebook ntu, rau kev qhia koj tus kheej cov ntaub ntawv tshem tawm txhua cov ntaub ntawv hauv daim nplaub tshev no thiab tom qab ntawd luam koj cov ntaub ntawv rau hauv daim nplaub tshev. Tom qab ntawd khiav Jupyter Notebook thiab qhib "PostureDetectorTrainer.ipynb". Phau ntawv no tau tsim los cais cov ntaub ntawv hauv cov ntawv tais ceev tseg los ntawm qhov ua tau zoo thiab tsis zoo thiab tom qab ntawv qhia kab SVM rau kev faib tawm los qhia tus qauv yooj yim xaiv "Cell" poob qis thiab xaiv "Run All". Phau ntawv yuav siv sijhawm me ntsis los khiav tab sis ib zaug ua tiav mus rau lub ntsiab lus uas muab lub zog kwv yees kwv yees raug rau tus qauv, yog tias qhov raug tsawg koj yuav xav kom ntseeg tau tias koj cov ntaub ntawv kaw yav dhau los yog qhov tseeb thiab zoo ib yam. Yog tias cov txiaj ntsig tau zoo tom qab ntawv mus rau lub cell tom ntej uas chav Java yuav tau tsim. Xaub mus rau hauv qab ntawm lub xovtooj ntawm no kom txog thaum koj pom ib feem tau hais tawm raws li qhov ntsuas. Luam cov txiaj ntsig no raws li koj yuav xav tau lawv hauv qib tom ntej.

Kauj Ruam 9: Hloov Kho Daim Ntawv Thov Android Nrog Tus Qauv Tshiab

Hloov Kho Daim Ntawv Thov Android Nrog Tus Qauv Tshiab
Hloov Kho Daim Ntawv Thov Android Nrog Tus Qauv Tshiab

Txhawm rau hloov tus qauv hauv daim ntawv thov Android siv Android Studio txhawm rau txav mus rau cov ntaub ntawv "PostureDetectorFragment.java" hauv qab ntu java ntawm cov phiaj xwm phiaj xwm. Hauv cov ntawv no nqes mus rau ntu tau hais ua "Tus cwj pwm txawv" uas yuav muaj qhov sib txawv 4 sib txawv raws li 4 tsim hauv Jupyter Notebook. Hloov 4 qhov kev hloov pauv tus nqi nrog qhov tseem ceeb theej los ntawm Jupyter Notebook, ua kom ntseeg tau tias cov npe sib txawv tsis tau hloov pauv los ntawm p_vectors, p_coefficients, thiab lwm yam. ntaus ntawv. Tam sim no ua raws cov theem ib yam li ua ntej qhib lub Posture Detector module thiab koj yuav tsum pom tus neeg cais tam sim no ua haujlwm nrog koj tus qauv kawm tshiab. Yog tias nws tseem tsis zoo li ua tau zoo koj yuav tsum txiav txim siab kaw cov ntaub ntawv ntxiv thiab rov tsim tus qauv. Txwv tsis pub ua kev zoo siab! Tam sim no koj tau xa koj tus kheej kev qhia paub cais tus kheej rau hauv Daim Ntawv Tshaj Tawm!

Pom zoo: