Simplify embedded Wi-Fi connectivity with Near-Field Communications - Embedded.com

Simplify embedded Wi-Fi connectivity with Near-Field Communications

Editor's note: This article describes how to design a simplified alternative radio connection (in this case Wi-Fi) handover process, using NFC, that enhances the usability of existing Wi-Fi solutions and helps realize new wireless applications.

Wi-Fi has been a ubiquitous technology for wireless connectivity for at least the last decade. It continues to provide us a way to enjoy web pages, online content, and each other in real-time on intelligent devices like smart phones, tablets, and PCs. More recently, the need for smaller and less intelligent embedded microcontroller application devices that can be connected to a network has emerged, both for home and industrial automation command and control for real-time transmission and collection. These autonomous electronic devices outfitted with a microcontroller and Wi-Fi solution still need to be authenticated and connected to their assigned network. In the instance of data transmission/collection, there most likely won’t be any way to provide the network SSID, security key, or the IP address of the device to send the data to.

A Near Field Communications (NFC) transceiver can be used in peer-to-peer mode to make the connection process possible without complicating the end user experience. The emergence of NFC in mobile phones, tablets, and other infrastructure devices is creating an ecosystem that embedded Wi-Fi and NFC solutions can use to realize the full potential of the dual wireless combination. This article will describe how the simplified alternative radio connection (in this case Wi-Fi) handover process, through the use of NFC, can enhance the usability of existing Wi-Fi solutions and help realize new wireless applications.

The tremendous growth in the application of WiFi technology drives a need for improvements in ease-of-use and security. This is especially true when considering the increasing frequency of daily Wi-Fi operations where devices might join/rejoin various SSID networks. Minimizing the number of manual steps involved in each procedure while maintaining the utmost level of security could result in saving considerable amounts of time throughout the day and pose a challenge for embedded system designers. Fortunately, NFC excels in both ease of use and security and can be an effective solution. This article outlines the technical implementation of the technology.

Simplifying the connection
NFC is a magnetic field technology for establishing radio contact between devices that are either very close to each other or touching. NFC operates with a 13.56MHz (+/-7kHz) carrier frequency. It is based on pre-existing 13.56MHz RFID air interfaces and protocols and adds a peer-to-peer mode previously unavailable in traditional High-Frequency (HF) RFID devices. The basic intent of NFC is to simplify transactions, exchange digital content, and directly connect electronic devices. It is also being used to simplify the connection process to an alternative radio technology for higher speed and longer-range data transfer. This last point is the main topic of interest in this article – in the next section we will discuss the use of NFC technology during the connection handover process to a Wi-Fi radio.

The NFC Forum published a technical specification, entitled Connection Handover 1.2, that enables applications to take advantage of NFC technology for initiating and executing user-defined activities between devices. Connection Handover 1.2 was used as a reference when creating the application example that we will describe in detail later in this article, where a Wi-Fi device with no user input mechanism (known as “headless”) needs to be connected to a network. Without a user input mechanism, there is no direct method to get an SSID and security key/password into the device needing to be connected. This problem can be solved using NFC.

Applications with multiple radios and wireless protocols usually require a central application processor that is responsible for controlling the hardware and running the wireless protocol stacks. The complexity of the Wi-Fi protocol usually requires power processors capable of operating various layers of the Wi-Fi stack, while keeping up with the Wi-Fi connection and data throughput. It is traditionally unheard of to consider a low-speed, low-power MCU as a compatible processor choice for the Wi-Fi stack. However, with the recent introduction of self-contained and modular Wi-Fi radio solutions, this approach is now possible. Developers can select a product like the SimpleLink CC3000 solution from Texas Instruments, requiring only ~35 API calls from the MCU and delivering a network node driven by a 16-bit ultra-low power microcontroller with less than 16kBytes of FRAM. This development enables a plethora of Wi-Fi autonomous applications that were previously considered impractical because of BOM cost and firmware effort.

One particular application of interest involves incorporating both Wi-Fi and an NFC radio into a single MCU system. In such systems, the MCU acts as the host that controls low-level control for and communication to both the Wi-Fi and the NFC radio. The MCU might take responsibility for the upper communication layers for the Wi-Fi and NFC stacks, and it is possibly to offload some of the layers to the radio module depending on the actual implementation. Bill of Material (BOM) and hardware cost reductions are likely or possible, and the Wi-Fi node is headless, meaning no wired, display, keypad or user inputs are needed or used. The MCU firmware needed is also not overly complicated; it is made up of software hooks into the self-contained low-level driver residing on the Wi-Fi module. Since the module includes the higher layers of the WLAN and networking stacks, this also simplifies the hardware resources required, reducing the cost of the BOM further.

The application layers as well as the top application usually reside in the MCU and provide the overall structure and flow for the wireless applications and manage, instead of dictate, the Wi-Fi procedures (Figures 1-3 ).


Click on image to enlarge.
Figure 1: Distribution of Wi-Fi stack in a Wi-Fi + MCU design


Click on image to enlarge.

Figure 2: Simple set of Wi-Fi top-level user API


Click on image to enlarge.

Figure 3: Typical Wi-Fi operation flow in an MCU application

Since the Wi-Fi is not taking up much code space, the MCU can also manage the NFC transceiver. The block diagram below (Figure 4) illustrates the simplicity of the modular approach and the basic flow of using NFC technology to automate and simplify placing a headless Wi-Fi node on an access point’s network.


Click on image to enlarge.

Figure 4: Flow chart of the connection handover

The NFC technology being used here is in peer-to-peer mode, where an NFC and Wi-Fi-enabled handset already on the network can “push” nodes onto the network and even instruct the node which IP address to send data to, such as other handsets, tablets, laptops, PCs, etc. (Figure 5)


