Cov txheej txheem:

Sensors Lab - Temp: 5 Kauj Ruam
Sensors Lab - Temp: 5 Kauj Ruam

Video: Sensors Lab - Temp: 5 Kauj Ruam

Video: Sensors Lab - Temp: 5 Kauj Ruam
Video: DHT11/22 Temp Sensor Trouble - Collin’s Lab Notes #adafruit #collinslabnotes 2024, Kaum ib hlis
Anonim
Sensors Lab - Temp
Sensors Lab - Temp

Hauv chav kuaj no koj yuav siv lub vijtsam LCD los tso saib cov av noo thiab ntsuas kub tam sim no rau ib puag ncig.

Kho vajtse koj yuav xav tau:

  1. Arduino Ib
  2. LCD Screen
  3. Potentiometer
  4. Kub/Vaum ntsuas
  5. Cov qhob cij
  6. Hlau/Txuas

Tsev qiv ntawv xav tau:

  1. Ua kua
  2. SimpleDHT

Txoj cai ntsuas ntsuas tau muab los ntawm Elegoo cov qauv piv txwv. Koj tuaj yeem nruab ib lub tsev qiv ntawv tsim nyog los ntawm tus tswj lub tsev qiv ntawv lossis rub tawm thiab teeb tsa cov ntaub ntawv.zip nyob hauv Libraries.zip ntawm D2L.

Kauj ruam 1: Txuas LCD Screen

Txuas LCD Screen
Txuas LCD Screen

Lub vijtsam LCD yuav xav tau ntxig ncaj qha rau hauv lub khob cij. LCD lub vijtsam pins txuas nrog Arduino raws li kev txiav txim hauv qab no:

  1. Hauv av
  2. Fais fab
  3. Tus Pin 12
  4. Tus pin 11
  5. Tus pin 10
  6. Tus pin 9
  7. Npliag
  8. Npliag
  9. Npliag
  10. Npliag
  11. Tus Pin 8
  12. Hauv av
  13. Pin 7
  14. Potentiometer (Txuas rau lub zog thiab hauv av)
  15. Fais fab
  16. Hauv av

Kauj Ruam 2: LCD Screen - Test Code

#suav nrog // Tshem tawm qhov nruab nrab ntawm

// pib lub tsev qiv ntawv nrog tus lej ntawm tus lej sib cuam tshuam LiquidCrystal lcd (7, 8, 9, 10, 11, 12); void teeb () {// teeb tsa LCD tus lej ntawm kab thiab kab: lcd.begin (16, 2); // Luam tawm cov lus rau LCD. lcd.print ("Nyob Zoo, Ntiaj Teb!"); } void loop () {// teeb tus cursor rau kab 0, kab 1 // (ceeb toom: kab 1 yog kab thib ob, txij li suav pib nrog 0): lcd.setCursor (0, 1); // luam tus lej thib ob txij li rov pib dua: lcd.print (millis () / 1000); }

Kauj Ruam 3: Ntxiv Kub & Vaum Sensor

Ntxiv Kub & Vaum Sensor
Ntxiv Kub & Vaum Sensor

Ntxig qhov ntsuas kub thiab av noo rau hauv daim ntawv tais. Koj yuav tsum txuas nws mus rau Arduino siv cov hauv qab no:

  1. Tus Pin 2
  2. Lub zog (+5v) kev tsheb nqaj hlau
  3. Cov tsheb nqaj hlau

Kauj Ruam 4: Kub & Vaum Sensor - Kuaj Cov Cai

//www.elegoo.com

//2016.12.9 #include // for DHT11, // VCC: 5V or 3V // GND: GND // DATA: 2 int pinDHT11 = 2; SimpleDHT11 dht11; teeb tsa tsis muaj dab tsi () {Serial.begin (9600); } void loop () {// pib ua haujlwm… Serial.println ("================================================="); Serial.println ("Qauv DHT11 …"); // nyeem nrog cov ntaub ntawv piv txwv raw. byte kub = 0; byte av noo = 0; byte cov ntaub ntawv [40] = {0}; yog (dht11.read (pinDHT11, & kub, & av noo, cov ntaub ntawv)) {Serial.print ("Nyeem DHT11 ua tsis tau tejyam"); rov qab; } Serial.print ("Qauv RAW Khoom:"); rau (int i = 0; i 0 && ((i + 1) % 4) == 0) {Serial.print (''); }} Serial.println (""); Serial.print ("Qauv OK:"); Serial.print ((int) kub); Serial.print (" *C,"); Serial.print ((int) cov av noo); Serial.println (" %"); // DHT11 tus qauv piv txwv yog 1HZ. ncua (1000); }

Kauj Ruam 5: Teeb Meem Ua Ke

Koj tau muab cov piv txwv piv rau LCD Screen thiab Kub sensor. Koj cov kauj ruam kawg rau kev sim yog ua ke ob qho piv txwv no kom koj qhov ntsuas kub yuav tshwm ntawm LCD Screen. Koj tuaj yeem hloov cov lus kom nws tuaj yeem tshwm ntawm ob kab uas muaj rau lub vijtsam LCD.

Pom zoo: