---
title: "Room Thermostat – Arduino + Ethernet"
url: "https://maker.wiznet.io/teju/projects/room-thermostat-%E2%80%93-arduino-ethernet/"
markdown_url: "https://maker.wiznet.io/teju/projects/room-thermostat-%E2%80%93-arduino-ethernet/md"
type: "UCC: User Created Content"
author: "martinius96"
author_url: "http://deadawp.blog.sector.sk/blogclanok/13223/izbovy-termostat-arduino-ethernet.htm"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "martinius96"
original_url: "http://deadawp.blog.sector.sk/blogclanok/13223/izbovy-termostat-arduino-ethernet.htm"
published: "2023-02-02"
language: "en"
likes: 1
views: 543
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Room Thermostat – Arduino + Ethernet

> Arduino is a handy embeeded platform that can be used, for example, to build a room thermostat, which we will show today.

Original author: martinius96 (source: http://deadawp.blog.sector.sk/blogclanok/13223/izbovy-termostat-arduino-ethernet.htm)

## Documents and links

- [martinius96 / termostat-ethernet](https://github.com/martinius96/termostat-ethernet) (code): Thermostat - Arduino + Ethernet Wiznet W5100 / W5500

## Article

**In terms of hardware, the project uses:**

- Arduino Uno / Nano / standalone chip AtMega328P

- Ethernet shield Wiznet W5100 / Ethernet module Wiznet W5200-W5500

- DS18B20 temperature sensor on the OneWire bus

- Relay SRD-5VDC-SL-C used for boiler switching

The electromagnetic relay SRD-5VDC-SL-C, which is used in the project, allows switching up to 10A at 230V – power 2300W. In the 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 when the relay is open. When switched on below 200mA at 5V supply.

**The web interface for the thermostat allows you to:**

- View real-time temperature from DS18B20 sensor

- View real-time relay status with dynamic output change on the 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

**Boiler ON / OFF control:**

![](https://www.dixell.cz/wp-content/uploads/GRAF3-1024x509.jpg)
The web interface is designed to accommodate larger and smaller screens. It is responsive, supports widescreen high-definition screens as well as mobile devices. The interface uses imported CSS styles of the Bootstrap framework from an external CDN server, which loads the client-side device when opening a page running on Arduino. Because Arduino Uno is memory limited, it can only run pages with a few kB in size. By importing CSS styles from an external server, it will reduce the performance and memory load of Arduino. Program implementation (for Arduine Uno) uses 70% of flash memory (32kB – 4kB Bootloader) and 44% of RAM (2kB).

Static parts of the website (HTML document header and footer, Bootstrap CSS linking, meta tags, HTTP response header, Content Type, form and more) are stored directly in the Arduino flash memory, which can significantly reduce the amount of RAM used for user-generated content. The web server is thus more stable and can handle multi-connection of several devices in the network at the same time.

In order to keep the set values ​​even after a power failure, they are stored in the EEPROM memory of the Arduino. Reference temperature to offset 10, hysteresis to offset 100. Each of the values ​​occupies a maximum of 5B in the EEPROM memory. The EEPROM transcription limit is at the level of 100,000 transcripts. Data is only overwritten when the HTML form is submitted. If the device does not have anything stored on the mentioned EEPROM offsets at the first start-up, automatic recording will be performed with default values ​​- reference: 20.25, hysteresis 0.25 ° C

The Refresh meta tag refreshes the entire Arduino page every 10 seconds. By this time it is necessary to write the change for the thermostat, otherwise the input windows will be reset when the page is refreshed. Because the Ethernet library does not include the use of an asynchronous web server, the entire page must be rewritten. The dynamic data that changes in particular is the current value of the output – On / Off.

**Target – reference temperature and hysteresis registration form:![](https://i.imgur.com/9EOOqlW.png)![](https://i.imgur.com/NZrCgGH.png)Process of processing the entered data (user redirection):**
![](https://i.imgur.com/k9J9DFG.png)

---

Source: https://maker.wiznet.io/teju/projects/room-thermostat-%E2%80%93-arduino-ethernet/
