Espressif ESP8266 Microcontroller
The ESP8266 is a low-cost Wi-Fi device with full TCP/IP stack implementation combined with a MCU (Micro Controller Unit) produced by Shanghai-based Chinese manufacturer, Espressif Systems. The ESP8266 has 1 MB of built-in flash. It is now succeeded by the ESP32.
The device is packaged in many forms, this is a popular one:
The image also shows the current range of shields available. Here’s a list of shields:
- DS18B20 one-wire temperature sensor
- DHT11 temperature and humidity sensor (low accuracy but usable)
- Button
- SD-Card reader/writer
- W2812RGB Neopixel
- BMP180 Temperature and Pressure (very accurate)
- 0.66″ OLED Display (I2C bus)
- SHT30 temperature and humidity sensor (very accurate)
- LiPo Battery charger and backup supply (from battery)
BME280 Weather Station With ESP8266
Overview – The purpose of this project is to create a weather station using a Bosch BME280 sensor that provides temperature, air-pressure and humidity which is connected to an ESP8266. Software is developed using the Arduino IDE with extensions for the ESP8266.
The sensor is connected directly to the ESP8266 and uses an I2C bus provided by the ESP8266
Hardware:
· ESP8266 module
· BME280 breakout
· 3.3V power supply
Software:
· Arduino IDE for ESP8266
Sensor – the BME280 sensor was developed specifically for mobile applications where size and low power consumption are key design constraints. The unit combines individual high linearity, high accuracy sensors for pressure, humidity and temperature together with extremely fast response times which supports performance requirements for emerging applications such as context awareness, and high accuracy over a wide temperature range.
The pressure sensor is an absolute barometric pressure sensor with features exceptionally high accuracy and resolution at very low noise. The integrated temperature sensor has been optimised for very low noise and high resolution. It is primarily used for temperature compensation of the pressure and humidity sensors and can also be used for estimating ambient temperature.
The BME280 supports a full suite of operating modes which provides the flexibility to optimise the device for power consumption, resolution and filter performance.”
The sensor image Shows the sensor module and 3 pads for changing the I2C address, which is set for 0x76. Other sensors such as the Adafruit version have their address set to 0x77 and matches their supplied library. 0x77 is the default address for the BMP85 or BMP180 and you need to change the address in the library accordingly. The board also has a 3.3V regulator.
Connections – can be found here soon
Software – can be found here soon
ESP8266 Compass
An ESP8266 display a compass heading on a 64×48 OLED Wemos display shield.
ESP8266 Client Data Extraction
How to get Client data into a Webserver running on an ESP8266
ESP8266 Autonomous Graphing Data Logger
An ESP8266 is configured as a webserver using the Wi-Fi Manager to read and log temperature and humidity from a variety of sensors using the WemoS shields and then displays the results using Google Charts. Any ESP8266 can be used.
There are four versions so-far using:
1.BOSCH BME280 to display temperature, humidity, dewpoint and pressure
2.SHT30-D to display temperature, humidity, dewpoint
3.DHT22 to display temperature, humidity, dewpoint
4.DHT11 to display temperature, humidity, dewpoint
The design gives a totally self-contained and apart from google charts, it requires no other access to external sites like MQTT or Thingspeak.
Data is recorded to an SD-Card if fitted. It recovers data from the SD-Card in the event of power failure or a restart and does this contiguously.
The log file can be checked for size, erased and streamed out to a web browser for copy/paste into a spreadsheet.
The scale of the y-axis can be varied as required.
BEWARE: As Google notes in their documentation, implementation of Google Charts is highly complex, if you modify the code, don’t be surprised if it stops working, this code is the culmination of my extensive studies into the use of Google Charts through their documentation and then my careful implementation and it also requires the correct use of the ESP8266 server functions. Some functions may seem superfluous but they are not. Any adjustment of the HTML code or attributes other than simple colour or font size changes is likely to make the code non-operational. I have noticed, but can’t explain why, that Google Charts sometimes can and can’t cope with large amounts of data for plotting, so I have reduced the amount of data sent for graphing by 2, so step size is now +2. This appears to improve graphing reliability.
ESP8266 Over-The-Air-Updates