Using BME280 (Not BMP) with Blynk

@Gunner So if I’m not running a local server(data sent direct to Blynk) is it just a case of removing that line from the code?

Not so much that (although it will not be needed) as editing the primary connection command to something like this: Blynk.begin(auth, ssid, pass);

Read through the Documentation and compare different connection methods in the Examples.

1 Like

@Gunner So id need to remove:

and replace it with:

which changes how Blynk connects, Blynk.config() ?

@Gunner And change:

to

I used the proven “trial, error, trial, success” and a LOT of reading when I started learning how it all works… :wink:

1 Like

@Gunner Now I feel daft. :crazy_face:

Read it again and

just had to remove:

and replace:

With

Thanks Gunner. :+1:

1 Like

@Gunner Me again, sorry. :confused:

Compiled and uploaded. :grinning:

0 = Pressure :disappointed_relieved:
0 = temperature :disappointed_relieved:
45,000m = Alttitude :disappointed_relieved:

So I ran I2C Scanner and it found the BMP280

Scanning…
I2C device found at address 0x76 !
done

So what have I done wrong ? :confounded:

@Gunner And just in case its important, I’m using an old NodeMCU 12( https://www.amazon.co.uk/Gaoxing-Tech-ESP8266-Internet-Development/dp/B06WD4PQ7Y) a friend gave me.

The Adafruit-BMP280 library expects to find your sensor at address 0x77 so you need to locate your Adafruit-BMP280.h file, open it with a text editor and find the line that says:

#define BMP280_ADDRESS (0x77)

and edit it to say (0x76) then save it.

Alternatively, your sensor may have a set of solder pads that can be bridged to change the I2C address of the sensor to 0x77.

Pete.

4 Likes

@PeteKnight Thanks, I did as you suggested, used used Windows Notepad to edit and save it.

But, I’m still getting:

So what have I done wrong?

I’m going to take a wild guess and say you messed up the pins.

@Costas The i2c Scanner found the BMP280 on pins D1(SCL) and D2(SDA).
So I left the BMP280 connected to those pins and did as PeteKnight suggetsed so I thought the pins were correct now?

Ok, “BIG” noob error!

The BMP280 isn’t a BMP280, it’s a BME280. :confounded:
So I’m guessing thats why I’m getting “zero’s”.
They looked exactly the same to me, was sure it was a BMP. Ran BME280 I2C Test and realised my error.

I shall now find a quiet corner and hang my head in shame. :sweat_smile:

Would it possible to change Altitude to Humidity some how ?

Don’t see why not. The BME280 is a temp/humidity/pressure sensor.

You will need to make sure you have all the correct libraries installed for the BME280 though, and also change your code to the correct commands for retrieving such data from the sensor.

A quick google search for the BME280 arduino code should give you all of the info you need to get the temp/humidity/pressure from the sensor. From there its just a matter of putting it into BLYNK compatible code.

1 Like

@Toro_Blanco Hi.
I ran the BME280 Mode Example, it runs perfectly. I’m very surprised how accurate and sensitive this little chip is, just a few inches off my desk and it detects a pressure and temperature change from me lifting it.

Got this BMP280 code open on the right of my screen and the BME280 Mode Example open on the left of my screen. What was that phrase you used?

Been staring at it for 2 hours now, don’t even know where to start. :grimacing:

Maybe start with the DOCS

http://docs.blynk.cc/

and they try working through a few of the examples on sketch builder

https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=GettingStarted%2FBlynkBlink

Once you have a more basic understanding of BLYNK and how it works, you will have a better idea of where to start with your BME project.

1 Like

@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… :disappointed:

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.

1 Like

@Toro_Blanco Been trying that, get a lot of orange writing at the bottom of the Arduino IDE. Only about 5% of it makes any sense. :astonished: