BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Using BME280 (Not BMP) with Blynk

Please fprgive my “noob” question. Where would I find the " char server[] = “*********”; " required in this code?

@Shadeyman That line assumes you are running a Local Server and the contents would be your IP of said server.

char server[] = “192.168.1.2”; etc.

1 Like

@GTT Thanks for a swift reply, now I understand the code a little better. I’ll get there one day, probably not this year, but one day … Lol

@GTT 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.

http://docs.blynk.cc/#blynk-firmware

1 Like

@GTT So id need to remove:

and replace it with:

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

@GTT And change:

to

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

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

1 Like

@GTT Now I feel daft. :crazy_face:

Read it again and

just had to remove:

and replace:

With

Thanks Gunner. :+1:

1 Like

@GTT 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:

@GTT 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