Temperature, Humidity Monitor – Arduino Mega + Ethernet W510

Temp / Humi monitor with Arduino mega and Ethernet shield W5100
ORIGINAL POST
By martinius96
components
Hardware Components
Arduino Mega 2560
X 1
Wiznet W5100 Ethernet shield
X 1
8x DS18B20 temperature sensor on OneWire bus
X 8
digital temperature and humidity sensor DHT22 (AM2302
X 2
temperature and humidity sensor SENSIRION SHT21 (Si7021)
X 1
BOSCH BME280 temperature and humidity (and air pressure) sensor
X 1
Sends data from all sensors at once in several minutes (can be modified)
X 1
details

1-4.png

Step 1: Introduction

Today I will present in detail the last realized project, which is quite complex in terms of functionality, number of sensors used, Arduino boards, used data buses. The project consists of two modules. Physically each module consists of a separate Arduino Mega 2560, Ethernet shield W5100 (R3 compatible) and the sensors it uses.

Each module communicates with the web interface on the Internet by HTTP POST requests, by which the web server sells data or request some data, for example via POST request (module 2 only). The web interface is completed with a login system, while the whole family can register to the system, each with its name and password.

It is therefore a multiuser application where each family member has an overview of both modules and can perform different actions – setting the reference temperature, control thermometer, etc. Web interface is programmed in PHP, data are stored in MySQL database. Each of the modules has a separate table in the database for data. Consider the individual modules in more detail.
Step 2: Module 1 – FLAT

The whole module 1- FLAT serves only as a temperature monitor in individual rooms, it has no other role. DHT22 sensors were used over a long distance using a suitable 10kohm pullup resistor to record humidity in the bathrooms. Since the BME280 and SHT21 communicate over the I2C bus and this is considerably limited in terms of bus driver lengths, sensors are used near Arduino in rooms.

The DS18B20 temperature sensors have been divided into 4 buses, as two external sensors are used, making it easier to connect them to separate Arduino outlets and, in the event of a sensor drop, it is easier to replace as it does not paralyze the functionality of the system.

For example, in the case of one of these OneWire buses, on which 4 sensors are indexed. The index is linked with the physical address of the thermometers, so if one of the sensors is exchanged, the new sensor may appear on the index 0 – initial, or even 2, 3 or last. Thus, by reducing the number of sensors on the buses, we can avoid such a complication that can occur when the sensor is replaced.
Step 3: Module 2 – BOILER

In addition to the monitor function, the module 2 – BOILER also has a more important role, namely the control of solenoids or relays for the control of radiator valves. The module operates independently of domestic heating. Module does not switch heating or boiler.

The module only takes care of opening, closing the radiator valve, if the room temperature is lower / higher than the set – so-called. reference temperature. Each room where the radiator valve is controlled can be assigned a specific thermometer from module 2. In addition to this – automatic mode, there is also a manual mode where the valve can be opened / closed manually from the web interface indefinitely – hard.

The digital inputs can be used to verify that the solenoid / relay / valve has been opened / closed upon request with Arduina – the ability to compare whether the output is equal to the input.
Step 4: What Web Interface Offers?

For both modules there is also a graphical representation of a line chart for the development of individual variables – temperature, humidity in 24 hours, 7 days.

The web interface also offers viewing of maximum / minimum, average value in 24 hours, 7 days for each thermometer / hygrometer. In module 1, a pair of SHT21 sensors was initially considered, but since they have no possibility of changing the I2C address, it would be necessary to use a multiplexer for one bus communication from two sensors with the same I2C address. In case of faulty sensor data, the sensor name is stored in a log that the system administrator can open at any time to service the OneWire bus and replace the faulty sensor, for example.

Watchdog has been implemented in Arduino programs, which in case of faulty initialization, “freezing”, another error safely restarts and at the beginning of the program turns off all outputs until the connection to the web interface is established, where it is fully synchronized in terms of outputs, which it subsequently applies.

1-4.png

Step 1: Introduction

Today I will present in detail the last realized project, which is quite complex in terms of functionality, number of sensors used, Arduino boards, used data buses. The project consists of two modules. Physically each module consists of a separate Arduino Mega 2560, Ethernet shield W5100 (R3 compatible) and the sensors it uses.

Each module communicates with the web interface on the Internet by HTTP POST requests, by which the web server sells data or request some data, for example via POST request (module 2 only). The web interface is completed with a login system, while the whole family can register to the system, each with its name and password.

It is therefore a multiuser application where each family member has an overview of both modules and can perform different actions – setting the reference temperature, control thermometer, etc. Web interface is programmed in PHP, data are stored in MySQL database. Each of the modules has a separate table in the database for data. Consider the individual modules in more detail.
Step 2: Module 1 – FLAT

The whole module 1- FLAT serves only as a temperature monitor in individual rooms, it has no other role. DHT22 sensors were used over a long distance using a suitable 10kohm pullup resistor to record humidity in the bathrooms. Since the BME280 and SHT21 communicate over the I2C bus and this is considerably limited in terms of bus driver lengths, sensors are used near Arduino in rooms.

The DS18B20 temperature sensors have been divided into 4 buses, as two external sensors are used, making it easier to connect them to separate Arduino outlets and, in the event of a sensor drop, it is easier to replace as it does not paralyze the functionality of the system.

For example, in the case of one of these OneWire buses, on which 4 sensors are indexed. The index is linked with the physical address of the thermometers, so if one of the sensors is exchanged, the new sensor may appear on the index 0 – initial, or even 2, 3 or last. Thus, by reducing the number of sensors on the buses, we can avoid such a complication that can occur when the sensor is replaced.
Step 3: Module 2 – BOILER

In addition to the monitor function, the module 2 – BOILER also has a more important role, namely the control of solenoids or relays for the control of radiator valves. The module operates independently of domestic heating. Module does not switch heating or boiler.

The module only takes care of opening, closing the radiator valve, if the room temperature is lower / higher than the set – so-called. reference temperature. Each room where the radiator valve is controlled can be assigned a specific thermometer from module 2. In addition to this – automatic mode, there is also a manual mode where the valve can be opened / closed manually from the web interface indefinitely – hard.

The digital inputs can be used to verify that the solenoid / relay / valve has been opened / closed upon request with Arduina – the ability to compare whether the output is equal to the input.
Step 4: What Web Interface Offers?

For both modules there is also a graphical representation of a line chart for the development of individual variables – temperature, humidity in 24 hours, 7 days.

The web interface also offers viewing of maximum / minimum, average value in 24 hours, 7 days for each thermometer / hygrometer. In module 1, a pair of SHT21 sensors was initially considered, but since they have no possibility of changing the I2C address, it would be necessary to use a multiplexer for one bus communication from two sensors with the same I2C address. In case of faulty sensor data, the sensor name is stored in a log that the system administrator can open at any time to service the OneWire bus and replace the faulty sensor, for example.

Watchdog has been implemented in Arduino programs, which in case of faulty initialization, “freezing”, another error safely restarts and at the beginning of the program turns off all outputs until the connection to the web interface is established, where it is fully synchronized in terms of outputs, which it subsequently applies.

documents
Code
https://arduino.php5.sk?lang=en

COMMENTS

Please Login to comment
  Subscribe  
Notify of