This shows you the differences between two versions of the page.
|
pm:prj2023:tmiu:weatherstation [2023/05/07 21:36] yuna.velicu created |
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> | ||
| - | Descrierea codului aplicaţiei (firmware): | + | Am folosit 3biblioteci: |
| + | |||
| + | #include <Wire.h> | ||
| + | #include <LiquidCrystal.h> | ||
| + | #include "DHT.h" | ||
| + | pentru senzori si LCD. | ||
| + | |||
| + | In functia void setup() am setat RTC, am folosit comanda begin pentru senzorul de fum MQ2 cat si pentru LCD. | ||
| + | |||
| + | In functia loop() sunt create variabile pentru a citi si afisa datele furnizate de sezori pe LCD. | ||
| + | |||
| + | |||
| + | #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); | ||
| + | |||
| + | |||
| + | } | ||
| + | |||
| + | |||
| + | |||
| - | **to be decided** | ||
| </note> | </note> | ||
| ===== Rezultate Obţinute ===== | ===== Rezultate Obţinute ===== | ||
| <note tip> | <note tip> | ||
| - | **to be decided** | + | {{:pm:prj2023:tmiu:rezultateyuna.jpeg?300|}} |
| </note> | </note> | ||
| ===== Concluzii ===== | ===== Concluzii ===== | ||
| - | **to be decided** | + | <note> |
| + | Am afisat cu succes nivelul de monoxid de carbon, temperatura si umiditatea pe display-ul LCD. | ||
| + | </note> | ||
| ===== Download ===== | ===== Download ===== | ||
| + | <note> | ||
| - | <note warning> | + | {{:pm:prj2023:tmiu:pmprojectyunavelicu.zip|}} |
| </note> | </note> | ||
| Line 48: | Line 135: | ||
| <note tip> | <note tip> | ||
| Initial documentation - 7.05.2023 | Initial documentation - 7.05.2023 | ||
| + | Software and hardware - 28.05.2023 | ||
| </note> | </note> | ||
| Line 53: | Line 141: | ||
| <note> | <note> | ||
| - | Listă cu documente, datasheet-uri, resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. | + | **Resurse Software** |
| + | https://projecthub.arduino.cc/woutvdr/arduino-weather-station-9dd87f | ||
| </note> | </note> | ||
| Link: https://ocw.cs.pub.ro/courses/pm/prj2023/tmiu/weatherstation | Link: https://ocw.cs.pub.ro/courses/pm/prj2023/tmiu/weatherstation | ||
| + | https://projecthub.arduino.cc/woutvdr/9dd87f80-4b0e-483a-8bdc-3681868441cd | ||
| <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | ||