@Toro_Blanco I’m addicted, had my browser open 14 hours now. Reading the docs and trying sketch’s in the builder, since @Gunner replied to my first post. Even tried Google in the hope I’d find an easy example of a BME280 being used with Blynk so I could try and pick it apart to see how it was done. So far all I’ve managed to do is admire someone else’s hard work as I’ve watched a NodeMCU and an ESP8285 send data to the Blynk app on my phone…
Well keep at it. I will not be near a computer until tomorrow (responding from my phone). When I can I will try and see if I can come up with something to help you out.
Basically you will need the library for the BME, and need to know the calls to get the temp/humidity/pressure. Put those calls in a timed loop with some virtualwrites to display data to BLYNK.
Your original sketch was almost what you needed.
Replace the reference to the library, change the BMP’ to BME’s and change the line that reads the altitude to bme.readHumidity
Once it’s working you can tidy-up the variable names from altitude to humidity.
Morning guys.
Well after 5 hours sleep I jump in the truck, coffee and sandwiches in hand, only to receive a phone call telling me the site is under 2 feet of water. Strong winds have blown over a huge oak that cracked a water main.
So, here I am again. Coffee and sandwiches in one hand, mouse in the other, and still wearing my overalls …
HUGE thank you to @PeteKnight for pointing me in the right direction. Because I’ve done it, well almost, 390% humidity. This sensor thinks I’m on site.
Pete, I did try changing the altitude to bme.readHumidity but then it fails to compile. Gives me “error: ‘humidity’ was not declared in this scope_”_ . If I leave it I get 390% humidity.
Not sure if I know how to post this properly but here goes.
#include <Blynk.h>
#include <ESP8266WiFi.h>
#include <Wire.h>
#include <BlynkSimpleEsp8266.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#define SEALEVELPRESSURE_HPA (1013.25)
//Setup connection of the sensor
Adafruit_BME280 bme; // I2C
char auth[] = "***************";
char ssid[] = "***************";
char pass[] = "***************";
BlynkTimer timer;
//Variables
float pressure; //To store the barometric pressure (Pa)
float temperature; //To store the temperature (oC)
int altimeter; //To store the humidity (%) (you can also use it as a float variable)
void setup() {
bme.begin(0x76); //Begin the sensor
Serial.begin(9600); //Begin serial communication at 9600bps
Serial.println("Adafruit BME280 test:");
Blynk.begin(auth, ssid, pass);
timer.setInterval(2000L, ReadSensors); // read sensor every 5s
}
void ReadSensors(){
//Read values from the sensor:
pressure = bme.readPressure();
temperature = bme.readTemperature();
humidity = bme.readHumidity ();
Blynk.virtualWrite(V1, pressure/100); // write pressure to V1 value display widget
Blynk.virtualWrite(V2, temperature); // write temperature to V2 value display widget
Blynk.virtualWrite(V3, altimeter); // write altimeter to V3 value display widget
//Print values to serial monitor:
Serial.print(F("Pressure: "));
Serial.print(pressure);
Serial.print(" Mb");
Serial.print("\t");
Serial.print(("Temp: "));
Serial.print(temperature);
Serial.print(" °C");
Serial.print("\t");
Serial.print("Humidity: ");
Serial.print(altimeter); // this should be adjusted to your local forcase
Serial.println(" %");
//delay(2000); //Update every 5 sec
}
void loop() {
Blynk.run();
timer.run();
}
Well done for sticking with it.
This is why contributors to the forum don’t tend to post code for people. The sense of achievement and the confidence and knowledge gained by doing it yourself - with a few nudges in the right direction - will help you stick with it in future.
If you scan the other forum topics you’ll see that a small handful of people answer most of the questions that are asked. They all started off like you and their knowledge and experience has grown over time by putting in the hours at the keyboard, and gaining a few grey hairs in the process. If you keep at it, you’ll be one of those people answering the questions
I got another phone call. They wanted help installing pumps to empty the site, only just got home, soaked to the skin.
Feel a bit stupid at the moment, everything is so alien to me, so much I don’t understand. Yet others find it a easy as walking the dog. I’m hoping for an early retirement, fingers crossed this will be my hobby that I use as a substitute for the last 35 years grafting on building sites.
It was your “your almost there” comment that got me thinking and heading in the right direction, thank you.
I plan to retired not dig myself an early grave.
Plus the wife only lets me out on Friday nights while she’s at work(she’s an A&E Nurse, nightshift).
I’ve just had an hour playing with the Blynk app on my phone. Impressive but wasn’t aware that the “Energy” thing was restricting my ability to do stuff at first. Just brought 28,000 “Energies” so I can have a proper mess with it.
cool, I have been trying develop a project the same by using the same sensor…
would you mind to share the arduino code just to see how it is now?
thanks and congrats…