Step 1: Description of the Ethernet Thermostat
Arduino is a handy embeeded platform that can be used, for example, to build a room thermostat, which we will show today. The thermostat is accessible from the LAN network in which it is located, while it is equipped with a web interface which is used to configure all elements of the thermostat. The web interface runs directly on the Arduino in web server mode. The web server allows the running of several independent HTML pages, which can be informative or even functional. The web server runs on port 80 – HTTP.
The electromagnetic relay SRD-5VDC-SL-C, which is used in the project, allows switching up to 10A at 230V – power 2300W. In case of switching a DC circuit (load) it is possible to switch 300W (10A at 30V DC). Alternatively, the OMRON G3MB-202P SSR relay is fully compatible for the wiring diagram, which is only suitable for non-inductive loads and exclusively for AC circuits. Maximum switching power 460W (230V, 2A). Consumption of Arduino with Ethernet shield and other peripherals is at the level of 100-120mA with the relay open. When closed, below 200mA at 5V supply.
Step 2: Web Interface
The web interface for the thermostat allows:
- View the real-time temperature from the DS18B20 sensor
- View real-time relay status with dynamic output change on page
- Modify the target (reference) temperature in the range of 5 to 50 ° C with a 0.25 ° C step
- Modify the hysteresis in the range 0 to 10 ° C with a 0.25 ° C step
HTML pages running on Arduino:
- / – root page containing the form, current logic output listing for the relay, temperature
- /action.html – processes values from the form, writes them to the EEPROM memory, redirects the user back to the root page
- /get_data/ – distributes data on current temperature, reference temperature and hysteresis to a third party (computer, microcontroller, other client …) in JSON format