Cov txheej txheem:

Txheeb Kev Tawm Tsam Siv Piezoelectric Shock Tap Sensor Module: 6 Cov Kauj Ruam
Txheeb Kev Tawm Tsam Siv Piezoelectric Shock Tap Sensor Module: 6 Cov Kauj Ruam

Video: Txheeb Kev Tawm Tsam Siv Piezoelectric Shock Tap Sensor Module: 6 Cov Kauj Ruam

Video: Txheeb Kev Tawm Tsam Siv Piezoelectric Shock Tap Sensor Module: 6 Cov Kauj Ruam
Video: Xov xwm tshiab : tus yawm txiv no nws qhuaj rau niam tais ntsuab tiag 22 lawm nawb 2024, Kaum ib hlis
Anonim

Hauv qhov kev qhia no peb yuav kawm paub yuav ua li cas txhawm rau txhawm rau txhawm rau kev co siv lub Piezoelectric yooj yim sensor Kev co kev co thiab Visuino.

Saib daim vis dis aus.

Kauj ruam 1: Yam Koj Yuav Tsum Tau

Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
  1. Arduino UNO (lossis lwm yam Arduino)
  2. Piezoelectric shock Shock module
  3. OLED zaub
  4. Jumper xov hlau
  5. Cov qhob cij
  6. Visuino program: Rub tawm Visuino

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit

Txuas Arduino tus pin zoo [5v] rau breadboard kab liab kab tus pin [zoo]

Txuas Arduino tus pin zoo [GND] rau breadboard xiav kab tus pin [tsis zoo]

Txuas Piezo module tus pin [V] rau breadboard tus pin zoo [kab liab]

Txuas Piezo module tus pin [G] rau breadboard tsis zoo tus pin [kab xiav]

Txuas Piezo module pin [DO] rau arduino tus pin [7]

Txuas OLED tus pin [VCC] rau breadboard tus pin zoo [kab liab]

Txuas OLED tus pin [GND] rau breadboard tsis zoo tus pin [kab xiav]

Txuas OLED tus pin [SDA] rau Arduino tus pin [SDA]

Txuas OLED tus pin [SCL] rau Arduino tus pin [SCL]

Kauj Ruam 3: Pib Visuino, thiab Xaiv Arduino UNO Board Type

Pib Visuino, thiab Xaiv Arduino UNO Board Type
Pib Visuino, thiab Xaiv Arduino UNO Board Type
Pib Visuino, thiab Xaiv Arduino UNO Board Type
Pib Visuino, thiab Xaiv Arduino UNO Board Type

Txhawm rau pib ua haujlwm rau Arduino, koj yuav tsum muaj Arduino IDE teeb tsa los ntawm no:

Thov nco ntsoov tias muaj qee qhov teeb meem tseem ceeb hauv Arduino IDE 1.6.6. Nco ntsoov tias koj nruab 1.6.7 lossis siab dua, txwv tsis pub Cov Lus Qhia no yuav tsis ua haujlwm! Yog tias koj tsis tau ua raws cov kauj ruam hauv Phau Ntawv Qhia no teeb tsa Arduino IDE rau program Arduino UNO! Visuino: https://www.visuino.eu tseem yuav tsum tau teeb tsa. Pib Visuino raws li pom hauv thawj daim duab Nyem rau ntawm "Cov cuab yeej" khawm ntawm Arduino tivthaiv (Daim Duab 1) hauv Visuino Thaum qhov kev sib tham tshwm, xaiv "Arduino UNO" raws li qhia hauv daim duab 2

Kauj Ruam 4: Hauv Visuino Ntxiv Cheebtsam thiab Txuas Lawv

Hauv Visuino Ntxiv Cheebtsam thiab Txuas Rau Lawv
Hauv Visuino Ntxiv Cheebtsam thiab Txuas Rau Lawv
Hauv Visuino Ntxiv Cheebtsam thiab Txuas Rau Lawv
Hauv Visuino Ntxiv Cheebtsam thiab Txuas Rau Lawv
Hauv Visuino Ntxiv Cheebtsam thiab Txuas Rau Lawv
Hauv Visuino Ntxiv Cheebtsam thiab Txuas Rau Lawv

Ntxiv Cheebtsam

  1. Ntxiv "ntawv tus nqi" tivthaiv Xaiv "TextValue1" tivthaiv thiab hauv cov khoom qhov rai teeb tsa "Tus nqi" rau "VIBRATION DETECTED"
  2. Ntxiv "Ncua Sijhawm" tiv thaiv hauv cov khoom qhov rai teeb tsa "Interval (uS)" txog 2000000
  3. Ntxiv "SSD1306/SH1106 OLED Display (I2C)" tivthaiv ob npaug nyem rau ntawm "DisplayOLED1" tivthaiv thiab hauv cov ntsiab lus qhov rai luag "Text Field" mus rau sab laug thiab luag "Fill Screen" mus rau sab laug Xaiv ntawm sab laug "Text Field1" thiab hauv Properties window set "Loj" rau 1, "x" rau 0, "y" txog 50

Txuas cov khoom

  1. Txuas Arduino digital pin tawm [7] rau "Text Value1" tiv thaiv tus pin [moos]
  2. Txuas Arduino tus pin tawm [7] rau "Ncua" tivthaiv tus pin [pib]
  3. Txuas "Text Value1" tiv thaiv tus pin [Tawm] rau "DisplayOLED1"> "Text Field1" tus pin [Hauv]
  4. Txuas "Delay1" tus pin [Tawm] rau "DisplayOLED1"> "Sau Screen1" tus pin [Clock]
  5. Txuas "DisplayOLED1" tus pin [Tawm] rau Arduino I2C tus pin [Hauv]

Kauj Ruam 5: Tsim, Ua Ke, thiab Tshaj Tawm Arduino Code

Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code

Hauv Visuino, Nias F9 lossis nyem rau ntawm lub pob uas qhia ntawm daim duab 1 los tsim Arduino code, thiab qhib Arduino IDE

Hauv Arduino IDE, nyem rau ntawm Upload khawm, txhawm rau sau thiab xa cov cai (Daim duab 2)

Kauj ruam 6: Ua si

Yog tias koj ua lub zog Arduino UNO module, thiab co lub piezo sensor koj yuav tsum pom cov lus sau ntawm OLED zaub.

Nrog koj zoo siab! Koj tau ua tiav koj txoj haujlwm nrog Visuino. Kuj txuas nrog yog Visuino project, uas kuv tau tsim rau Cov Lus Qhia no, koj tuaj yeem rub tawm nws ntawm no. Koj tuaj yeem rub tawm thiab qhib nws hauv Visuino:

Pom zoo: