amar axr
Published © CC BY-NC-ND

#DIY# How to grow Bonsai (or any plant) using Internet of...

Everybody loves to plant a Bonsai, a small tree in a pot, the problem is its maintenance ,Whenever we go out of town for few days, we alw...

IntermediateFull instructions provided3 hours963
#DIY# How to grow Bonsai (or any plant) using Internet of...

Story

Read more

Code

Code snippet #2

Plain text
#include "bme680.h"#define BLYNK_PRINT Serial    
#include 
#include char auth[] = "47blynkauthtoken57";// copy auth token of blynk android app here char ssid[] = "wifiname";
char pass[] = "password";
Bme680 gasSensor;
uint32_t lastRead = 0;void setup() {
  /* Initialize the peripherals */
   // Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  Serial.begin(115200);
  I2C.begin(2, 0); // Specific for the ESP8266, D4-SDA, D3-SCL
  Serial.println();  /* Initialize the BME680 object */
  if (gasSensor.begin() != BME680_OK)
    while (1); // Stall if the sensor is not found  gasSensor.setSensorConfig(); // Set the default configuration
  gasSensor.triggerMeasurement(); // Trigger a measurement
  Serial.println("Temperature(°C), Pressure(hPa), Humidity(%rH), Gas resistance(ohms)");
}void loop() {
  /* Read data at 1.56Hz */
  if ((millis() - lastRead) > 640) {
    lastRead = millis();    Blynk.run();    /* Get data from the sensor */
    gasSensor.getData();    float t1 = gasSensor.temperature / 100.0;
    
    Blynk.virtualWrite(0, t1);//    /* Stream out the data */
//    Serial.print(gasSensor.temperature / 100.0); // Temperature in °C
//    Serial.print(", ");
//    Serial.print(gasSensor.pressure / 100.0); // Pressure in hPa 
//    Serial.print(", ");
//    Serial.print(gasSensor.humidity / 1000.0); // Humidity in %rH
//    Serial.print(", ");
//    Serial.println(gasSensor.gasResistance); // Gas resistance in Ohms    /* Trigger the next measurement */
    gasSensor.triggerMeasurement();
  }
}

Credits

amar axr

amar axr

12 projects • 16 followers
Electronics and Communication engineer

Comments