diff --git a/esp32c3-dht-mq-wifi.ino b/esp32c3-dht-mq-wifi.ino index 6ed81dc..791bf80 100644 --- a/esp32c3-dht-mq-wifi.ino +++ b/esp32c3-dht-mq-wifi.ino @@ -13,7 +13,7 @@ DHT dht(DHT_PIN, DHT_TYPE); // ----------- MQ-135 ----------- static const int MQ_PIN = A2; // Analog pin for MQ-135 (GPIO2 on ESP32-C3) -static const int MQ_ADC_CALIBRATION = 10; // ADC baseline in clean air - ADJUST THIS +static const int MQ_ADC_CALIBRATION = 1900; // ADC baseline in clean air - ADJUST THIS static const float MQ_AQ_MIN = 0; // Min AQ value static const float MQ_AQ_MAX = 500; // Max AQ value (standard AQI scale) static const float MQ_ADC_MAX = 4095.0; // ESP32-C3 12-bit ADC max diff --git a/espdhtmq b/espdhtmq new file mode 100644 index 0000000..aafbb55 --- /dev/null +++ b/espdhtmq @@ -0,0 +1,18 @@ +#!/bin/bash + +clear +echo "ESP32 IP:" +read -r srv +srv=192.168.0.187:80 +while true; do +clear +ts=$(date +%Y-%m-%d-%T) +#dht=$(curl -s -X GET http://$srv/data | sed 's/{"h"/Humidity/g'| sed 's/"t_f"/Temp/g' | sed 's/,/%, /g' | sed 's/}//') +t=$(curl -s -X GET http://$srv/data | awk -F":|,|}" '{print$4}') +h=$(curl -s -X GET http://$srv/data | awk -F":|,|}" '{print$2}') +a=$(curl -s -X GET http://$srv/data | awk -F":|,|}" '{print$6}') +echo "$ts, TEMP: $t°F, HUMID: $h%, AQI: $a" | tee -a espdhtmq.csv +sleep 1 +#continue +done + diff --git a/espdhtmq.png b/espdhtmq.png new file mode 100644 index 0000000..c7b4cce Binary files /dev/null and b/espdhtmq.png differ