Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59
This commit is contained in:
92
arduino/node-code-0.96.ino
Normal file
92
arduino/node-code-0.96.ino
Normal file
@@ -0,0 +1,92 @@
|
||||
// Sietse Jonker
|
||||
// 09/02/2024
|
||||
|
||||
#include <Wire.h>
|
||||
#include "SSD1306Wire.h"
|
||||
#include "Adafruit_SGP30.h"
|
||||
#include "DHT.h"
|
||||
|
||||
#define MICPIN 6
|
||||
#define DHTPIN 7
|
||||
#define SCL 9
|
||||
#define SDA 8
|
||||
|
||||
#define DHTTYPE DHT11
|
||||
|
||||
SSD1306Wire display(0x3c, SDA, SCL);
|
||||
|
||||
DHT dht(DHTPIN, DHTTYPE);
|
||||
|
||||
Adafruit_SGP30 sgp;
|
||||
|
||||
uint16_t TVOC_base, eCO2_base;
|
||||
int counter = 0;
|
||||
float temperature = 0;
|
||||
float humidity = 0;
|
||||
int eCO2 = 0;
|
||||
int TVOC = 0;
|
||||
bool noise = false;
|
||||
|
||||
void resetValues() {
|
||||
TVOC_base, eCO2_base;
|
||||
counter = 0;
|
||||
temperature = 0;
|
||||
humidity = 0;
|
||||
eCO2 = 0;
|
||||
TVOC = 0;
|
||||
noise = false;
|
||||
}
|
||||
|
||||
void displayData(){
|
||||
display.setFont(ArialMT_Plain_16);
|
||||
display.setTextAlignment(TEXT_ALIGN_LEFT);
|
||||
display.drawString(0, 0, String(sgp.eCO2) + " ppm" + " " + String(sgp.TVOC) + " ppb");
|
||||
display.drawString(0, 18, String(temperature) + " C");
|
||||
display.drawString(0, 39, String(humidity) + "%");
|
||||
|
||||
display.display();
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
display.init();
|
||||
display.flipScreenVertically();
|
||||
|
||||
dht.begin();
|
||||
|
||||
sgp.begin();
|
||||
pinMode(MICPIN, INPUT);
|
||||
pinMode(DHTPIN, INPUT);
|
||||
|
||||
resetValues();
|
||||
|
||||
display.setFont(ArialMT_Plain_16);
|
||||
display.setTextAlignment(TEXT_ALIGN_LEFT);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
display.clear();
|
||||
|
||||
if (!sgp.IAQmeasure()) {
|
||||
Serial.println("SGP30: BAD");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Serial.println("SGP30: OK");
|
||||
}
|
||||
|
||||
temperature = float(dht.readTemperature());
|
||||
humidity = float(dht.readHumidity());
|
||||
|
||||
displayData();
|
||||
|
||||
sgp.getIAQBaseline(&eCO2_base, &TVOC_base);
|
||||
|
||||
Serial.print("eCO2 ");
|
||||
Serial.print(sgp.eCO2);
|
||||
Serial.println(" ppm");
|
||||
|
||||
delay(100);
|
||||
counter++;
|
||||
}
|
@@ -9,4 +9,5 @@ nav:
|
||||
- 📚 Documentatie:
|
||||
- I2C: arduino-documentation/i2c-ESP32
|
||||
- 🧠 Brainstorm:
|
||||
- Ideeën: brainstorm/ideeën
|
||||
- Ideeën: brainstorm/ideeën
|
||||
- Database design: brainstorm/Database
|
||||
|
@@ -1,8 +0,0 @@
|
||||
Omdat scorion nog niet overgezet is naar Mijn nieuwe studie richting, moet ik voor nu hier mijn scorionformulieren invullen.
|
||||
|
||||
K3: infrastructuur.
|
||||
S: Deze eerste week werdt er gefocust op het beginnen en het uitdenken van het project.
|
||||
T: Ik moest bedenken wat er allemaal in een node moest komen te zitten en wat voor een data we willen opmeten.
|
||||
A: Ik heb een layout getekend van alles wat in een node moet komen te zitten op een whiteboard en dit verstuurd naar de documentatie.
|
||||
R: Dit werkte goed en zorgt voor meer overzicht over ons totale project.
|
||||
R: De functionaliteit van nodes en wat deze mogelijk kunnen is bij mij als kennis opgedaan.
|
11
docs/Sp1Schets van het project/HetAlgehelePLan.md
Normal file
11
docs/Sp1Schets van het project/HetAlgehelePLan.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# The Plan.
|
||||
Around the school, we will collect various information using nodes, which we will ultimately process into a database.
|
||||
|
||||
The locations we choose for the nodes can vary between ceilings and walls to gather various measurements effectively.
|
||||
|
||||
The measurements will include: temperature, CO2, humidity, and sound.
|
||||
|
||||
At one of the nodes, a screen with a survey will also be placed so that we can receive feedback from the students.
|
||||
|
||||
The node with the screen will be placed near the coffee machines and the water tap to ensure it is easily accessible and located in a frequently visited area.
|
||||
This way, we can obtain as many results as possible and have the best possible overview of where attention is needed.
|
22
docs/Sp1Schets van het project/infrastructuur.md
Normal file
22
docs/Sp1Schets van het project/infrastructuur.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Infrastructuur
|
||||
|
||||
## Database en nodes
|
||||
|
||||

|
||||
](../assets/ImagesSp1/Sp1DataTrack.jpg)
|
||||
You can see that in the picture we've drew all the nodes and the tables for the database, every node has multiple sensors and only node 1 has an extra screen. The database is used to store all the data that the nodes collect. Here is a picture that
|
||||
|
||||
shows what the nodes do:
|
||||
We also have this sketch digitalised in a simpler way:
|
||||
|
||||

|
||||
|
||||
You can see that every node measures:
|
||||
- Temperature
|
||||
- Humidity
|
||||
- CO2 level
|
||||
- Sound level
|
||||
|
||||
Each of these factors can have an influence on the comfort and efficientie the students can have.
|
||||
|
||||
The nodes are connected to the database using post requests, every node sends a post request to the database with the sensordata it has collected. The database then stores this data in the right table. This is the table called "Node" in the first picture.
|
BIN
docs/assets/Database/IMG_0908.jpg
Normal file
BIN
docs/assets/Database/IMG_0908.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
BIN
docs/assets/Database/IMG_0909.jpg
Normal file
BIN
docs/assets/Database/IMG_0909.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 MiB |
BIN
docs/assets/Database/IMG_0910.jpg
Normal file
BIN
docs/assets/Database/IMG_0910.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 MiB |
BIN
docs/assets/Database/Screenshot 2024-02-09 130735.png
Normal file
BIN
docs/assets/Database/Screenshot 2024-02-09 130735.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 125 KiB |
BIN
docs/assets/Database/Screenshot 2024-02-09 130805.png
Normal file
BIN
docs/assets/Database/Screenshot 2024-02-09 130805.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
30
docs/brainstorm/Database.md
Normal file
30
docs/brainstorm/Database.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Database
|
||||
|
||||
|
||||
## v1
|
||||
This was our first version of the database. It isnt normalized and not optimized for performance. It was a starting point to see what we needed. We where still missing some colums.
|
||||
|
||||
|
||||

|
||||
|
||||
## v2
|
||||
This is our second version of the database. We added some columns and normalized the database based on feedback within the group.
|
||||
|
||||

|
||||
|
||||
## v3
|
||||
Based on feedback from Mats we finished the database.
|
||||
```
|
||||
Note niet direct praten met de db, maar dan via de website via een api.
|
||||
Niet alle data in 1 tabel gaan versamelen, maar in meerdere tabellen en dan per meting een tabel.
|
||||
indentiviceren van de comunicatie methodes (rode lijntjes)
|
||||
afbeelding met beschreiving in markdown
|
||||
|
||||
tabel: node
|
||||
info: Id, Naam, Locatie.
|
||||
|
||||
Tabel: meting
|
||||
info: id, node-Id, type sensor, waarde.
|
||||
```
|
||||
We added extra tables for identifying and naming nodes. We also changed the Measurements table so we dont have to send all data at once. This will make it easier to add new nodes that are missing some sensors.
|
||||

|
Reference in New Issue
Block a user