IoT applications are growing at a very fast rate and has been influencing our lives for the past several years. The potential spectrum of IoT applications is endless, and smart homes are still the most popular IoT application among consumers. Our homes are becoming smarter day by day. The need for smart home devices is increasing exponentially and predicted that we will have over a billion devices by 2023.
Smart Home is a relative term as for some people it just means using the smart speakers and smart thermostats for others it might include smart bulbs, smart locks, or smart security cameras. These home devices like bulbs, cameras, and thermostats have existed for a long time, but what makes them smart now? Sense and adaptability, intuitive user interface, connectivity to cloud, and secure execution environment are the main factors which make them smart. This article covers various aspects of such smart home designs and presents how to implement them.
In this part, we will cover general Smart Home market trends, user interface, and sensing requirements. In part 2, we will cover connectivity and security requirements for devices intended for the Smart Home market.
IoT technology is transforming ordinary households into Smart Homes. People enjoy the power to control their entire house through an integrated network. We live in an era where a smart device reminds us to carry an umbrella based on weather conditions. The need for smart home devices is increasing exponentially and predicted that we will have over a billion devices by 2023. The trend for smart home devices is shown below (Figure 1).
Smart Home Devices
Human beings have thrived a few hundred thousand years because of their one inherent quality: human-to-human interaction. It is not so surprising for humans to expect their devices and gadgets to behave similarly. This ability for gadgets to connect to each other or to a network, is what takes them a step closer to being smart. Smart controller/processor and connectivity devices are required to implement the functionality needed by these Smart Home devices. The demand is to use controllers that integrate as much of features possible, to design a unique solution at the best cost. The most important features include displays with rich graphical user interfaces, touch and sense to take inputs from users and environments, connectivity to exchange data and cloud processing, secure execution environment for data logging, attested and encrypted application execution, secure over the air (OTA) updates etc., as shown in Figure 2.
Figure 2: Key capabilities required of a Smart Home device
- Display Interface: Display with rich graphics user interface. MCUs provide interfaces such as RGB, Intel 8080, SPI, I2C etc. for driving displays.
- Touch and sense to take inputs from users and the environment. The need is to have MCUs with integrated touch capability and flexible peripherals for analog and digital sensor interfaces.
- Processing Capability: MCUs need to have a processor core like the Cortex-M4 for handling the extensive processing needs of smart home applications.
- Connectivity to exchange data with cloud and other devices in the household. WiFi and Bluetooth are the most popular interface for cloud and local connectivity.
- Secure execution environment for storage, operation, and communication.
Display and Graphics
The user interface is the one of the most important features, as this is the first point of contact between the user and the smart device. Most smart devices offer a variety of methods to interact with users, including in-built display, smartphone, remote controller, voice control, etc. Devices with a in-built display are the most popular, as users can interact without having to have another extra device, thereby saving costs. Usually, in-built displays are touch capable with an informative GUI to make the device as easy to use for the user.
Serial Peripheral Interface (SPI), Inter-integrated Circuit (I2C), RGB (Red Green Blue), Mobile Industry Processor Interface (MIPI) etc., are some of the trending display interfaces. Each type has its own advantage in terms of pins used, bandwidth, display size, and refresh rates.
The RGB interface is quite popular among the display interfaces for smart home applications, as it can drive medium-sized displays at a reasonable color depth and good refresh rates, and at the same time cost-effective. But driving an RGB interface usually requires a dedicated graphics IP implemented in an MCU. Typically, MCUs don’t come with an integrated controller. Those MCUs with integrated graphics IP tend to be more costly and are often overkill for a smart home application.
In this article, we will explain an innovative way of driving these displays using simple MCU peripherals (without CPU intervention) thereby providing a cost-effective approach to this problem. Before we show how to implement a display controller using an MCU without dedicated costly graphic IP, let’s spend some time understanding the RGB interface. A RGB interface is a parallel interface in which the Red, Green, and Blue pixels of a display are driven directly. It requires 2 sets of signals called Control signals and Pixel data. Control signals consist of Vertical Sync, Horizontal Sync, Data Enable, and Dotclock. The control signals are shown in figure 3 below.
If we observe these signals closely, we can see that these signals are PWMs synchronized in a specific fashion. The pixel data which determines the color of the pixel must be sent to the display in sync with dotclock and data enable. This can be accomplished using a DMA. Along with PWMs and the DMA, some logic is required to implement the control signals. One such implementation using a PSoC 6 connectivity device is shown below in Figure 4 using PWMs, DMA, and Smart IOs (for the logic functions).
There are several ways to get the same result by interchanging the positions of PWM blocks. It all comes down to what and how many IPs the underlying chip offers. You may also notice the logical AND block placed in Figure 4. It can be replaced by any hardware block that performs the required AND operation (like Smart-IO in PSoC 6). The synchronization between the blocks (and ultimately between the control signals) is achieved through a common source clock and PWM’s alignment. The one important factor that should be noticed is that this implementation requires zero CPU utilization to continuously drive the display.
Now that the hardware implementation is ready, we need appropriate firmware to complete the graphics interface. There are lot of embedded graphics libraries which can take care of graphics operations; one such example is the emWin graphics library. This library needs just a driver to communicate to the hardware. The APIs provided by the library abstract out the underlying graphics hardware for the user, greatly simplifying GUI designing.
Touch screens have completely changed the way we interact with devices. They are so intuitive and convenient for users to operate without any learning or training. For many OEMs, this alone is the major driving factor to use a touch screen in a smart device. The two most popular touch screen types are Resistive and Capacitive.
Resistive touch works by making the top layer come in contact with the bottom layer when it is touched. This closes a circuit, giving the point of touch. Resistive touch is generally used for single touch detection. Capacitive touch works by detecting the capacitance change on the sensing layer when it is touched. Capacitive touch can detect multiple touch points and requires less physical force when compared to resistive touch. Capacitive touch screens are the ones mostly used in smart home applications. Several MCUs offer integrated solutions to interact with capacitive touch panels/screens (i.e., the CapSense peripheral in a PSoC 6 MCU).
Touch sensing in Smart Home Applications
Given the ease-of-use, durability, and responsiveness of the capacitive touch technology, resistive screens are a thing of the past. Nowadays, the question is not about picking a resistive or capacitive touch screen but rather, what level of capacitive touch solution to use in an application with a given requirement. Capacitive touch screen solutions range from simple, cost-effective single touch solutions to a feature-rich multi-touch solution with water resistance and hover support.
For a simple Smart Home graphical user interface needed for a device such as thermostats or coffee machine, a simpler, cost-effective implementation is preferred. Alternatively, a more complex GUI such as a Smart home central controller running a full-fledge operating system needs a feature-rich implementation to give users access to all of the available functionality. In the end, it is a trade-off between cost vs features the touch screen provides.
Many OEMs offer MCUs with integrated capacitive sensing to simplify design and lower system cost. For example, the PSoC 6 MCU family provides a whole range of capacitive touch solutions required for a smart home application. It offers CSD self-capacitance method for simple single touch solutions, CSX mutual-capacitance method for multi-touch solutions, and a dynamic combination of both to provide a multi-touch solution with water resistance, proximity, and hover support. Depending upon the application, resistance to noise (signal-to-noise ratio) and water-resistance may be an important consideration. From a software perspective, it is also important to have access to intuitive tools. For example the CapSense configurator and middleware library combined with ModusToolbox IDE greatly simplify touch sensing implementations.
As touch and graphics go hand to hand, embedded graphics libraries usually also have APIs to process touch. The user application should obtain the x-y co-ordinates of the touch points through a touch library, then pass these co-ordinates to the graphics library to perform the intended operations. The graphics library also provides tools to create the UI required for the smart home device.
Additionally, proximity sensing is widely used to wake up the device from low power modes. This ensures that the display and touch processing are off when the device is not being used. Capacitive touch processing will usually be capable of processing proximity also using the same sensors.
Sensing the Environment
One of the factors that made Smart Home devices a success is their ability to sense their surroundings without human-device interaction. By knowing its surrounding conditions, devices can have algorithms make interpretations and give suitable options for users. Some of the widely used sensors and their applications are:
- Motion Sensor: Used in home security systems. Alerts the owner if there is a motion at unexpected time.
- Temperature Sensor: Used in thermostats and closed loop temperature control systems.
- Ambient Light Sensor: Used in automatic lighting systems for gardens and other areas of interest.
- Smoke Sensor: Used in automatic fire extinguishers.
- Soil Moisture and humidity sensor: Used in automatic plant watering systems; Smart Gardening
Sensors provide the data, and it is the MCU that does the real processing. Sensors can be broadly classified as analog and digital sensors. Analog sensors provide sense data in the form of an analog voltage/current and digital sensors provide sense data in the form of digital counts based on a configured range.
To read analog data, you need an ADC (Analog to Digital convertor). Most MCUs (like PSoC 6) provide integrated ADCs to perform this analog to digital conversion internally. Sometimes the analog signals might have to go through some pre-processing (like amplification, filtering etc.) before conversion. If programmable peripherals like OpAmps are part of the MCU itself, preprocessing can be handled internally as well.
Many sensors have extra circuitry which processes analog data and output digitally. This digital data is usually sent out over a serial communication bus. This not only offloads processing on the MCU side but also samples the data faster. The main downside of digital sensors is their higher cost due to their extra circuitry.
To sum up, if you are concerned about the design cost and area, it is more cost-efficient to select an MCU which can process analog data efficiently. The MCU should also be flexible through configurability and programmability of its peripherals to adjust them to match the requirements of the application.
Stay tuned to part 2 as we will cover connectivity and security requirements for smart home markets along with a solution that integrates all the requirements including user interface, sensing, connectivity, and security.
Jaya Kathuria Bindra works as a Sr Manager Applications Engr at Cypress Semiconductor Corporation where she is managing the Embedded Applications Group and Solutions Development using the PSoC and WiFi/BT platform. She has 15+ years of experience in the Semiconductor Industry. She earned her MBA credential from IIM, Bangalore and holds a bachelor’s degree in Electronics Engineering from the Kurukshetra University. Jaya can be reached at email@example.com.
Yeshwanth KT is an Applications Engineer at Cypress Semiconductor Corporation. He works on embedded application development with Cypress’ PSoC platform. He has 2+ years’ experience in Embedded System and Solution development. He holds a bachelor’s degree in Electronics and Communication Engineering from SJCE Mysuru. Yeshwanth can be reached at firstname.lastname@example.org.
Meenakshi Sundaram is a Principal Applications Engineer at Cypress Semiconductor Corporation. He works on Bluetooth low energy and System-on-Chip solution development with Cypress’ PSoC platform. He has 9+ years’ experience in Embedded System and Solution development. He holds a BS degree in Electronics and Communication Engineering from Anna University. He can be reached at MEENAKSHI-SUNDARAM.RAVINDRAN@cypress.com.