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:
Bram Barbieri
2024-02-14 15:42:50 +01:00
4 changed files with 146 additions and 12 deletions

View File

@@ -0,0 +1,98 @@
// Sietse Jonker
// 09/02/2024
#include <Wire.h>
#include <Adafruit_SH110X.h>
#include <Adafruit_SGP30.h>
#include <DHT.h>
#define MICPIN 6
#define DHTPIN 7
#define SCL 9
#define SDA 8
#define DHTTYPE DHT11
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define i2c_adress 0x3c
Adafruit_SH1106G display = Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);
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() {
// clear display for new info
display.clearDisplay();
// set custom text properties
display.setTextSize(2);
display.setTextColor(SH110X_WHITE);
display.setCursor(0, 0);
// display info on oled screen
display.println((String) "Temp: " + int(temperature) + "C" + '\n'
+ "Humi: " + int(humidity) + "%" + '\n'
+ "eCO2: " + int(sgp.eCO2) + '\n'
+ "TVOC: " + int(sgp.TVOC));
display.display();
}
void setup() {
Serial.begin(115200);
// tell display what settings to use
display.begin(i2c_adress, true);
display.clearDisplay();
// tell sensors to start reading
dht.begin();
sgp.begin();
pinMode(MICPIN, INPUT);
pinMode(DHTPIN, INPUT);
resetValues();
}
void loop() {
// if sensor doesnt work print in serialmonitor
if (!sgp.IAQmeasure()) {
Serial.println("SGP30: BAD");
return;
} else {
Serial.println("SGP30: OK");
}
// read dht11 sensor
temperature = float(dht.readTemperature());
humidity = float(dht.readHumidity());
// display sensordata on oled screen
displayData();
// get new baseline every 30 seconds
if (counter == 30) {
sgp.getIAQBaseline(&eCO2_base, &TVOC_base);
}
delay(1000);
counter++;
}

View File

@@ -1,6 +1,6 @@
#Rasberry Pi # Rasberry Pi
##Table of contents ## Table of contents
1. [Introduction](##introduction) 1. [Introduction](##introduction)
2. [Rasberry Pi](##Rasberry-Pi) 2. [Rasberry Pi](##Rasberry-Pi)
3. [Dev-Page](###Dev-Page) 3. [Dev-Page](###Dev-Page)
@@ -8,20 +8,22 @@
5. [Database software](###Database-software) 5. [Database software](###Database-software)
6. [Esp to database](###Esp-to-database) 6. [Esp to database](###Esp-to-database)
##Introduction ## Introduction
The backend of this project there is a raspberry pi 3 for handeling the dev page (more on this later) and the database. The Esp nodes are going to send a api request to the dev page wich is going to make a POST request to the database. In the backend of this project, there is a Raspberry Pi 3 for handling the dev page (more on this later) and the database. The ESP nodes are going to send an API request to the dev page, which is going to make a POST request to the database.
##Rasberry Pi ## Rasberry Pi
The Raspberry 3 can be descriped as a "little" computer running a quad-code 64-bit prossesor, the previus Raspberry witch is 50% slower than this one The Raspberry 3 can be descriped as a "little" computer running a quad-code 64-bit prossesor, the previus Raspberry witch is the pi 2 and is 50% slower. The operaiting system is linux, it is a open source os system, we are using it for database and website hosting purposes, but it can do a wide range of things. The GPIO pins make it usefull for even more things, like home automation with sensors.
The Raspberry Pi 3 is equipped with a quad-core 64-bit Broadcom BCM2837 ARM Cortex-A53 SoC processor running at 1.2 GHz, making it about 50% more powerful than the Pi 2. ### Dev Page
###Dev Page For monitoring porpoises we are going to implement a dev page, this means that there basicey is a debug page. On this page we will be displaying the current readings that are comming in in to graphs and also the data form the last 10 redings from all the nodes, the readings are sorted in there respective graphs like temp, humidity and noice redings for example.
##Database ### Database
###Database software ## Database
###Esp to database ### Database software
### Esp to database

View File

@@ -0,0 +1,31 @@
### Begin met een introductie van het team (jullie namen + teamnaam)
Welkom bij de sprint review, wij zijn *insert namen*.
### Leg uit wat jullie van plan zijn om op te leveren; wat is de opdracht, wat gaat er waarschijnlijk uitkomen.
Wij hebben de opdracht gekregen om de studieruimte te optimaliseren. Hiervoor moeten we data verzamelen over de studieomgeving en de meningen van onze medeleerlingen. Dit gaan we doen door het plaatsen van een centrale hub node en een aantal losse hub nodes. Deze nodes zullen verschillende datapunten verzamelen met behulp van sensoren, namelijk: temperatuur, luchtvochtigheid, ppm van koolstof en *insert funny bio massa meting ofzo*. Daarnaast hebben we een display waarop de huidige metingen worden getoond. In de centrale hub is ook een meetstation en een tweede scherm met enkele enquêteachtige vragen, waarbij gebruikers hun mening kunnen geven met behulp van 3 knoppen. We moeten nog testen of dit toegankelijk genoeg is. We hebben ook al een basisidee van hoe het design van de nodes eruit zal zien. *insert bram funny pic*
### Bespreek welke User Stories jullie hebben gemaakt voor de Product Backlog.
*laat belangrijke user stories zien*
*leg uit waarom*
### Bespreek welke User Stories jullie hebben opgepakt in de Sprint Backlog.
- [Luchtmeten](https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/issues/36)
- [Temperatuur meten](https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/issues/18)
- [Schermpje op node](https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/issues/39)
In de eerste sprint werken we vooral aan het algehele plan en de basis van het project, met name de Raspberry Pi die tot onze beschikking is gesteld voor de backend. Deze moeten we zelf ontwerpen. Daarnaast moeten we zaken zoals de wireflows, de infrastructuur: ![de infrastructuur](../assets/ImagesSp1/digitaleInfrastructuur.png), en het [uml diagram](../brainstorm/UML%20infrastructure.md) regelen.
### Geef een demonstratie van het product.
*show node*
### Geef een overzicht van jullie portfoliowebsite (highlights).
We hebben op onze portfoliopagina verschillende documentaties geplaatst, met name:
- [Het algehele idee](https://opti.smikkelbakje.nl/brainstorm/idee%C3%ABn/)
- [Databaseontwerp](https://opti.smikkelbakje.nl/brainstorm/Database/)
- [I2C-communicatie](https://opti.smikkelbakje.nl/arduino-documentation/i2c-ESP32/)

View File

@@ -5,3 +5,6 @@ The problem we are facing with the study area is having to walk around a lot to
## The solution ## The solution
Thats why we are going to make a system that can show how loud it is in the study area, so you have a better chance of walking to a spot where you can sit and work in peace. There are going to be 3 nodes in different study areas that are going to measure the sound level. These nodes are going to send the data to a server, which is going to process the data and send it to the main node that is located at the coffee machine. This node is going to show the data on a display. Thats why we are going to make a system that can show how loud it is in the study area, so you have a better chance of walking to a spot where you can sit and work in peace. There are going to be 3 nodes in different study areas that are going to measure the sound level. These nodes are going to send the data to a server, which is going to process the data and send it to the main node that is located at the coffee machine. This node is going to show the data on a display.
## Target audience
The target audience is students that are working in the study area. They can use the system to find a quiet place to work.