Cov txheej txheem:

Visuino Breathalyzer Yuav Siv Li Cas MQ-3 Alcohol Gas Sensor: 8 Kauj Ruam
Visuino Breathalyzer Yuav Siv Li Cas MQ-3 Alcohol Gas Sensor: 8 Kauj Ruam

Video: Visuino Breathalyzer Yuav Siv Li Cas MQ-3 Alcohol Gas Sensor: 8 Kauj Ruam

Video: Visuino Breathalyzer Yuav Siv Li Cas MQ-3 Alcohol Gas Sensor: 8 Kauj Ruam
Video: Yuav ua li cas By Nhia Lor [full version] 2024, Hlis ntuj nqeg
Anonim

Hauv qhov kev qhia no peb yuav siv Arduino UNO, OLED Lcd, MQ-3 Alcohol Gas Sensor module, thiab Visuino los tso saib cov cawv nyob ntawm Lcd thiab teeb tsa kev txwv. 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

Arduino UNO lossis lwm yam Arduino

MQ-3 Alcohol Gas Sensor module

OLED Lcd

Cov qhob cij

Jumper xov hlau

Visuino program: Rub tawm Visuino

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit

Txuas GND los ntawm Arduino UNO rau tus pin breadboard (gnd)

Txuas 5V tus pin los ntawm Arduino UNO mus rau lub khob cij pin (zoo)

Txuas SCL los ntawm Arduino UNO rau OLED LCD tus pin (SCL)

Txuas SDA los ntawm Arduino UNO rau OLED LCD tus pin (SDA)

Txuas OLED LCD tus pin (VCC) mus rau tus pin breadboard (zoo)

Txuas OLED LCD tus pin (GND) rau tus pin breadboard (GND)

Txuas MQ-3 Alcohol Gas Sensor module tus pin (VCC) mus rau lub khob cij pin (zoo)

Txuas MQ-3 Alcohol Gas Sensor tus pin (GND) rau tus pin breadboard (GND)

Txuas MQ-3 Alcohol Gas Sensor module tus pin (A0) rau Arduino UNO tus pin Analog (1)

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 Cov Lus Qhia no teeb tsa Arduino IDE rau program ESP 8266! Visuino: https://www.visuino.eu kuj 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

Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
  • Ntxiv 2X "Cov Ntawv Sau Tus Nqi" tivthaiv
  • Ntxiv 2X "Sib Piv Tus Nqi" tivthaiv
  • Ntxiv Zaub OLED I2C tivthaiv
  • Ntxiv "Text Multi Merger" tivthaiv
  • Ntxiv "Lub Sijhawm Nruab Nrab" tivthaiv

Kauj Ruam 5: Hauv Visuino: Teem Cheebtsam

Hauv Visuino: Teem Cheebtsam
Hauv Visuino: Teem Cheebtsam
Hauv Visuino: Teem Cheebtsam
Hauv Visuino: Teem Cheebtsam
Hauv Visuino: Teem Cheebtsam
Hauv Visuino: Teem Cheebtsam
  • teeb cov ntawv sau ntawm "TextValue1" tivthaiv rau "qaug cawv heev!"
  • teeb cov ntawv sau ntawm "TextValue2" tivthaiv rau "Ok"
  • teeb tus nqi ntawm "CompareValue1" tivthaiv rau "0.3" >> Qhov no yog qhov ntsuas pom, koj tuaj yeem teeb tsa koj tus kheej tus nqi
  • teeb tus nqi ntawm "CompareValue2" tivthaiv rau "0.3" >> Qhov no yog qhov ntsuas pom, koj tuaj yeem teeb tsa koj tus kheej tus nqi
  • teeb tsa CompareType ntawm "CompareValue1" tivthaiv rau "ctBiggerOrEqual"
  • teeb tsa CompareType ntawm "CompareValue2" tivthaiv rau "ctSmaller"
  • teeb Lub Sijhawm ntawm "AveragePeriod1" tivthaiv rau "500000" qhov no yog sib npaug 0.5 ntawm ib pliag, nws txhais tau tias LCD yuav qhia vlue txhua 0.5s

Ob npaug nyem rau ntawm DisplayOled1 tivthaiv

  • ntxiv Kos cov ntawv rau sab laug thiab teeb cov ntawv rau "Alc Level:"
  • ntxiv 2X Text field rau sab laug (saib daim duab) thiab teeb Y: 20 rau "text field1" thiab y: 40 rau "text field2"

Kauj Ruam 6: Kauj Ruam 5: hauv Visuino: Txuas Cov Khoom Siv

Kauj Ruam 5: hauv Visuino: Txuas Cov Khoom Siv
Kauj Ruam 5: hauv Visuino: Txuas Cov Khoom Siv
  • Txuas DisplayOled1 tus pin [Tawm I2c] rau Arduino I2C tus pin [hauv]
  • Txuas Arduino Analog tus pin tawm [1] rau Nruab NrabPeriod1 tus pin [hauv] thiab CompareValue1 tus pin [hauv] thiab CompareValue2 tus pin [hauv]
  • Txuas AveragePeriod1 tus pin [tawm] rau OLED elkements Text Field1 tus pin [hauv]
  • Txuas CompareValue1 tus pin [tawm] rau TextValue1 tus pin [moos]
  • Txuas CompareValue2 tus pin [tawm] rau TextValue2 tus pin [moos]
  • Txuas TextValue1 tus pin [tawm] rau TextMultiMerger1 tus pin [0]
  • Txuas TextValue2 tus pin [tawm] rau TextMultiMerger1 tus pin [1]
  • Txuas TextMultiMerger1 tus pin [tawm] rau OLED cov ntsiab lus Text Field2 tus pin [hauv]

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

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

Hauv Visuino, hauv qab nyem rau ntawm "Tsim" Tab, xyuas kom tseeb tias qhov chaw nres nkoj raug xaiv, tom qab ntawd nyem rau ntawm "Compile/Build and Upload" khawm.

Kauj ruam 8: Ua si

Yog tias koj siv zog Arduino UNO module, OLED Lcd yuav pib qhia tus nqi ntawm MQ-3 Alcohol Gas Sensor. Yog tias koj tso Alcohol swab lossis Alcohol ze rau lub sensor nws yuav qhia tus nqi ntawm lub LCD.

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

Pom zoo: