He here is my temperature measurement. I using two ESP one for temp from outside by DHT. And another for temp from inside and lux and pressure.
Sketch:
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <SI7021.h>
#include <Wire.h>
#include <Adafruit_BMP085.h>
#include <BH1750.h>
BH1750 lightMeter;
char auth[] = "";
SI7021 sensor;
SimpleTimer timer;
#define I2C_SCL 12 //D6
#define I2C_SDA 13 //D7
Adafruit_BMP085 bmp;
float dst, bt, bp, ba;
char dstmp[20], btmp[20], bprs[20], balt[20];
bool bmp085_present = true;
void setup()
{
Serial.begin(9600); // See the connection status in Serial Monitor
Blynk.begin(auth, "", ""); //insert here your SSID and password
Wire.begin(I2C_SDA, I2C_SCL);
delay(10);
if (!bmp.begin()) {
Serial.println("Could not find a valid BMP085 sensor, check wiring!");
//while (1) {}
}
timer.setInterval(2000L, sendUptime);
lightMeter.begin();
//sensor.begin(SDA,SCL);
}
void sendUptime()
{
float temperature = sensor.getCelsiusHundredths();
float humidity = sensor.getHumidityPercent();
Blynk.virtualWrite(5, (float)temperature/100, 2);
Blynk.virtualWrite(6, humidity); // virtual pin
uint16_t lux = lightMeter.readLightLevel();
Blynk.virtualWrite(4, lux);
float bp = bmp.readPressure();
Blynk.virtualWrite(9,(float)bp/100,2);
float ba = bmp.readAltitude();
Blynk.virtualWrite(7, ba);
float bt = bmp.readTemperature();
Blynk.virtualWrite(12, bt);
float dst = bmp.readSealevelPressure(520)/100;
Blynk.virtualWrite(13, dst);
}
void loop()
{
Blynk.run();
timer.run();
}