Cov txheej txheem:

Yuav Ua Li Cas Siv DHT12 I2C Vaum thiab Kub Sensor Nrog Arduino: 7 Kauj Ruam
Yuav Ua Li Cas Siv DHT12 I2C Vaum thiab Kub Sensor Nrog Arduino: 7 Kauj Ruam

Video: Yuav Ua Li Cas Siv DHT12 I2C Vaum thiab Kub Sensor Nrog Arduino: 7 Kauj Ruam

Video: Yuav Ua Li Cas Siv DHT12 I2C Vaum thiab Kub Sensor Nrog Arduino: 7 Kauj Ruam
Video: Poj niam yuav ua li cas txiv neej thiaj aim tsi paub dhua li 17/11/2020 2024, Hlis ntuj nqeg
Anonim
Image
Image

Hauv qhov kev qhia no peb yuav kawm paub siv DHT12 I2C Vaum thiab Kub Sensor nrog Arduino thiab tso tawm qhov txiaj ntsig ntawm OLED Zaub.

Saib cov yees duab!

Kauj Ruam 1: Kuv Lwm Txoj Haujlwm

Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi

Thov siv sijhawm me ntsis los tshuaj xyuas kuv lwm Txoj Haujlwm Txias ntawm no

Kauj ruam 2: 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
  • Arduino Uno lossis lwm lub Rooj Tswjhwm Saib Arduino
  • Cov qhob cij
  • Jumper xov hlau
  • OLED Zaub
  • Visuino software: Rub tawm ntawm no

Kauj ruam 3: Circuit Court

Qhov Circuit
Qhov Circuit
  • Txuas DHT12 tus lej zoo + (VCC) rau Arduino tus pin + 5V
  • Txuas DHT12 tus lej tsis zoo - (GND) rau Arduino tus pin GND
  • Txuas DHT12 tus pin (SCL) rau Arduino tus pin (SCL)
  • Txuas DHT12 tus pin (SDA) rau Arduino tus pin (SDA)
  • Txuas OLED Display pin [VCC] rau Arduino tus pin [5V]
  • Txuas OLED Display pin [GND] rau Arduino tus pin [GND]
  • Txuas OLED Display pin [SDA] rau Arduino tus pin [SDA]
  • Txuas OLED Display pin [SCL] rau Arduino tus pin [SCL]

Kauj Ruam 4: 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

Visuino: https://www.visuino.eu tseem yuav tsum tau teeb tsa. Rub tawm Dawb version lossis sau npe rau Kev Sim Dawb.

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 5: Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam

Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
  • Ntxiv "DHT12" tivthaiv
  • Ntxiv "OLED" zaub tivthaiv
  • Ob npaug nias rau ntawm "DisplayOLED1"
  • Hauv cov ntsiab lus qhov rai rub "Text Field" mus rau sab laug
  • Hauv cov khoom qhov rai teeb tsa me me rau 2
  • Hauv lub qhov rai ntsiab lus rub lwm qhov "Text Field" mus rau sab laug
  • Hauv cov khoom vaj khoom tsev teeb tsa qhov loj me rau 2 thiab Y txog 20
  • Kaw lub Elements window
  • Txuas "HumidityThermometer1" tus pin Kub rau "DisplayOLED1"> "Text Field1"
  • Txuas "HumidityThermometer1" tus pin Vaum rau "DisplayOLED1"> "Text Field2"
  • Txuas "HumidityThermometer1" tus pin Sensor I2C rau Arduino board tus pin I2C Hauv
  • Txuas "DisplayOLED1" tus pin I2C Tawm rau Arduino board tus pin I2C Hauv

Kauj Ruam 6: 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 7: Ua si

Yog tias koj ua lub zog Arduino UNO module, OLED Display yuav pib qhia qhov ntsuas kub thiab av noo.

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 Cov Lus Qhia no, koj tuaj yeem rub nws thiab qhib nws hauv Visuino:

Pom zoo: