Redkea: BME280 weather station

0
Some of the links on this blog are affiliated links. READ MORE

Creating a weather station using Redkea, ESP8266 Thing from Sparkfun and Weather Click from MikroElektronika? It should have been fairly simple, but it wasn’t. Murphy’s law applies just fine to this project: If anything can go wrong — it will. What was supposed to take one day to complete it took me four days, with a lot of issues to solve. But finally it works, and now I’m able to share my experience with this weather station.

First, the software. Redkea is fine, all I had to do is to create a new project, add three widgets (temperature, pressure, and humidity) and generate the code.

Then it came the hardware. Also it should have been fairly simple. Just connect the Weather click to the ESP8266 Thing – both are 3.3V devices, no issues here, then add a humble FTDI programmer (also in 3.3V version) and it should work.

Redkea: BME280 weather station hardware

Redkea: BME280 weather station hardware

Nope! It didn’t. Every time I left the FTDI board connected, the ESP8266 Thing wouldn’t work. A quick look into the serial terminal showed that the board was stuck in boot mode, with baud rate 74880 and it was just spitting out the message ets Jan 8 2013,rst cause:2, boot mode:(1,6).

It turned out the cause was the DTR line, which caused the ESP8266 to reset while using the serial terminal. The problem was easily fixed by cutting the DTR trace on the back side of the ESP8266 Thing and installing a jumper instead. Close the jumper for programming, open the jumper for normal mode. One day lost to figure it out.

ESP8266 Thing: disabling DTR

ESP8266 Thing: disabling DTR

Then it came the BME280, which refused to work. I moved it to a 3.3V Arduino Pro, with the same result. The problem turned to be that I used the code library from Adafruit. As a side note, I have used many code libraries from Adafruit in my projects, as those are some of the best libraries around.

Not in this case! All I could get was BME280 test Could not find a valid BME280 sensor, check wiring!

Weather click: testing I2C communication on Arduino Pro

Weather click: testing I2C communication on Arduino Pro

Finally, I went with the code library from Sparkfun (get it from https://github.com/sparkfun/SparkFun_BME280_Arduino_Library). This worked fine, and I was able to make the BME280 work both on the Arduino Pro and the ESP8266 Thing. One more day lost while searching for a good code library.

As a side note, I found that BMP280 and BME280 have the same footprint, and the code libraries for BMP280 work also with BME280, but you won’t be able to read the humidity. Another source of problems.

ESP8266: BME280 Weather station code for Redkea

Finally, the code. All you have to do is to replace the SSID and Password for your WiFi network, and insert the deviceID generated by Redkea.

Besides the code generated by Redkea, I have added the code lines for initialization of Weather Click / BME280, as in the I2C example.

As one can see, the code for the widgets is writeen by the user, starting from the template in teh Redkea generated code.  There are three widget codes, corresponding to the widgets created in the Redkea dashboard. Inside each widget a parameter is read, either temperature, humidity or pressure. Then the value is converted to a string and passed to the redkea.sendToTextWidget(widgetID, string); function.

Redkea BME280 weather station

Redkea BME280 weather station

Share.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.