Cov txheej txheem:

DIY Shock Sensor Nrog Tus Hais Lus: 5 Kauj Ruam (nrog Duab)
DIY Shock Sensor Nrog Tus Hais Lus: 5 Kauj Ruam (nrog Duab)

Video: DIY Shock Sensor Nrog Tus Hais Lus: 5 Kauj Ruam (nrog Duab)

Video: DIY Shock Sensor Nrog Tus Hais Lus: 5 Kauj Ruam (nrog Duab)
Video: Casio G-Shock Mudmaster против Gulfmaster | G Shock GWG-1000 Mudmaster против G Shock GW... 2024, Hlis ntuj nqeg
Anonim
DIY Shock Sensor Nrog Tus Hais Lus
DIY Shock Sensor Nrog Tus Hais Lus

Tus neeg hais lus ua haujlwm los ntawm kev qhib lub tshuab hluav taws xob uas nyob ze ib qho "niaj hnub" cov hlau nplaum. Qhov no ua rau muaj kev co, ua rau muaj suab nrov. Yog li yog tias tsis hloov tam sim no rau tus hais lus, peb tuaj yeem tsim tam sim no (yog tias tsawg heev) los ntawm kev txav tus hais lus nws tus kheej. Qhov tam sim no tuaj yeem tshawb pom thiab txhais los ntawm microcontroller xws li Arduino.

Kauj Ruam 1: Nrhiav Tus Hais Lus

Nrhiav Tus Hais Lus
Nrhiav Tus Hais Lus
Nrhiav Tus Hais Lus
Nrhiav Tus Hais Lus
Nrhiav Tus Hais Lus
Nrhiav Tus Hais Lus
Nrhiav Tus Hais Lus
Nrhiav Tus Hais Lus

Koj yuav tsum nrhiav tus neeg hais lus uas koj txaus siab txi rau txoj haujlwm no. Koj tuaj yeem yuav ib qho ntawm SparkFun rau hauv qab daus las, tab sis tej zaum koj twb muaj ib qho lawm. Kuv siv tus neeg hais lus me me los ntawm ob lub mloog pob ntseg qub, tab sis koj tuaj yeem pom ib qho yuav luag txhua qhov - zoo li daim npav tos txais suab paj nruag lossis lub tswb qub. Tom ntej:

  1. Txiav ib lub xov hlau jumper hauv ib nrab
  2. Tshem tawm qhov kawg ntawm nws
  3. Muab nws tso rau ntawm tus hais lus (tej zaum twb muaj qee cov xov hlau nyob ntawd - tsuas yog txiav lawv)

Xwb, koj tuaj yeem siv cov kais dej yog tias koj muaj.

Kauj ruam 2: Tsim Circuit Court

Tsim Circuit Court
Tsim Circuit Court

Cov ntaub ntawv xav tau:

  • Arduino UAS
  • Cov qhob cij
  • Jumper xov hlau
  • Ib qho coj (txhua xim)
  • Ob 220 ohm resistors (liab-liab-xim av)
  • Hais lus

Ua raws daim duab saum toj no txhawm rau txuas nws txhua qhov rau Arduino.

Kauj Ruam 3: Upload Cov Cai no

Tshaj tawm cov cai no hauv Arduino IDE. Koj yuav zaum yuav tau ntsuas nws vim tias koj tsis siv tib tus neeg hais lus ib yam li kuv, yog li kuv yuav piav qhia yuav ua li cas hauv ob peb kauj ruam.

tso shockMin = 996; // koj yuav xav hloov cov no

int shockMax = 1010; // koj yuav xav hloov cov teeb tsa no tsis muaj dab tsi () {pinMode (11, OUTPUT); // Serial.begin (9600); // tsis pom zoo qhov no los pab ntsuas ntsuas} void loop () {int poob siab = analogRead (A0); int lightval = daim ntawv qhia (poob siab, poob siab, poob siab, 0, 255); yog (lightval> 0) {analogWrite (11, lightval); } lwm {analogWrite (11, 0); } // Serial.println (poob siab); // tsis pom zoo qhov no los pab ntsuas ntsuas}

Kauj Ruam 4: Yuav Siv Li Cas

Nias ntawm qhov nruab nrab ntawm tus hais lus nrog koj tus ntiv tes thiab nws yuav tsum ua rau lub teeb ntsais. Yog tsis yog, koj yuav tsum tau ntsuas nws hauv cov kauj ruam tom ntej. Txwv tsis pub, koj tuaj yeem sim txuas tus neeg hais lus rau qee yam. Tej zaum koj tuaj yeem ua lub nruas los ntawm coj nws mus rau phaj ntawv? - Sim siv cov xaum qhuav ua cov nruas.

Kauj ruam 5: Calibrate

Yog tias koj tus coj twb tau ntsais muag txaus siab, koj tuaj yeem hla cov kauj ruam no. Txwv tsis pub, ua raws cov theem no:

  1. Rho tawm "//" ntawm kab uas hais tias "// tsis pom zoo qhov no los pab ntsuas"
  2. Tshaj tawm cov cai thiab qhib qhov saib ua ntej
  3. Nias rau ntawm tus neeg hais lus thiab saib raws li qhov txiaj ntsig hloov
  4. Hloov pauv shockMin thiab shockMax hloov pauv mus rau qhov qis thiab siab qhov tseem ceeb hauv kev saib xyuas

ua shockMin = 996;

int shockMax = 1010;

Piv txwv li, yog tias tus lej saib xyuas nyeem 700 raws li lub xeev tsis thawb ntawm koj lub sensor (thaum nws tsuas yog zaum ntawd), thiab thaum koj thawb nws nws nce mus txog 860, hloov lub shockMax mus rau ib puag ncig 900 (tsuas yog me ntsis saum lub sensor nyeem ntawv) thiab shockMin txog li 680. Tom ntej no:

  1. Kaw qhov ntsuas saib
  2. Rub tawm cov cai tshiab
  3. Nias rau ntawm tus neeg hais lus nruab nrab ntxiv

Yog tias txhua yam mus tau zoo, cov coj yuav tsum qhib tsuas yog thaum koj nias lub sensor.

Pom zoo: