Cov txheej txheem:

Wearable Tech: Hnab-Hloov Hnab Hnab: 7 Kauj Ruam
Wearable Tech: Hnab-Hloov Hnab Hnab: 7 Kauj Ruam

Video: Wearable Tech: Hnab-Hloov Hnab Hnab: 7 Kauj Ruam

Video: Wearable Tech: Hnab-Hloov Hnab Hnab: 7 Kauj Ruam
Video: Teb Hmoobli Txuj & hais rau Jee Lor 1/5/2022 2024, Hlis ntuj nqeg
Anonim
Wearable Tech: Hnab-Hloov Hnab Hnab
Wearable Tech: Hnab-Hloov Hnab Hnab
Wearable Tech: Hnab-Hloov Hnab Hnab
Wearable Tech: Hnab-Hloov Hnab Hnab

Zoo, nws zoo li hnab looj tes nrog lub zog zoo kawg yog txhua qhov npau taws niaj hnub no. Thaum Thanos 'Infinity Gauntlet yog lub hnab looj tes muaj zog zoo nkauj, peb xav ua lub hnab looj tes uas tuaj yeem ua qee yam tseem ceeb tshaj plaws: hloov tus neeg hnav lub suab hauv lub sijhawm.

Cov Lus Qhia no muab cov lus qhia yuav ua li cas peb tsim lub hnab looj tes-hloov lub suab. Peb tsim qauv siv ntau yam ntsuas thiab lub microcontroller hauv hnab looj tes txhawm rau txheeb xyuas cov lus tsa suab, uas tau xa los ntawm tus lej Arduino mus rau Max thaj, qhov uas peb lub suab tau hloov pauv thiab cuam tshuam hauv kev lom zem. Cov cuab yeej tshwj xeeb, cov lus tsa suab, thiab kev hloov suab uas peb siv yog txhua yam hloov pauv rau kev txiav txim siab sib txawv; qhov no tsuas yog ib txoj hauv kev los tsim lub hnab looj tes-hloov lub suab!

Txoj haujlwm no yog ib feem ntawm kev koom tes hauv zej zog ntawm Pomona College cov tub ntxhais kawm thiab Fremont Academy of Engineering Femineers. Nws yog kev lom zem tiag tiag sib xyaw ntawm cov tshuab hluav taws xob thiab cov khoom siv suab paj nruag!

Kauj ruam 1: Cov ntaub ntawv

Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv

Qhov:

  • HexWear Microcontroller (ATmega32U4) (https://hexwear.com/)
  • MMA8451 Accelerometer (https://www.adafruit.com/product/2019)
  • Luv Flex Sensors (x4) (https://www.adafruit.com/product/1070)
  • Hnav looj hnab looj tes
  • #2 ntsia hlau thiab tshuab ntxhua khaub ncaws (x8)
  • Crimp davhlau ya nyob twg txuas; 22-18 ntsuas (x8) (https://www.elecdirect.com/crimp-wire-terminals/ring-crimp-terminals/pvc-ring-terminals/ring-terminal-pvc-red-22-18-6- 100 hli)
  • 50kΩ resistor (x4)
  • Hlau (~ 20 ntsuas)
  • Tus kheej-nplaum kev nyab xeeb tus pin
  • Felt los yog lwm cov ntaub (~ 10 sq. Nyob rau hauv.)
  • Xaws xov
  • Zipties
  • Laptop
  • USB Microphone

Cov cuab yeej

  • Cov khoom siv Soldering
  • Cov hlua hluav taws xob thiab cov hlau txiav
  • Daim kab xev hluav taws xob
  • Phom cua kub
  • Ntsia Hlau
  • Txiab
  • Xaws koob

Software:

  • Max by Cycling '74 (https://cycling74.com)
  • Arduino software (https://www.arduino.cc/en/Main/Software)

Kauj ruam 2: Txhim Kho Software

Peb tau pib nrog dab tsi yog qhov txaus siab tshaj plaws ntawm ib qhov haujlwm: txhim kho cov tsev qiv ntawv (thiab ntau dua).

Arduino:

Rub tawm thiab teeb tsa Arduino software (https://www.arduino.cc/en/Main/Software).

HexWear:

1) (Windows nkaus xwb, Mac cov neeg siv tuaj yeem hla cov kauj ruam no) Nruab tus tsav tsheb los ntawm kev mus xyuas https://www.redgerbera.com/pages/hexwear-driver-installation. Rub tawm thiab teeb tsa tus tsav tsheb (cov ntaub ntawv.exe teev rau ntawm Kauj Ruam 2 nyob rau sab saum toj ntawm nplooj ntawv RedGerbera txuas).

2) Txhim kho lub tsev qiv ntawv xav tau rau Hexware. Qhib Arduino IDE. Hauv qab "File" xaiv "Preferences." Hauv qhov chaw muab rau Tus Thawj Saib Xyuas Ntxiv URLs, muab tshuaj txhuam

github.com/RedGerbera/Gerbera-Boards/raw/master/package_RedGerbera_index.json.

Tom qab ntawd nyem "OK."

Mus rau Cov Cuab Yeej -> Pawg Thawj Coj: -> Tus Thawj Saib Xyuas Haujlwm. Los ntawm cov ntawv qhia zaub mov sab laug sab saud, xaiv "Koom Nrog."

Tshawb nrhiav, thiab tom qab ntawd nyem rau ntawm Gerbera Boards thiab nyem Nruab. Tawm thiab rov qhib Arduino IDE.

Txhawm rau kom ntseeg tau tias lub tsev qiv ntawv tau teeb tsa kom raug, mus rau Cov Cuab Yeej -> Pawg Thawj Coj, thiab nqes mus rau hauv qab ntawm cov ntawv qhia zaub mov. Koj yuav tsum pom ntu ntu hu ua "Gerbera Boards," nyob rau hauv uas yuav tsum muaj tsawg kawg tshwm sim HexWear (yog tias tsis muaj cov laug cam ntau dua li mini-HexWear).

Accelerometer:

Rub tawm thiab teeb tsa lub tsev qiv ntawv accelerometer (https://learn.adafruit.com/adafruit-mma8451-accelerometer-breakout/wiring-and-test)

Kauj Ruam 3: Txuas tus Accelerometer

Txuas tus Accelerometer
Txuas tus Accelerometer
Txuas tus Accelerometer
Txuas tus Accelerometer

Peb xav tau ob hom tseem ceeb ntawm kev ntsuas txhawm rau txhawm rau cuam tshuam nrog txoj haujlwm no: tus ntsuas hluav taws xob, thiab hloov lub ntsuas pa. Peb yuav tshuaj xyuas cov no ib zaug, pib nrog lub ntsuas cua. Ua ntej, peb xav tau kev sib txuas kho vajtse kom sib phim.

Txhawm rau kom zam kev puas tsuaj rau koj Hex, peb pom zoo tso tus #2 ntsia hlau thiab tshuab ntxhua khaub ncaws los ntawm cov chaw nres nkoj xav tau, tom qab ntawd txuas txhua qhov txuas mus rau cov ntsia hlau ntawd. Txhawm rau tiv thaiv ib yam dab tsi los ntawm kev xoob thaum ua si nrog lub hnab looj tes, kev sib txuas yuav tsum tau muab muag thiab/lossis raug kaw. Siv ob peb ntiv tes ntawm xaim rau txhua qhov txuas, ua cov txuas hauv qab no los ntawm Hex mus rau lub ntsuas cua (saib cov pinouts saum toj no rau siv)

INPUT VOLTAGE VINGROUND GNDSCL/D3 SCLSDA/D2 SDA

Nrog txhua yam txuas nrog, peb tau npaj los sim!

Raws li kev sim, khiav tus qauv ntsuas tus lej hauv Arduino (Cov Ntaub Ntawv-> Piv txwv-> Adafruit_MMA8451-> MMA8451demo), ua kom ntseeg tau tias nws tuaj yeem tso tawm rau Serial monitor. Nws yuav tsum tso tawm qhov nrawm vim lub ntiajteb txawj nqus (~ 10m/s) hauv z kev qhia thaum tuav qib. Los ntawm kev ntsuas lub ntsuas qhov ntsuas, qhov ntsuas nrawm no yuav ntsuas hauv x lossis y kev taw qhia; peb yuav siv qhov no los tso cai rau tus neeg hnav hloov lub suab los ntawm kev tig lawv txhais tes!

Tam sim no, peb yuav tsum nthuav qhia cov ntaub ntawv ntsuas nrawm hauv txoj hauv kev uas nws tuaj yeem cuam tshuam nrog Max. Txhawm rau ua li ntawd, peb yuav tsum luam qhov tseem ceeb ntawm x thiab y, tej zaum hloov kho kom haum rau qhov xav tau ntau yam (saib Ntu 6). Hauv peb cov lej txuas ntawm no, peb ua cov hauv qab no:

// Ntsuas qhov taw qhia thiab y-kev taw qhia. Peb faib thiab sib npaug kom nkag mus rau qhov raug rau MAX (thaj tsam ntawm 1000 hauv x thiab thaj tsam ntawm 40 hauv y) xdir = event.acceleration.x/0.02; ydir = abs (event.acceleration.y)*2; // Luam txhua yam hauv hom ntawv nyeem tau rau Max - nrog qhov chaw nruab nrab ntawm txhua tus lej Serial.print (xdir); Serial.print ("");

Qhov no yuav tsum muaj Hex luam ntawv hloov pauv qhov tseem ceeb ntawm x thiab y cov lus qhia ntawm tus ntsuas kev ntsuas txhua kab. Tam sim no peb tau npaj los ntxiv cov ntsuas hloov pauv!

Kauj Ruam 4: Txuas lub Flex Sensors

Txuas cov Flex Sensors
Txuas cov Flex Sensors
Txuas cov Flex Sensors
Txuas cov Flex Sensors
Txuas cov Flex Sensors
Txuas cov Flex Sensors

Tus neeg hnav tuaj yeem tau txais ntau qhov muaj peev xwm tswj tau lub suab yog tias peb tuaj yeem txheeb xyuas cov ntiv tes khoov. Flex sensors yuav ua li ntawd. Txhua qhov ntsuas qhov hloov pauv yog qhov tseem ceeb ntawm lub zog, qhov uas tsis muaj zog muaj qhov ua haujlwm ntawm ~ 25KΩ, thaum lub zog tag nrho muaj qhov ua haujlwm ntawm ~ 100KΩ. Peb muab txhua lub ntsuas hluav taws xob hloov pauv hauv qhov sib faib hluav taws xob yooj yim nrog 50K resistor, raws li pom hauv thawj daim duab.

Ib zaug ntxiv siv qhov ntev ntev ntawm cov xov hlau (nco ntsoov qhov no txhua yam yuav haum rau sab nraum qab ntawm lub hnab looj tes), muab tshuaj txhuam plaub qhov hluav taws xob faib cov qauv. Plaub qhov qauv yuav faib tib Vin thiab hauv av-peb sib dhos ua ke qhov xaus ntawm cov xov hlau yog li peb yuav tsuas yog ib qho ua rau cov laug. Thaum kawg, coj plaub tus qauv thiab ua qhov sib txuas uas pom hauv daim duab thib ob (yog tias leej twg paub yuav ua li cas yam no yam tsis ua rau muaj kev ntxhov siab txaus ntshai, thov qhia koj qhov kev zais).

Tam sim no, peb xav tau Arduino code los nyeem hauv qhov hluav taws xob los ntawm txhua lub ntsuas. Rau peb lub hom phiaj, peb tau kho cov teeb meem hloov pauv raws li hloov pauv; lawv nyob los yog tawm. Raws li xws li, peb cov cai yooj yim teeb tsa qhov ntsuas hluav taws xob-siab dua qhov pib no, peb tso tawm 1 rau Serial chaw nres nkoj (txhais tau tias lub ntsuas cua tau khoov), txwv tsis pub peb tso tawm 0:

// Siv tus lej

cov qauv piv txwv thiab ntxiv rau txhua qhov Flex sensor

thaum (sample_count <NUM_SAMPLES) {

sum10 += analogRead (A10);

sum9 += analogRead (A9);

sum7 += analogRead (A7);

sum11 += analogRead (A11);

sample_count ++;

// Kev ncua sijhawm luv kom tsis txhob coj lawv mus nrawm

ncua (5);

}

// xam qhov hluav taws xob, qhov nruab nrab hla cov qauv nrawm

// siv 5.0 rau 5.0V ADC

siv qhov hluav taws xob

// 5.015V yog qhov ntsuas

siv qhov hluav taws xob

voltage10 = ((ntab) sum10 /

(ntab) NUM_SAMPLES * 5.015) / 1024.0;

voltage9 = ((ntab) sum9/

(ntab) NUM_SAMPLES * 5.015) / 1024.0;

voltage7 = ((ntab) sum7 /

(ntab) NUM_SAMPLES * 5.015) / 1024.0;

voltage11 = ((ntab) sum11 /

(ntab) NUM_SAMPLES * 5.015) / 1024.0;

// Txheeb xyuas yog tias txhua lub sensor hloov pauv

yog ntau dua qhov pib (pib) - yog tias muaj, teeb tus lej

// Pinkie ntiv tes

yog (voltage10> pib)

{

//-5 kom nce

suab suab los ntawm ib lub octave

flex10 = -10;

}

lwm flex10 = 0;

Ntiv ntiv tes

yog (voltage9>

(pib-0.4)) {

// 5 to qis

suab suab los ntawm ib lub octave

flex9 = 5;

}

lwm flex9 = 0;

Cov ntiv tes nruab nrab

yog (voltage7> pib) {

// 1 rau set

reverb nyhuv

flex7 = 1;

}

lwm flex7 = 0;

// Ntsia tus ntiv tes

yog (voltage11> pib)

{

// 50 teev

cycles rau 50

flex11 = 93;

}

lwm flex11 = 0;

// Pib dua txhua qhov suav

hloov mus rau 0 rau lub voj tom ntej

qauv_count = 0;

sum10 = 0;

sum9 = 0;

sum7 = 0;

sum11 = 0;

Txog tam sim no, Serial chaw nres nkoj yuav tsum qhia qhov muaj txiaj ntsig rau kev ntsuas kev ntsuas nrawm, thiab tseem seb puas yog txhua qhov ntsuas qhov ntsuas tau khoov. Peb tau npaj kom tau txais peb cov cai Arduino tham nrog Max!

Kauj Ruam 5: Sib cuam tshuam nrog Max

Kev cuam tshuam nrog Max
Kev cuam tshuam nrog Max

Tam sim no tias Hex code tau spitting ntau tus lej los ntawm Serial chaw nres nkoj, peb xav tau Max software los nyeem cov cim no. Qhov thaiv ntawm cov duab uas tau hais los saum toj no tsuas yog qhov ntawd! Koj zoo siab heev.

Nco tseg tseem ceeb: tom qab xa cov cai mus rau Hex, kaw tawm ntawm txhua qhov chaw nres nkoj qhov rooj, tom qab ntawd hloov daim ntawv uas muaj kab nyob hauv Max code kom phim Hex chaw nres nkoj. Yog tias koj tsis paub meej tias yuav sau tsab ntawv twg, nias "luam tawm" ib feem ntawm Max code yuav teev txhua qhov chaw txuas.

Cov kab ntawv luam tawm los ntawm Hex qhov chaw nres nkoj txuas tau nyeem los ntawm Max code thaiv, thiab tom qab ntawd sib cais raws qhov txwv qhov chaw. Qhov tso tawm qhov kawg ntawm Max thaiv tso cai rau koj rub txhua tus lej ib tus zuj zus, yog li peb yuav txuas thawj qhov chaw tso tawm mus rau qhov chaw uas peb xav tau x kev taw qhia ntawm lub ntsuas cua mus, qhov chaw thib ob yuav yog y taw qhia, thiab lwm yam. tam sim no, tsuas yog txuas cov no rau tus lej naj npawb kom ntseeg tau tias lawv ua haujlwm. Koj yuav tsum muaj peev xwm txav tau lub nrawm thiab ntsuas lub zog thiab pom cov lej hloov pauv hauv Max software.

Kauj Ruam 6: Txhim Kho Qhov Tseeb ntawm Max Code

Muab lub zog ntawm Max cov lus, koj tuaj yeem cia koj lub tswv yim khiav qus nyob ntawm no nrog txhua txoj hauv kev koj tuaj yeem hloov pauv lub suab nkag los nrog koj lub hnab looj tes muaj hwj chim. Tseem, yog tias koj tawm ntawm cov tswv yim, saum toj no yog rundown ntawm qhov peb Max code ua thiab nws ua haujlwm li cas.

Rau txhua qhov ntsuas uas koj tab tom sim hloov pauv, koj yuav zaum xav tsis thoob nrog qhov ntau ntawm qhov muaj txiaj ntsig los ntawm Arduino code kom tau txais kev nkag siab raug.

Qee lwm cov lus qhia daws teeb meem Max:

  • Yog koj tsis hnov suab

    • kom ntseeg tau tias Max tau teeb tsa kom tau txais lub suab los ntawm koj lub microphone (Options Audio Status Input Device)
    • xyuas kom tus tswv Volume slider hauv Max tau qhib, thiab lwm yam ntim tswj koj tuaj yeem muaj hauv koj cov cai
  • Yog tias txoj cai tsis zoo li yuav ua dab tsi

    • xyuas kom koj thaj raug xauv (ntsuas lub cim nyob rau sab laug sab laug)
    • xyuas ntawm kev nyeem hauv Max thaj uas koj Max thaj tseem tau txais cov ntaub ntawv los ntawm Arduino cov chaw nres nkoj. Yog tias tsis yog, sim rov pib dua qhov chaw nres nkoj txuas (raws li tau hais tseg hauv Kauj Ruam 5) thiab/lossis tshuaj xyuas koj lub cev txuas hluav taws xob.
  • Weird clipping nrov thaum hloov tsis

    qhov no yog qee yam ua nrog yuav ua li cas ~ tapin thiab ~ tapout ua haujlwm; tshwj xeeb tshaj yog thaum koj hloov lawv qhov txiaj ntsig, lawv rov pib dua, uas ua rau clipping. Muab peb qhov kev paub tsawg ntawm txoj haujlwm, peb yuav luag paub tseeb tias muaj txoj hauv kev zoo dua los ua qhov no hauv Max thiab tshem tawm qhov teeb meem …

Kauj Ruam 7: Muab tso ua ke tag nrho

Lus Tso Nws Tag Nrho Ua Ke
Lus Tso Nws Tag Nrho Ua Ke
Lus Tso Nws Tag Nrho Ua Ke
Lus Tso Nws Tag Nrho Ua Ke
Lus Tso Nws Tag Nrho Ua Ke
Lus Tso Nws Tag Nrho Ua Ke
Lus Tso Nws Tag Nrho Ua Ke
Lus Tso Nws Tag Nrho Ua Ke

Txhua yam uas tseem tshuav tam sim no yog txhawm rau txuas peb lub xov tooj cua mus rau peb lub hnab looj tes. Nqa koj cov ntaub ntxiv thiab txiav tawm cov kab me me me me dua li cov khoom siv hloov pauv. Xaws cov ntaub ntxiv rau tus ntiv tes ntawm lub hnab looj tes qhov twg khoov tes, tawm ntawm lub tes tsho rau lub flex sensor los zaum hauv (peb tsis tuaj yeem tsuas yog lo lub flex sensors ncaj qha mus rau lub hnab looj tes vim tias cov hnab looj tes nthuav tawm raws li cov ntiv tes khoov). Thaum lub tes tsho feem ntau yog xaws, xaub lub flex sensor nyob rau hauv, thiab ua tib zoo xaws cov coj mus rau lub hnab looj tes, kho lub flex sensor nyob rau hauv qhov chaw. Rov ua qhov no rau txhua qhov kev hloov pauv sensor.

Tom ntej no, siv tus pin tus kheej tus kheej txhawm rau txhawm rau txhawm rau Hex rau sab nraum qab ntawm lub hnab looj tes (koj yuav xav muab qee cov kua nplaum kub tso rau ntawm tus pin kom ntseeg tau tias nws tsis tuaj yeem rov ua dua thaum hnav). Xaws lub accelerometer rau lub dab teg ntawm lub hnab looj tes. Thaum kawg, siv cov khawv koob ntawm zip-sib txuas kom zoo nkauj tu ib qho xov tsis zoo.

Koj tau npaj los muab koj lub hnab looj tes zoo tshaj plaws rau kev xeem! (Thov kom peb pom zoo rau Daft Punk's "Harder Better Faster Stronger" kom ua tiav qhia tawm koj lub peev xwm hloov pauv lub suab)

Pom zoo: