Architecture

Smart Thermostat pretends to be flexible enough to adapt itself to the most used configurations and budgets. You can use an old Android 4.+ Android device or a Raspberry Pi3B to work as Thermostat. And you can have a wired sensor/relay or wireless sensors/relay. As you will see each setup has it own advantages and disadvantages.

General architecture of the Smart Pi Thermostat
General architecture of the Smart Pi Thermostat

General architecture

As said, you have to decide if you want to use an old Android device as Thermostat, or a Raspberry Pi 3B.

Smart Old Relic Thermostat

If you decide to use an old Android device as Smart Thermostat, all you need is a smartphone or tablet with Android 4.0+. The main thing to take in account is that you can’t connect sensors directly to a smartphone or tablet, and all the sensors will be wireless sensors.

Smart Pi Thermostat: the Smart Thermostat controlled by a Raspberry Pi 3

If you don’t have an old device, or wan’t to use a Pi3b, then Pi3 will be the brain of the Smart Thermostat. With the help of the Android Things OS, the Pi controls all the temperature sensors and the commands your boiler with the help of a relay. It will act as bridge too and communicate with the cloud to allow you to command your boiler with the Android app.

To act as an thermostat, the Pi3 need information about the current temperature at home and a relay to switch on and off your heating system (the boiler). That said, you can connect the peripherals directly to the Pi3 with proto boarding cables, or wirelessly by using an ESP 32 board as controller.

In the diagram above you can see the general architecture of the Smart Pi Thermostat.

 The temperature sensors.

To know the current temperature at your home, you will need at least one temperature sensor. You can have one temperature sensor directly connected to the Pi with a cable, and/or many wireless sensors (consisting of an ESP 32 board + an DHT11 sensor). Each configuration has its own advantages and disadvantages:

  • Wired sensor (Smart Pi Thermostat only): you can connect a BME280 temperature / humidity sensor directly to the Pi.
    • Advantages: The BME280 sensor is very accurate and delivers temperature / humidity changes very fast (many times per second).
    • Disadvantages:
      • it is more expensive than the DHT11, and you have to connect it directly to the Pi3B with a protoboard cable.
      • Because of that you have to put your Raspberry Pi 3 and the sensor attached to it, in the room that will act as reference or master to control your home heating.
      • You can have only one.
  • Wireless sensors: with the help of an ESP 32 board and a DHT sensor you can have as many remote sensors as you want. The limit is the number of available free ip addresses in your network.
    • Advantages:
      • you can have many sensors, for example, one for each room in your home. Each of them will be displayed in the Smart Thermostat App and in the Client app. You can select one of the sensor to act as master an the thermostat will command the boiler based on the information delivered by that sensor.
      • The DHT sensors are really cheap.
    • Disadvantages:
      • You have to buy an ESP32 board for each “wireless node” that you want. Although the DHT11 is very cheap, and the ESP 32 is relatively cheap, the combination of both, plus a 5V charger to give power to them, makes every “wireless node” just expensive as the BME280 (more or less).
      • The DHT11 is a very slow sensor and can not deliver information so fast as the BME280. Expect to receive not more than a few measures each minute.
      • It seems that the DHT11 is not as accurate as the BME280.

The relay

The thermostat needs a relay connected to your boiler, to switch it on and off. Make sure you buy a High Level Triggered relay. We want the boiler to be turned off when the relay does not receive a high level input. In this way, if you have a power outage at home then the boiler will be powered off too.

You have to options here:

  • Wired relay (Smart Pi Thermostat only): connect the relay directly to the Pi3. The main disadvantage is that your PI3 will have to be next to your boiler, or you need a way to connect the relay with the boiler with a cable from a room in your house.
  • Wireless relay: this is the more flexible setup, because you can connect the relay to an ESP 32 and to the boiler, and have the thermostat in another room. The main disadvantage is that you need to buy another ESP 32.

The Client App

The Client App will be the most common way to control the thermostat, specially when you are not at home. Many users can share the access to the same thermostat (for example, the members of a family).

In the following diagrams you can see the three setup configurations that are possible:

Wired only setup (Smart Pi Thermostat only).

As you can see  both, the temperature / humidity sensor and the relay are physically connected to the Pi. This is the less flexible setup, because you have to put the Pi in a room to measure the temperature, and you have to connect the relay to the boiler from the same room.

Smart Pi Thermostat architecture wired only
Smart Pi Thermostat wired only setup

 

Wireless only setup (Smart Pi Thermostat or Smart Old Relic Thermostat).

Event though in the picture a Pi is used as thermostat, it could be an old Android device using the Smart Old Relic Thermostat App as well.

This is the most flexible setup. You can have as many sensors as you will, and one relay connected to your boiler. The Smart Thermostat polls regularly the temperature sensors and the relay.

 

Wireless only setup
Wireless only setup

Mixed setup (Smart Pi Thermostat Only).

And finally you can combine wireless sensors and connected ones. In the following example there are many wireless temperature node, a wireless relay and a connected temperature sensor.

 

Mixed setup
Mixed setup

 

If you have questions or doubts don’t hesitate and ask in the forum for help.