I attempted to obtain value from the MICS 6814 and send it to the local web server.I'm having trouble with the code.Please assist me if you know the Arduino code for connecting MICS 6814 and NODEMCU ESP8266.
After reading the "How to get the best out of the forum" post, please follow instructions to post the code, using code tags, a hand drawn wiring diagram, and explain the difficulties you are having.
#define BLYNK_TEMPLATE_ID "TMPL6lAeS564"
#define BLYNK_DEVICE_NAME "Temparature"
#define BLYNK_AUTH_TOKEN "iu_qPx4ZRryALPrh6l2v0AORaylmlbCd"
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = ""; // type your wifi name
char pass[] = ""; // type your wifi password
#define DHTPIN 2 // Mention the digital pin where you connected
#define DHTTYPE DHT22 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
void sendSensor(){
float h = dht.readHumidity();
float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
Serial.println(t);
Blynk.virtualWrite(V6, h);
Blynk.virtualWrite(V5, t);
Serial.print("Temperature : ");
Serial.print(t);
Serial.print(" Humidity : ");
Serial.println(h);
if(t > 30){
// Blynk.email("shameer50@gmail.com", "Alert", "Temperature over 28C!");
Blynk.logEvent("temp_alert","Temp above 30 degree");
}
}
void setup(){
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
dht.begin();
timer.setInterval(2500L, sendSensor);
}
void loop(){
Blynk.run();
timer.run();
}
This is the code to get temperature and humidity values using DHT 22 sensor. But i want to replace it with MICS 6814 SENSOR and get CO/NH3/NO2
Give it your best try and if you have difficulties, post again.
If you want someone to write the code for you, use the flag button (lower right corner) to ask the moderator to move the post to the Jobs and Paid Collaboration forum section.
thanks brother. i tried my best. i have only one problem. how we defined sensor pin. DHT-22 PIN was defined using "DHTPIN 2" I want to know what is the MICS 6814 sensor definition is.
The search phrase "mics 6814 arduino" turns up some possibly useful links.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.