1798

This article highlights ease of use and implementation for ESP8266 as a Webserver.

Today I will briefly introduce the wifi thermometer project. The thermometer uses the wifi chip ESP8266 on the NodeMCU v3 Lolin development board. The Wifi chip, in addition to recording data, also holds the web server where it reads the measured data. Data is always measured when loading the page. Inactivity data is not recorded. The web server allows you to run HTML + CSS code, which allows to some extent to create a nice graphical interface for rendering the temperature to the user for example in a table. Javascript can also automatically update the data on the page, but I did not use this option was not necessary.

There are two versions of this project, and the functionality of the website is the same. In both cases, the ESP8266 runs a webserver that renders temperatures to the table. Versions distinguish connectivity. In one case, it is possible to use the already existing LAN network to which the board connects and maintains a webserver on a static or dynamic IP address. The user, after entering the IP into the browser window, receives a page from ESP with temperatures.

In the latter case, the board transmits its own SSID in AP mode as an access point. The user accesses the board by entering the password into the network (included in ESP8266). The board transmits a SSID with WPA / WPA2 PSK encryption or an open wifi network. Data is accessible only within the reach of this wifi network outside the LAN of the home network. The ESP also runs a DHCP server that, after successful user authentication, assigns an IP address from the range. The website is located on the gateway IP address - ESP.

Temperature data is recorded from a pair of DS18B20 temperature sensors that are connected to a OneWire bus that allows one-wire data collection with the possibility of pulling the driver to ten to hundreds of meters. DS18B20 are manufactured in two main versions - an interior sensor in a transistor package, or a waterproof - exterior design in an aluminum tube. The OneWire bus is suitable for interference environments, and up to 256 sensors can be connected to it. The individual sensors are divided by their factory address - the serial number. There are 2 main options for connecting the sensors. Normal connection and parasitic, in both can be powered to 3.3 - 5.5V.

More about the project can be found on the web: https://arduino.php5.sk/wifi-teplomer.php and learn more interesting info about the project.