MCUs as Sensor Hubs

Today’s cell phones, tablets, and other wireless digital devices now include various sensors that provide position, direction, altitude, proximity, and touch-sensing capabilities. These sensors each provide a data output stream that must be captured and processed by the host system’s main processor or by a chip — optimized to handle multiple sensor data streams and preprocess these data streams into a form that the host processor can easily assimilate. Routing all the sensor data streams to the host processor can present challenges due to limited pin counts and board space that may already be pretty congested by all of the other functions in the system.

Thus, the use of a sensor hub that collects all the sensor data, performs some preprocessing, and then sends a single, compressed data stream to the host processor can simplify system design, and lower system power consumption. The lower power is a result of two factors — first, the host processor does not have to handle interrupts or other tasks that service the sensor data, and second, a low-power microcontroller that serves as the hub can manage most of the sensor data, preparing it for efficient transfer to the host using either the I²C serial bus for low-to moderate data transfer speeds (sub-500 kbits/s), or the SPI bus for higher data rates (up to several Mbits/s).

Today, most processing of sensor data is done by software running on an application processor. However, if the sensors must continuously run in the background, using the application processor would increase the system’s power consumption — a situation not desirable in handsets and tablets since they have limited power budgets. Handsets and tablets typically have over a dozen sensors — not just motion sensors, but also microphones, light sensors, touch screens, proximity sensors, and perhaps even temperature and humidity sensors to provide activity monitoring, voice-command operation, and contextual awareness, to name just a few uses. Thus, the need for a low-power solution becomes crucial.

The creation of a sensor hub — typically a dedicated microcontroller from suppliers such as Atmel, NXP, STMicroelectronics, and Texas Instruments – allows designers to minimize hardware and firmware changes to the host processor and permits easy updates if the sensors change or are upgraded. Alternately, the sensor hub can be integrated into the main application processor in a wireless system, but that would require a modest change to the application processor, potentially increasing the processor’s complexity. However, such a solution eliminates the need for a separate hub chip, which may be a critical option if printed-circuit-board space is extremely limited.

Another alternative is to combine the sensors and a low-power microcontroller on a chip or in a multichip package, thus presenting the sensors and hub as a single-package solution. Such a compact solution would require minimal board space and offers a quick prepackaged solution when time-to-market is a critical factor. Additionally, as the cost of integrating field-programmable gate array technology into a chip decreases, we could also start to see a programmable fabric sensor hub that can be reconfigured by just downloading a new FPGA configuration bit stream.

The applications running on a platform, such as a cell phone or tablet, require the simultaneous analysis and fusion of the data from the multiple sensors that are continuously collecting data. The sensors typically include motion (accelerometers, gyroscopes, magnetometers), environmental (temperature, air pressure, humidity, light level, color), and other parameters such as ambient noise, proximity, and touch. Such sensors are available from vendors like Analog Devices, InvenSense, Kionix, and STMicroelectronics, to name a few. To meld a collection of these sensor outputs into a data stream that the host application can interpret, a low-power sensor hub provides the multiple inputs and processing capabilities to prep the data for the application processor.

Examples of such sensor hub processors from Atmel include the company’s SAM D20, D21, and SAM G microcontrollers that are based on an ARM Cortex-M0+ processor core. The D21 family, for example, has members that contain four or six serial communication modules (SERCOMs). The modules are fully software configurable and can handle I²C, USART/UART and SPI communications (Figure 1, middle of the right column of blocks). With multiple SERCOM modules on the chip, designers can tailor the serial interface mix precisely to their application, matching each sensor requirement. The I²C on the SAM D 21 can operate up to 3.4 MHz (I²S, PMBus, and SMBus are also supported). Additionally, for sensors that have only analog outputs, the D21’s 20-channel 12-bit A/D converter can digitize the signals and then send them on to the application processor.

Figure 1: SAM D21 microcontroller developed by Atmel integrates multiple-software- configurable serial ports that allow designers to connect multiple sensors. A multichannel A/D converter also provides inputs for sensors that do not have digital outputs. (See the dark blue boxes on the right side of the diagram.)

As of this writing, Atmel has just announced SMART, its new brand of ARM-based microcontrollers incorporating new SmartConnect SAM W23 modules, enabling Wi-Fi connectivity for Internet of Things (IoT) applications. The D21 microcontroller with a pre-integrated networking software stack is at the heart of Atmel’s SAM W23 wireless module. This preconfigured and tested Wi-Fi subsystem can easily be integrated into an application (Figure 2). The module can work as a standalone endpoint, collecting and then transmitting the sensor data over its wireless interface, or it can connect to a host processor that runs the main application, with the module offloading some of the data collection and transmission functions. Such a module could find widespread use in industrial, medical, smart homes, security, and many other similar applications.

Figure 2: At the heart of the SAM W23 module from Atmel is a D21 MCU. That MCU packs an ARM Cortex-M0+ processor, a fully-integrated Wi-Fi networking software stack, and multiple serial I/O channels.

There are many other vendors that also offer microcontrollers that are optimized for sensor-hub applications — Microchip, NXP, STMicro, and Texas Instruments, to name a few. Just unveiled by Texas Instruments are two families of low-power microcontrollers, the MSP430FR59x and the MSP430FR69x (now available for sampling, with full production quantities due in 3Q 2014), which in addition to a wide variety of I/O options and hardware AES encryption, also include Ferroelectric non-volatile RAM that replaces flash or EEPROM storage — up to 64 Kbytes on the 59x series and 128 kbytes on the 69x series. The FRAM storage has an estimated wear-out in 100 trillion cycles versus only 10,000 cycles for flash-based storage. The chips have a standby power of just 450 nA and when operating consume 100 µA/MHz . Targeted at wearable, health and fitness, and smart watch applications, as well as home automation and security, the microcontrollers also include a “smart” A/D converter that can run independently of the CPU, collecting analog sensor data while consuming just 140 µA at 200 ksamples/s.

Combination sensor and hub solutions are also possible. One such device, the KX23H from Kionix (just now sampling from the company), contains an ARM-based sensor hub with embedded 3-axis accelerometer and firmware that includes a library of advanced motion processing and context-awareness algorithms. The algorithms provide designers with pedometer and caloric counting routines, as well as activity monitoring and the ability to detect differences between states such as Stop/Walk/Run/Car/Train, and more. Additional algorithms include functions typically needed for smartphone or tablet applications — Tap/Double Tap, screen rotation, tilt, and other common functions. These algorithms will run on the embedded 32-bit ARM Cortex-M0 processor that clocks at 32 MHz. The KX23H can also accept additional inputs from sensors such as gyroscopes, magnetometers, and pressure sensors and has the ability to run sensor fusion software, thus offloading the host CPU or application processor, reduce power consumption, and simplify the system architecture. The Kionix device is based on technology developed by the parent company ROHM Semiconductor’s LAPIS subsidiary (formerly OKI Semiconductor).

Similar to the Kionix approach, the MPU-9250 9-axis motion sensor from InvenSense combines a 3-axis accelerometer, a 3-axis gyroscope, and a 3-axis magnetometer (compass) along with a dynamic-motion processor that can preprocess the complex 9-axis motion data using the company’s proprietary MotionFusion algorithms (Figure 3a). A digital-input capability on the package’s FSYNC pin allows the sensor to support electronic-image stabilization and GPS inputs, while a programmable interrupt supports applications such as gesture recognition, panning, zooming, scrolling, and tap and shake detection.

Housed in a tiny 3 x 3 x 1 mm QFN package, the sensor can fit in just about any space-limited device from smart watches, fitness devices, and smartphones, to tablets, medical devices, and industrial systems. Additionally, the sensor consumes just 9.3 µA, thus minimizing its impact on the system’s power budget. The MPU-9250 actually consists of two chips in the tiny QFN package — the MPU-6500, which contains the 3-axis gyroscope, a 3-axis accelerometer, and the digital motion processor. The second chip is the AK8963, a 3-axis digital compass (Figure 3b).

Compared to the company’s first-generation device, the MPU-9250 is 44 percent smaller, has a three-fold improvement in gyro noise, and a compass-full-scale range that is four times better than competing devices.



Figure 3: This 9-axis motion sensor developed by InvenSense, the MPU-9250, combines a 3-axis accelerometer, a 3-axis gyroscope, and a 3-axis magnetometer, as well as a dynamic-motion processor, which can preprocess the complex multiaxis data from the sensors (a). The cutaway view of the tiny 3 x 3 x 1 mm package that houses the 9-axis sensor shows that the package actually contains two chips, one that integrates the gyros, the accelerometers, and the dynamic motion processor, and a second stacked on top of the first, that contains the multiaxis compass (b).

In summary, as smartphone and tablet functionality continues to expand, and as the Internet of Things (IoT) phenomenon takes hold, the use of sensors will continue to increase as system designers push to add features and connectivity. However, as the systems do more, the need to offload some of the compute/analysis functions to a microcontroller-based sensor hub becomes increasingly important to ensure battery life is not significantly impacted by the sensors or the computer applications that the system must run to extract information from the streams of sensor data. As this article has noted, there are a number of MCUs available to designers from several vendors that are well suited to performing the role of sensor hub in these systems.

For more information on the parts discussed in this article, use the links provided to access product information pages on the Hotenda website.