summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LINKS.md26
-rw-r--r--TODO.md10
-rw-r--r--learning_examples/DHT_Tester_esp32/DHTtester_esp32.ino (renamed from learning_examples/DHTtester_esp32/DHTtester_esp32.ino)0
-rw-r--r--learning_examples/DSM501A-example-ehh-unreliable/DSM501A-example-ehh.ino65
-rw-r--r--learning_examples/MQ135_workaround_analog_esp32/parts_per_mil_mq135_workaround_analog_esp32.ino (renamed from learning_examples/parts_per_mil_mq135_workaround_analog_esp32/parts_per_mil_mq135_workaround_analog_esp32.ino)0
5 files changed, 95 insertions, 6 deletions
diff --git a/LINKS.md b/LINKS.md
index fc3d211..25a2f48 100644
--- a/LINKS.md
+++ b/LINKS.md
@@ -1,4 +1,22 @@
-https://randomnerdtutorials.com/getting-started-with-esp32/ -- main board (ESP32 Board)
-toadd - temperature and humidity sensors (DHT Unified Sensor)
-toadd - air quality detector for ppm measurements (MQ135 Sensor)
-https://www.mechatronicstore.cl/wp-content/uploads/datasheet-sensor-dsm501a.pdf -- dust sensor (DSM501A Sensor) \ No newline at end of file
+HARDWARE:
+
+https://randomnerdtutorials.com/getting-started-with-esp32/ -- main board (ESP32 Board) - general info - has wifi and is kute
+
+(done) toadd - temperature and humidity sensors (DHT Unified Sensor) - i simply used the examples provided by the library it comes with
+
+(done) toadd - air quality detector for ppm measurements (MQ135 Sensor)
+https://blog.asksensors.com/air-quality-sensor-mq135-cloud-mqtt/ - reference for acieving a workaround for the MQ 135 Sensor
+
+https://www.mechatronicstore.cl/wp-content/uploads/datasheet-sensor-dsm501a.pdf -- dust sensor (DSM501A Sensor)
+https://www.instructables.com/Dust-Sensor-With-DSM501a-and-ESP8266/ -- example of using the sensor that i ve tried to replicate
+
+DATABASE CONTENDERRRRRRRRRRRRRRRr:
+
+https://cassandra.apache.org/_/quickstart.html -- i like this containarization
+https://graphql.org/ - graphs dbs
+
+SOME OTHER THINGS I VE SEEN:
+
+https://github.com/expressjs/express
+https://nodejs.org/en/download
+https://www.npmjs.com/package/express \ No newline at end of file
diff --git a/TODO.md b/TODO.md
index 24e2eef..8d0291f 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,3 +1,9 @@
-integrate dsm sensor
+integrate dsm sensor (doing)
-make an api interface (esp32 can use curls and stuff) \ No newline at end of file
+make an api interface (esp32 can use curl's and stuff)
+
+store the data on a mock server that can be accessed with requests (rest, crud)
+
+somehow integrate that continuously with time series data forcasting and other AI/ML predictions
+
+incorporate normal graphs and predicted future behaviour of those datapoints to show the urgency of measures that should be taken \ No newline at end of file
diff --git a/learning_examples/DHTtester_esp32/DHTtester_esp32.ino b/learning_examples/DHT_Tester_esp32/DHTtester_esp32.ino
index f12bfb5..f12bfb5 100644
--- a/learning_examples/DHTtester_esp32/DHTtester_esp32.ino
+++ b/learning_examples/DHT_Tester_esp32/DHTtester_esp32.ino
diff --git a/learning_examples/DSM501A-example-ehh-unreliable/DSM501A-example-ehh.ino b/learning_examples/DSM501A-example-ehh-unreliable/DSM501A-example-ehh.ino
new file mode 100644
index 0000000..7852763
--- /dev/null
+++ b/learning_examples/DSM501A-example-ehh-unreliable/DSM501A-example-ehh.ino
@@ -0,0 +1,65 @@
+#include<string.h>
+#define PM1PIN 18 //DSM501A input D6 on ESP8266
+#define PM25PIN 14 // ???? what
+byte buff[2];
+unsigned long durationPM1;
+unsigned long durationPM25;
+unsigned long starttime;
+unsigned long endtime;
+unsigned long sampletime_ms = 30000;
+unsigned long lowpulseoccupancyPM1 = 0;
+unsigned long lowpulseoccupancyPM25 = 0;
+
+
+int i=0;
+void setup()
+{
+ Serial.begin(9600);
+ Serial.println("Starting please wait 30s");
+ pinMode(PM1PIN,INPUT);
+ pinMode(PM25PIN,INPUT);
+ starttime = millis();
+}
+
+float calculateConcentration(long lowpulseInMicroSeconds, long durationinSeconds){
+
+ float ratio = (lowpulseInMicroSeconds/1000000.0)/30.0*100.0; //Calculate the ratio
+ float concentration = 0.001915 * pow(ratio,2) + 0.09522 * ratio - 0.04884;//Calculate the mg/m3
+ Serial.print("lowpulseoccupancy:");
+ Serial.print(lowpulseInMicroSeconds);
+ Serial.print(" ratio:");
+ Serial.print(ratio);
+ Serial.print(" Concentration:");
+ Serial.println(concentration);
+ return concentration;
+}
+
+void loop()
+{
+ durationPM1 = pulseIn(PM1PIN, LOW);
+ durationPM25 = pulseIn(PM25PIN, LOW);
+
+ lowpulseoccupancyPM1 += durationPM1;
+ lowpulseoccupancyPM25 += durationPM25;
+
+ endtime = millis();
+ if ((endtime-starttime) > sampletime_ms) //Only after 30s has passed we calcualte the ratio
+ {
+ /*
+ ratio1 = (lowpulseoccupancy/1000000.0)/30.0*100.0; //Calculate the ratio
+ Serial.print("ratio1: ");
+ Serial.println(ratio1);
+
+ concentration = 0.001915 * pow(ratio1,2) + 0.09522 * ratio1 - 0.04884;//Calculate the mg/m3
+ */
+ float conPM1 = calculateConcentration(lowpulseoccupancyPM1,30);
+ float conPM25 = calculateConcentration(lowpulseoccupancyPM25,30);
+ Serial.print("PM1 ");
+ Serial.print(conPM1);
+ Serial.print(" PM25 ");
+ Serial.println(conPM25);
+ lowpulseoccupancyPM1 = 0;
+ lowpulseoccupancyPM25 = 0;
+ starttime = millis();
+ }
+}
diff --git a/learning_examples/parts_per_mil_mq135_workaround_analog_esp32/parts_per_mil_mq135_workaround_analog_esp32.ino b/learning_examples/MQ135_workaround_analog_esp32/parts_per_mil_mq135_workaround_analog_esp32.ino
index dc2ed08..dc2ed08 100644
--- a/learning_examples/parts_per_mil_mq135_workaround_analog_esp32/parts_per_mil_mq135_workaround_analog_esp32.ino
+++ b/learning_examples/MQ135_workaround_analog_esp32/parts_per_mil_mq135_workaround_analog_esp32.ino