Click on image to enlarge.

Figure 5: Flow chart demonstrating how to establish a Wi-Fi/NFC-enabled connection with a handset

Security and other concerns: Wi-Fi beacon approach
Aspreviously mentioned, the initial configuration for connecting Wi-Fiapplications requires user input, and Wi-Fi protected setup is notwidely deployed. One approach is to use a special probe request or“beacon” from a Wi-Fi enabled handset already connected to the router ornetwork. This approach requires a specially crafted SSID and some formof user interaction. This method is relatively secure, but an attack canbe made on a system using the beacon if the attacker knows the detailsof how the system works. Additionally, a hard-coded and completelyautomated process does not provide any control or allow the user to makeany decisions. Customizability becomes difficult as both the hard-codedbeaconing device and the Wi-Fi device being configured lack the userinterface or flexibility when it comes to option selection.

Analternative to the beacon method is to use the NFC in peer-to-peer mode.In the implementation example shown below (Figures 6-12), anNFC-enabled handset already connected to the Wi-Fi network pushes theSSID and key/password to the headless Wi-Fi module through theultra-low-power 16-bit MCU via the NFC transceiver link at close range.This eliminates security concerns like undesired users on the network“sniffing” a beacon.

Alternative security features and enhancements
Recentsecurity feature enhancements developed for microcontrollers can alsobe employed to further improve the security of Wi-Fi and NFCoperations. For example, memory and data security features in the MCUenable vendors to securely place a passphrase or unique key toauthenticate the NFC transaction. Only when the initiating device,typically a handheld device, offers a valid key will the MCU applicationauthenticate and proceed with the NFC handover. This is definitelyuseful for the application to accurately acquire new information fromthe handheld device. The reverse is also true when the handheld wants toretrieve sensitive data from the other device. These types ofNFC-secured transactions use low-energy transmitting devices to transfersimple data, or they enable encryption on the data to heighten securitybeyond what the air interface itself can provide.

A real-world example of a Wi-NFC-Fi system, enabled by a 16-bit MCU with universal memory


Figure6: This project combined various wireless, MCU and Android technologiesto demonstrate a complete picture of wireless connectivity and theInternet of Things (IoT)

As an example, we will highlight arecent Wi-Fi + NFC + MCU project that combines various wireless, MCU andAndroid technologies to demonstrate a complete picture of wirelessconnectivity and the Internet of Things (IoT). This example used aSimpleLink CC3000 Wi-Fi radio and a TRF7970A NFC transceiver in thewireless sensor system controlled by the MSP430FR5739 ultra-low-powerMCU with universal FRAM memory technology. Each described system acts asan autonomous wireless sensor node that, upon NFC handover transactionand subsequent Wi-Fi authentication, can join a secured Wi-Fi networkand connect to a TCP/IP server. FRAM’s universal memory feature allowsfor flexible partitioning of code and data across two different wirelessstacks as well as the user application. In order to demonstrate theflexibility of IP-based applications, the Internet of Things (IoT) andthe ubiquity of the wireless connectivity, two different implementationsof the servers were developed: one as a Windows-based application andanother as an Android application.

In this case, we show acustom app here which acts as a “middle man” to gather enoughinformation to push over to the node via NFC link.

Figure 7: The front screen of the Android app



Figure 8: The app’s initial launch screen (note SSID and IP data)


Figure 9: Presenting the handset’s NFC antenna to the TRF7970A NFC transceiver in NFC-F target mode




Figure 10: Sensor data comes back from the node via Wi-Fi, whichmeans the NFC push was good and Wi-Fi connection handover has beencompleted.

Figure11: Five Wi-NFC-Fi nodes have joined the network and are sending databack to the phone via TCP/I. The nodes are represented graphically asplanets rotating around the center orb.



Figure 12: An IP address is entered for the data destination. Inthis case, we selected to send it to a PC on the same network we called“TP-Link”.

Figure 12 shows the result of re-presentingthe handset to the NFC antenna zones for three Wi-Fi nodes, eachrepresented by a ringed planet rotating around a star. Temperature datais expressed by the color of the planet, alongside the raw data, IPaddress of each node, battery voltage, and accelerometer data. Moreimportantly, the SSID, network, and IP address reconfiguration for theserver and individual Wi-Fi/NFC nodes can be applied quickly andeffortlessly by using a single NFC tap.

Conclusion
Wi-Fitechnology is a well-established and time-proven wireless connectivityinfrastructure for a multitude of device types. The addition of NFCtechnology offers convenience and security features that significantlyimprove the usability and scalability of new and existing Wi-Fiinfrastructure and networks, and will enable previously inconceivableembedded designs in applications for home and industrial automation,smart grid, medical, and consumer electronics.

Josh Wyatt is currently an Embedded RF Applications/Systems Engineer at TexasInstruments. While his early background was in airborne active andpassive detection systems at various frequencies, he has been workingwith ground based LF, HF, and UHF short range RFID,
contactless payment, and NFC systems since 1997. He has been at Texas Instruments since 2002.

Dung Dang is an applications engineer for Texas Instruments' ultra-low-powerMSP430 microcontroller (MCU) group. He joined Texas Instruments in 2007and has since served in various roles in new product development. Heworks closely with MSP430 MCU silicon development in addition tosupporting development tools and software solutions. His focus alsoincludes realizing various ultra-low-power wireless solutions on MSP430MCUs. Dung Dang holds an MSEE degree from St. Mary's University at SanAntonio, concentrating on embedded systems and image processing.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.