
Temperature control with ESP8266 NODEMCU - Temperature regulation project
Materials:
- ESP8266 NODEMCU
- DHT11 Sensor
- 5volt Relay Module
- Reptile Heat Mat
- Display Module
Operation:
-
The operation is simple, my intention is to regulate the temperature of a closed space when it is below 24 degrees Celsius. This is useful for the care of animals or for temperature regulation of plants, by adding a relay module with higher voltage and amperage capacity.
-
An optimal temperature range has been applied in which it is desired to operate. When the minimum temperature is reached, the relay is turned on, providing power to the heat mat. When the maximum temperature is reached, the relay is turned off, cutting off power to the heat mat and thus reducing the temperature. All this configuration is done from a web browser.
-
From a computer or mobile device, you can access the browser to view the current temperature and humidity in real time, as well as the current temperature range configuration. The configuration can also be modified with a minimum and maximum temperature along with a user that serves as an authenticator.
- The data is stored in the GCLOUD cloud, specifically in RealtimeDatabase.
- As can be seen, Celsius degrees, humidity, date, and time are stored. Later, the data is downloaded in JSON format and regular expressions are used to work with it.
- At this point, the project is up and running, collecting data for monitoring purposes.
Data Analysis
-
For the analysis, Python is used because it allows sorting the data and generating graphs.
-
Since the information is in RAW format separated by a pipe " | ", regular expressions are used to sort the information and transform it into a dataframe using pandas.
- The temperature configuration set was a minimum of 27 degrees and a maximum of 28 degrees. After performing a descriptive analysis of the data, it can be determined that:
-
There are a total of 2824 data points, with an average temperature of 27.67 degrees and a standard deviation of 0.18. The data shows that a minimum of 22.6 degrees and a maximum of 29.10 degrees were reached. When sorting the data, it can be observed that 25% of the temperatures are at 27.6 degrees, 50% at 27.7 degrees, and 75% at 27.8 degrees, which is consistent.
-
The number of data points for each temperature reached is counted:
- The following graph shows the average temperature over the past 7 days.
- The following graph shows the past two weeks.
- A weak correlation can be observed between humidity and temperature.
- This fact is corroborated in the following scatter plot (average temperature and humidity per day).
- Additionally, the graph of total temperature and humidity per day is shown.