Step 5 to build a smart thermostat using an MCU – adding network connectivity

Co-authored by Britta Ruelander, systems engineer at TI

Internet of Things (IoT) technology makes products like thermostats smarter by connecting them to the network and enabling remote user access.

The previous four blog posts of this “How to build a smart thermostat” series have covered key aspects of building a smart thermostat, including analog sensing, analog-to-digital conversion, data processing and human machine interface (HMI). This fifth blog post will discuss how to add network connectivity, a key ingredient to making your thermostat smart.

Understanding the network

Figure 1 gives a high-level overview of typical IoT components:

  • The end nodes are the “things” in IoT (in our case, it is the smart thermostat).
  • The local area network (LAN) includes a gateway device that communicates with the end nodes and connects to the internet.
  • The internet.
  • Back-end services handle remote storage and analysis, and apps.

  

Figure 1: Typical network-connected IoT system

This blog post will focus on adding connectivity to your smart thermostat end node using one of the LAN communication protocols.

Benefits of network connectivity

Adding network connectivity to a smart thermostat offers consumers many benefits, including:

  • Remote and local-area access to control and configure thermostat settings and monitor its status with a computer or mobile device.
  • The collection of thermostat data coupled with external weather data to give consumers access to data analysis so that they can optimize their energy use, thus benefitting their wallets and the environment.

Local area connectivity options

Commonly used local area wireless connectivity standards include Bluetooth®, Bluetooth low energy, zigbee® (based on the Institute of Electrical and Electronics Engineers [IEEE] 802.15.4 standard), 6LoWPAN, radio transceivers, and proprietary protocols using Sub-1 GHz frequency bands and Wi-Fi® (based on the IEEE 802.11 standard).

The wireless connectivity market is rapidly growing because of the IoT. Nevertheless, many IoT applications are connected to the Internet with wires – especially in buildings and factories. Ethernet connectivity, power line communication (PLC), RS-485, and industrial communication standards such as Fieldbus and Modbus are a few examples of wired standards.

Wired or wireless

For a smart thermostat application, you can opt for wired and/or wireless connectivity. Wireless connectivity has many benefits. It’s easy to install and scale (especially if there’s no existing wiring in place or if you need to cover areas that wiring cannot reach). It’s also cost-effective and has less maintenance overhead. On the other hand, wired connections can achieve higher network communication speeds.

With respect to local area communication security, a wired connection requires that an attacker have physical access to the cables to perform eavesdropping, man-in-the-middle or replay attacks. But wireless communication protocols have advanced encryption methods, offering increased levels of security for communicating data and sharing cryptographic keys.

In the scope of this smart thermostat application, assuming that there is no pre-wiring and no large payload for communication, we’ll focus on wireless connectivity.

Wireless connectivity options

Various wireless connectivity standards cater to different connectivity requirements, including:

  • Network range, which can range from a few meters or less (Bluetooth, Bluetooth low energy) to hundreds of meters (Wi-Fi, zigbee, 6LoPan) to even a few kilometers (with Sub-1 GHz frequency bands).
  • Data throughput, which refers to how fast a data payload is communicated and is measured in bits per second (bps). Data throughput can typically range from a low of 20kbps (Bluetooth low energy, zigbee, 6LowPAN, Sub-1 GHz) to 2Mbps (Bluetooth, Bluetooth low energy) and even 20Mbps (with Wi-Fi).
  • Battery life, which for a specific type of battery (coin cell, AA, AAA) may need to range from several months to years.
  • Network topologies, which correspond to a specific way the end nodes in the LAN connect to each other. Fundamental topologies such as star and mesh topologies are worth considering if there are multiple end nodes in the LAN.

For more details regarding these standards and a comparison of their characteristics, download the “Wireless connectivity for the Internet of Things” white paper.

It’s up to you to choose one or even multiple wireless connectivity standards to fit your smart thermostat application. TI SimpleLink™ microcontrollers (MCUs) offer a wide range of stand-alone wireless MCUs and network processors with different connectivity options. Additionally, the SimpleLink MCU software development kit (SDK) enables you to easily develop your application with different connectivity standards. With the SDK, you can add other connectivity options later on if you wish without a huge software redesign effort.

The host MCU and when you need it

In many scenarios, stand-alone wireless MCUs alone cannot support the application’s memory (code or data), inputs/outputs (I/Os) or processing power. Such cases require a host microcontroller to provide these features and interface to the network processor. For example, as discussed in the fourth blog post of this series, you may opt to include interfacing to segment liquid crystal display (LCD) or dot-matrix displays, or use voice-recognition algorithms. The more features there are in a smart thermostat, the more I/Os, processing power and memory you’ll need, so using a host MCU to offload these functions is the way to go. Figure 2 is an example block diagram of a connected thermostat with a host MCU interfacing to a network processor.


Figure 2: Typical block diagram of a smart thermostat with a host MCU and network processor

 

The SimpleLink™ MSP432™ host MCU supports up to 2MB flash and can operate up to 48MHz. More importantly, the SimpleLink MSP432 SDK offers software support for interfacing to different SimpleLink network processors. It is up to you whether you go for a Bluetooth low energy CC2640R2F or SimpleLink Wi-Fi CC3120 SDK plug-in.

Finally, here are the key takeaways from our fifth blog post:

  • Network connectivity adds many benefits to thermostat applications, including remote access to configure, control and monitor the thermostat, while additionally enabling energy optimization.
  • You can choose from various wired or wireless standards based on pre-wiring options, network range, data throughput and power consumption.
  • Consider using a SimpleLink MSP432 host MCU along with the SimpleLink network processors for enabling features to your smart thermostat application which requires more performance, memory and IO.
  • Get started with adding smartness to your thermostat application now and take a look at the TI SimpleLink™ MSP432 SDK and get some inspiration!


Make sure to check out the next post in this series about energy optimization for your smart thermostat. 

Additional resources: