Skip to content

A Temperature, Pressure and Humidity Logger based on the BME280 environmental sensor

Notifications You must be signed in to change notification settings

Ardelean-Calin/ESP8266-BME280-Weather-Station

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructions

Before executing the instructions below, make sure you created an account on Ubidots with three variables on it.

The BME280 is, by default, assumed to be connected this way:

VCC -> 3.3V

SDA -> GPIO13(aka pin no. 7)

SCL -> GPIO14(aka pin no. 5)

GND -> GND

Make sure your ESP8266 has a version of NodeMCU with the following modules installed: bme280, file, gpio, http, i2c, net, node, tmr, uart, wifi. Some, such as http might not be needed, however this is the configuration I had on my ESP8266.

Using the Lua interactive prompt, make sure you configure your Wi-Fi connectivity so that the settings get saved on the ESP8266 flash. This can be done with the following commands:

wifi.setmode(wifi.STATION)
-- wifi.setphymode(wifi.PHYMODE_B)  -- Optional, longer range but less battery life
wifi.sta.config(your_ssid, ssid_password, 0)  -- 0 means no autoconnect

NOTE: All the above settings are persistent. Even after restart, these commands do not need to be set again. This is why you don't see them anywhere in the init.lua again. See the wifi module's documentation for more info.

Edit the init.lua file with your details. To get the temp_url, pres_url and humi_url for your case, navigate to your Ubidots dashboard and click the API credentials button:

API Credentials button

Then copy your default Token from there:

Token

You also need the label of your variable source:

Variable source

As well as the label of each variable:

Variable label

Now form the URL for each variable like this:


http://things.ubidots.com/api/1.6/devices/device_label/variable_label/values?token=your_token

Replace each URL in the init.lua file. For more details, see how to send data to Ubidots.

Finally, using a tool like NodeMCU Uploader, upload the init.lua file to the ESP8266 and then restart the device.

nodemcu-uploader upload init.lua

Your weather station should now work.

About

A Temperature, Pressure and Humidity Logger based on the BME280 environmental sensor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published