This shows you the differences between two versions of the page.
pm:prj2023:tmiu:weatherstation [2023/05/28 20:34] yuna.velicu |
pm:prj2023:tmiu:weatherstation [2023/05/30 16:52] (current) yuna.velicu [Rezultate Obţinute] |
||
---|---|---|---|
Line 3: | Line 3: | ||
<note tip> | <note tip> | ||
- | Am ales sa construiesc o Statie Meteorologica care contine ora exacta, senzor de temperatura si umiditate cat si unul de fum cu care voi identifica nivelul de monoxid de carbon din aer. | + | Am ales sa construiesc o Statie Meteorologica care unsenzor de temperatura si umiditate cat si unul de fum cu care voi identifica nivelul de monoxid de carbon din aer. |
</note> | </note> | ||
===== Descriere generală ===== | ===== Descriere generală ===== | ||
Line 9: | Line 9: | ||
<note tip> | <note tip> | ||
- | Pe un display LCD se vor afisa toate valorile senzorilor adica temperatura, ora, nivelul de monoxid de carbon, umiditatea. | + | Pe un display LCD se vor afisa toate valorile senzorilor adica temperatura, nivelul de monoxid de carbon si umiditatea. |
</note> | </note> | ||
Line 15: | Line 15: | ||
===== Hardware Design ===== | ===== Hardware Design ===== | ||
+ | {{:pm:prj2023:tmiu:hardwareyuna.jpeg?300|}} | ||
<note tip> | <note tip> | ||
* Arduino Uno | * Arduino Uno | ||
- | * Real Time Clock | ||
* Senzor Temperatura si Umiditate DHT11 | * Senzor Temperatura si Umiditate DHT11 | ||
* Modul Senzor Detector Aer MQ-135 | * Modul Senzor Detector Aer MQ-135 | ||
* LCD | * LCD | ||
+ | * Modul MH pentru LCD | ||
</note> | </note> | ||
Line 26: | Line 27: | ||
<note tip> | <note tip> | ||
- | Am folosit 4 biblioteci: | + | Am folosit 3biblioteci: |
- | #include <DS1302.h> | + | |
#include <Wire.h> | #include <Wire.h> | ||
#include <LiquidCrystal.h> | #include <LiquidCrystal.h> | ||
Line 38: | Line 39: | ||
- | **to be decided** | + | #include <Wire.h> |
+ | #include <LiquidCrystal_I2C.h> | ||
+ | |||
+ | #include "DHT.h" | ||
+ | #define DHTPIN 5 | ||
+ | |||
+ | #define DHTTYPE DHT11 | ||
+ | |||
+ | int MQ2Pin = A0; | ||
+ | |||
+ | const int en = 2, rw = 1, rs = 0, d4 = 4, d5 = 5, d6 = 6, d7 = 7, bl = 3; | ||
+ | |||
+ | |||
+ | const int i2c_addr = (0x27); | ||
+ | |||
+ | LiquidCrystal_I2C lcd(i2c_addr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE); | ||
+ | |||
+ | DHT dht(DHTPIN, DHTTYPE); | ||
+ | |||
+ | |||
+ | |||
+ | void setup() { | ||
+ | |||
+ | Serial.begin(9600); | ||
+ | lcd.begin(16, 2); | ||
+ | dht.begin(); | ||
+ | |||
+ | |||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | |||
+ | delay(1000); | ||
+ | |||
+ | int MQ2Sensor = analogRead(MQ2Pin); | ||
+ | |||
+ | Serial.print("Pin A0: "); | ||
+ | Serial.println(MQ2Sensor); | ||
+ | lcd.print("Smoke:"); | ||
+ | lcd.print(MQ2Sensor-50); | ||
+ | |||
+ | |||
+ | float h = dht.readHumidity(); | ||
+ | // Read temperature as Celsius (the default) | ||
+ | float t = dht.readTemperature(); | ||
+ | |||
+ | if ( isnan(t) || isnan(h)) { | ||
+ | lcd.clear(); | ||
+ | lcd.setCursor(0, 1); | ||
+ | lcd.print(" ERROR READING "); | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | Serial.print(t); | ||
+ | |||
+ | delay(8000); | ||
+ | lcd.setCursor(4, 0); | ||
+ | lcd.setCursor(0, 1); | ||
+ | |||
+ | lcd.print(h); | ||
+ | lcd.print(" % "); | ||
+ | |||
+ | lcd.print(t); | ||
+ | lcd.print(" C"); | ||
+ | |||
+ | delay(1000); | ||
+ | |||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | |||
</note> | </note> | ||
===== Rezultate Obţinute ===== | ===== Rezultate Obţinute ===== | ||
<note tip> | <note tip> | ||
- | **...** | + | {{:pm:prj2023:tmiu:rezultateyuna.jpeg?300|}} |
</note> | </note> | ||
===== Concluzii ===== | ===== Concluzii ===== | ||
- | **...** | + | <note> |
+ | Am afisat cu succes nivelul de monoxid de carbon, temperatura si umiditatea pe display-ul LCD. | ||
+ | </note> | ||
===== Download ===== | ===== Download ===== | ||
- | {{:pm:prj2023:tmiu:weatherstationyuna.zip|}} | + | <note> |
- | <note warning> | + | |
+ | {{:pm:prj2023:tmiu:pmprojectyunavelicu.zip|}} | ||
</note> | </note> |