Technical Report NFC Test Suite: Dominik Krenner Hagenberg, March 20, 2008
Technical Report NFC Test Suite: Dominik Krenner Hagenberg, March 20, 2008
Technical Report NFC Test Suite: Dominik Krenner Hagenberg, March 20, 2008
Linz
Steyr
Wels
Hagenberg
Linz
Steyr
Wels
Contents
1 Abstract 2 Introduction 2.1 NFC- The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 What will be tested? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Concepts and realization 3.1 Overview . . . . . . . 3.2 Why this concept? . . . 3.3 Software . . . . . . . . 3.4 Devices . . . . . . . . 3.5 Robot . . . . . . . . . 3.6 Oscilloscope . . . . . . 3.7 Mobile server . . . . . 3.8 Database . . . . . . . . 4 5 5 5 5 5 6 7 7 7 8 8 8 8 8 8 9 10 10 10 10 10 11 11 11 11 11 11 12 12
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
4 Testing 4.1 Example test script: NFC Forum test TP 2 1 1 . . . . . . . . . . . . . . . . . . 4.1.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.2 The script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Predened Tests 5.1 Window tests . . . . . . . . . . . 5.1.1 Description . . . . . . . . 5.1.2 Requirements . . . . . . . 5.1.3 Available tests and results 5.2 Range tests . . . . . . . . . . . . 5.2.1 Description . . . . . . . . 5.2.2 Requirements . . . . . . . 5.2.3 Available tests and results 5.3 Amplitude measurements . . . . . 5.3.1 Description . . . . . . . . 5.3.2 Requirements . . . . . . . 5.3.3 Available tests and results
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
Hagenberg
Linz
Steyr
Wels
List of Tables
List of Figures
1 2 3 The test system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Python script performing NFC Forum test TP 2 1 1 . . . . . . . . . . . . . . . . 9 Result for amplitude test Cube - 5, Samsung SGH-X700N . . . . . . . . . . . . 13
Hagenberg
Linz
Steyr
Wels
1 Abstract
The implementation of a Near Field Communication (NFC) test system had the goal to invent a system which is capable of testing NFC devices concerning the amplitude and frequency of the emitted electro magnetic eld, just like the range in which other NFC devices can be detected. Therefore a cartesian coordinate robot was constructed. It can move the device under test (DUT) in three dimensions to a maximum of 200 mm along each axis. The three stepper motors used, provide an accuracy of 0.25 mm. The main application which was developed features a 3D log viewer, a robot control panel and a test editor. Tests scripts can be written by the user to provide custom test scenarios. These scripts are written in Python and can access the robot, logs and the DUT using a Python module provided with the main application. To test a device, custom software has to be installed on it, which provides communication with the main application and controls the devices NFC activities as requested by the main application and the test script. This test-client, a J2ME application, comes with an hardware abstraction layer, allowing us to use the test client like the Nokia 6131 NFC, Samsung SGH-X700N and the Sagems my700X. The NFC devices can be connected via TCP/IP or Bluetooth. Already implemented tests include eld measurements in all three dimensions. Window tests can be used to verify if a specic device can detect a target in a certain range. It is also possible to determine a devices maximum range in each direction. Measured positions are stored separately in a database and can be analyzed in the log viewer. The result can be rotated and zoomed and provides all collected data of each point. Automated testing of NFC devices and their operating modes can be done by this system in a very convenient and quick way. Through customized test cases allow individual tests with different NFC devices without Software adaptation. The results of the tests indicate the functionality of the NFC devices in different operating modes.
Hagenberg
Linz
Steyr
Wels
2 Introduction
The project NFC Testing was a students project at the university of applied sciences in Hagenberg (Austria). The goal was to develop a system which can test NFC devices automatically. Five Hardware/Software Systems Engeneering students developed the systems as part of their studies over a period of two semesters.
Hagenberg
Linz
Steyr
Wels
Hagenberg
Linz
Steyr
Wels
3.3 Software
The main application coordinates attached devices as the robot, oscilloscope or the device-undertest. It provides test scripts with initialized and congured objects which represent the testing environment, like the robot, the oscilloscope and the device under test. It also provides a graphical user interface (GUI), a test-script editor, a robot control panel and a log viewer which presents collected data in 3D. It was developed using the object oriented scripting language Python. Python offers lots of features and packages which allow the easy creation of complex and powerful software, while still being nearly independent of the operating system. It also provides mechanisms to run scripts (also written in Python) and pass objects, which already exist in the main application, to them. These scripts can be created and modied while the main application is already running. The graphical user interface (GUI) was developed using the wxPython package which is a port of the wxWidgets class library. The main application also provides predened classes which can be used by test scripts for fast and easy test case generation.
3.4 Devices
The rst devices which were tested were the Nokia 6131 NFC, the Samsung SGH-X700N mobile phones and the Dell Axim X51v PDA. Each of the three devices uses a different connection method and runs a software providing the proprietary communication protocol between the mobile server and the device. This software also controls the NFC activities of the device as requested by the main application and the current test. Currently this application has to be customized to t the devices architecture.
3.5 Robot
The cartesian coordinate robot was constructed out of three linear modules and three stepper motors, which allow the robot to move the device under test through space in three dimensions. It can move a device 20 cm in each direction, with an accuracy of 0.25 mm. A circuit board featuring a ATmegaUSB microcontroller controlls these motors and is connected to a working station via the USB protocol. To communicate with the host, it uses the USB communication device class and can be accessed by software like a serial communication port. A proprietary text based protocol is used to control the robot via software. The robot can recalibrate itself using six press switches at the end of each linear module which also work as emergency stops. The robot stores the maximum distance along each axis and its current position. This information is used by the robot to determine if a move-command can be executed safely or not and avoids that the robot tries to move the device under test too far and damage the devices.
Hagenberg
Linz
Steyr
Wels
3.6 Oscilloscope
To enable frequency and amplitude measurements an oscilloscope with an antenna attached is used. It is congured via the main application or the test case to provide exibility. The connection between the main application and the oscilloscope is established over TCP/IP and a C library provided by the manufacturer.
3.8 Database
The database is used to store test scripts and test results alike. Each position at which data is collected is stored with the corresponding results. At the moment of writing the software uses a MySQL database server running on the same machine as the main application. But because the connection is established via TCP/IP, the database server can be run on any machine in the network.
4 Testing
There are some basic test cases already implemented in the main application which can be ran to analyze a device under test in a two dimensional plane, a single line or the whole eld in which measurements can take place. In addition, tests dened by the NFC Forum are available. To create own test cases, a simple interface is provided which allows the implementation of custom tests by using a object oriented environment.
Hagenberg
Linz
Steyr
Wels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# Entry function of test script def Run(TE): # Default result: device failed the test. TE.Result = "Failed" # Start with the device/tag touching each other Distance = 0 DeviceFound = False # Loop until either tag wasnt found or distance is 10 mm while DeviceFound and Distance < 11: # Check if the device under test can detect the tag DeviceFound = TE.DUT.SearchForDevice() == "1" # Move device under test one mm (= 4 steps) back TE.Robot.Move(-4, 0, 0) # Distance has increased Distance += 1 # End of test # If distance is 11, DUT passed the test. if Distance == 11 and DeviceFound: TE.Result = "Passed" Figure 2: Python script performing NFC Forum test TP 2 1 1
the point where the device under test and the target touch each other. 4.1.2 The script When the test is started, the main application calls a function Run in the test script and passes the testing environment (TE) to it. The testing environment holds objects like the robot, a log and the device under test (DUT) which can be used by the script. The example script denes that by the default the device will fail the test and that it starts testing with the device under test and the target touching each other. After that it enters a loop which will be executed until either the device under test could not be detected by the target or the maximum distance (10 mm) was reached. The loop consists of testing if the target can be detected (Line 13), moving the robot back by 4 steps (= 1 mm) (Line 15) and keeping track of the distance (Line 17). If the main loop is left, the test script determines if the device under test passed the test or not.
Hagenberg
Linz
Steyr
Wels
5 Predened Tests
These tests are already dened in a module provided by the main application. On the one hand, these are tests as dened by the NFC Forum, on the other hand simple shapes are provided which are used for amplitude measurements. These tests are represented as Python classes and can be used as base classes for custom tests.
1 1 1 1 2 2 2
1 2 3 4 1 2 3
10
Hagenberg
Linz
Steyr
Wels
11
Hagenberg
Linz
Steyr
Wels
5.3.2 Requirements Robot Device under test Oscilloscope optional: Target 5.3.3 Available tests and results Test Plain - XY Plain - XZ Plain - YZ Plain - All Cube - 5 Directions XY XZ YZ XYZ XYZ Resolution Remarks 5 mm Two dimensional plane in X- and Y-direction 5 mm Two dimensional plane in X- and Z-direction 5 mm Two dimensional plane in Y- and Z-direction 5 mm Runs tests Plain - XY, Plain - XZ and Plain - YZ 5 mm Tests positions in a 5 cm cube
12
Hagenberg
Linz
Steyr
Wels
13