Design Of An Automated
Class Attendance Recording System
by
Project E448
October 2008
Acknowledgements
I would like to express my sincere gratitude towards the technical and teaching staff of
the E&E Department of the Stellenbosch University Engineering faculty. Without their
professional and friendly assistance, this project would not have been realisable.
I would like to thank the following people specifically:
• Mr H.R. Gerber
• Mr Ashley Cupido
• Mr Ralph A. Dreyer
• Mr Quintis Brandt
• Mr Wessel Croukamp
• Mr Charles S. Fredericks
• Mr Johan Arendse
i
Declaration
By submitting this report electronically, I declare that the entirety of the work contained
therein is my own, original work, and that I am the owner of the copyright thereof (unless
to the extend explicitly otherwise stated) and that I have not previously in its entirety or in
part submitted it for obtaining any qualification.
Signature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C.P.J. van Wyk
Date: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ii
Abstract
The goal of this project is to design and develop a fully functional automated class attendance
register system, including hardware, firmware and application software. The project makes
use of RFID and Wifi technology, and basic research of RFID equipment was conducted. It
was shown that an effective attendance register system can be implemented with the help of
new and emerging technologies. ConnectOne’s iWifi module is used for Wifi communication.
Python is used as far as possible in the development of application software. The application
software will be integrated with H.R. Gerber’s MyStudies application and server. This report
provides background information and an introduction to the project, a system level design
overview and detailed design solutions. Tests and measurements are also provided in the
final chapters.
iii
Uittreksel
iv
Contents
Declaration ii
Abstract iii
Uittreksel iv
Contents v
List of Tables ix
Nomenclature x
1 Introduction 1
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Problem Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Scope and Aims of Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Introduction to Other Chapters . . . . . . . . . . . . . . . . . . . . . . . . . 3
v
CONTENTS vi
Bibliography 46
B Project Specification 48
B.1 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
B.1.1 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
B.1.2 Software and Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . 48
B.2 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
B.3 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
C Outcomes Compliance 51
F Source Code 62
F.1 Secure Interface Webserver Prototype . . . . . . . . . . . . . . . . . . . . . . 62
F.2 iWifi configuration page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
F.3 RFID and iWifi Communcations Handling Module . . . . . . . . . . . . . . . 63
List of Figures
6.1 Low-power operation regulated output with max and min input voltage. . . . . 41
6.2 Full-power operation regulated output with max and min input voltage. . . . . 41
viii
List of Tables
6.1 Measurements taken at different input voltage levels for low-power operation. . 40
6.2 Measurements taken at different input voltage levels for full-power operation. . 41
ix
Nomenclature
Acronyms
WWW - World Wide Web
Wifi - 802.11b/g wireless network standard
RFID - Radio-Frequency Identification
USB - Universal Serial Bus
LF - Low Frequency
UHF - Ultra High Frequency
ISO - International Organization for Standardization
WORM - Write Once Read Many
LCD - Liquid Crystal Display
LED - Light Emitting Diode
MCU - Microcontroller
PCB - Printed Circuit Board
GSM - Global System for Mobile communications
IO - Input/Output
GPIO - General Purpose Input/Output
GUI - Graphical User Interface
UART - universal asynchronous receiver/transmitte
EEPROM - Electrically Erasable Programmable Read-Only Memory
RAM - Random Access Memory
RTC - Real Time Clock
DIP - Dual Inline Package
IC - Integrated Circuit
LDO - Low Dropout
bps - Bits per second
x
Chapter 1
Introduction
This chapter provides an introduction to this report, and provides background information
to the project. It includes a definition of the problem, and states the scope and aim of this
project. An introduction to following chapters are provided at the end of this chapter.
1.1 Background
Up until now, class attendance records have been maintained manually by having students
sign next to their names on printed class lists during class. This method is outdated and
time-consuming, and may be improved by applying technology and designing an automated
electronic class attendance recording system.
There are many cases in which it would be beneficial for the University of Stellenbosch to
be in possession of an automated class register system. Such a system would be of most value
to students, who may make use of system reports and statistics to assess their own approach
to their studies, and be kept informed about course material covered in classes attended and
missed.
An automated attendance recording system would be advantageous to the lecturer, by
providing data on student attendances which may be correlated with a student’s academic
progress.
Attendance recording is an important aspect of tests and exams, where a record must be
kept of students writing the paper.
Finally, such a system could provide evidence of a student’s class attendance habits in
cases where the University is accused by a student of providing insufficient guidance in
lectures. In such cases, the University holds no liability if it can be showed that the student
was regularly absent from class.
1
CHAPTER 1. INTRODUCTION 2
Attendance logs must be stored on a centralised database in order to generate reports and
statistics. Therefore, the device must be able to communicate with a central database server.
Students should be able to access information and personalized reports generated by the
system for effective self-assessment and keeping up to date. Lecturers should be able to view
attendance information and be able to add information to the system.
The system should also provide appropriate administration interfaces for administering the
recording devices and system parameters.
• Provide a mobile RFID scanner device capable of scanning student cards with embedded
RFID chips and processing the data on the card.
• Provide a software suite to log information about scanned cards against a database and
provide detailed statistics and feedback about attended and missed classes to students
and the lecturer. The software suite must include sufficient administration capabilities.
• Maximize battery life of the mobile scanner device and provide a simple USB-charger
interface.
The scope of this project includes designing and assembling the mobile, Wifi enabled,
student card scanning device, designing and writing the firmware required for operating the
device, and designing and writing a full software suite for managing multiple scanning de-
vices and providing detailed feedback to students and lecturers as described in the project
specification in appendix B. The software suite must be integrated with H.R. Gerber’s MyS-
tudies framework as far as possible. The scope of this project does not include an in-depth
theoretical study on a particular subject.
CHAPTER 1. INTRODUCTION 3
The design approach used in this project involves breaking the main system up into subsys-
tems called ’branches’. Each subsystem branch may be broken up further into subbranches,
and subbranches may again be broken up into ’leaf-nodes’, which represent the lowest level
of subsystems. This method forms a tree-like structure overview of the system as represented
in figure 2.2. In this way, system level analysis and design is done by looking at the over-
laying structure of the system, while detail design is limited to the leaf nodes. At the lowest
level, components and design methods are chosen based on functional and non-functional
requirements and design constraints.
Once the lowest levels of sub-systems are designed, they are integrated and tested in a
’Bottom-up’ approach until all subsystem branches are combined into the all encompassing
top-level system. In essence, a ’Top-Down’ analysis and design method with ’Bottom-Up’
integration and testing process is used. Figure 2.1 is a flow-chart representation specifying
the design approach used for this project, with inherent awareness of design constraints and
limitations.
Focusing on designing subsystems provides an advantage in that once one sub-system’s
design is completed, it may be sent in for manufacturing while design of the other subsystems
can continue in parallel with manufacturing, which saves time. If one subsystem fails, it can
be redesigned without influencing other sub-systems, and in this way valuable time is saved.
4
CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 5
START
No
Create Leaf-Node.
Find suitable component
based on functional
requirements.
No
Yes
Use Component
802.11b/g Wifi
The mobile scanner device will use an 802.11b/g Wifi module to communicate with the
Stellenbosch University campus wide wireless network, ’Maties Wifi’.
Capacitive Sensors
The scanner device will use a capacitive sensor array for user input as opposed to a keypad.
Capacitive sensor technology is discussed further in section 3.1.3.
MyStudies
MyStudies is a framework for the management of students, courses, classes and work. It
consists of a server written in python with a SOAP interface and mysql database back-end,
that serves wxpython based GUI clients. This project’s application software will be integrated
with the MyStudies framework and will rely on the MyStudies server for data storage and
management.
CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 7
SOAP
SOAP is a protocol that allows exchange of XML-based messages over HTTP or HTTPS. It
is the main transport method of data used in the MyStudies framework and this project.
Python
Python1 is a highly versatile and dynamic interpreted programming language. It will be
used as the basis for most application software in this project with the exception of device
firmware and configuration webpages. Python really is a remarkable language that provides
powerful libraries, and allows for rapid prototyping and development. VisualWx was used
for making WXPython based GUIs.
Twisted
Twisted2 is an event-driven networking engine programmed in Python. Twisted.Web is used
as webserver instead of apache to allow direct integration of the python based web server
code and other python based application software code. Data is transferred from the wireless
scanner device to a Twisted.Web server webpage via HTTP POST. The data is parsed and
then submitted to the MyStudies server via SOAP.
MySQL Database
MySQL is a relational database that is used by the MyStudies framework. The MySQL
database will be used for all data storage in this project.
2.2.2 Antenna
According to BITKOM[2], the typical read-range of ISO 14443 based cards (as used by
Stellenbosch University) are 7-15cm, even though tests mentioned elsewhere in this report
shows proximity distances of 1.6cm or less for this report’s specific application. In short
read-distance applications like this, the tag is within the near-field of the reader antenna’s
electromagnetic wave pattern when it is scanned. The card’s antenna is in the form of a
coil or inductive loops that run around the edge of the card, and the card’s RFID microchip
is powered by energy transferred from the reader to the card antenna’s inductive loops via
magnetic coupling[3].
2.2.3 Modulation
In essence, the connection between the reader and card is represented by an airgap in-
terface which is the distance the card is held from the scanner when it is being read. The
’airgap interface’ is represented by various layers[2]:
• On the physical layer, the card and reader are linked by an electromagnetic wave that
couples the reader and card antennas at a specific carrier frequency. This is represented
in figure 2.3.
• On the logical layer, the structure of commands and data are specified by ISO or other
proprietary standards. It is important that all layers of the air interface adhere to
global standards in order to ensure compatibility with other RFID systems worldwide.
standard, which has been shown by Nohl and Plotz[4] to have critical security vulnerabilities.
The RFID reader units used by the University are Model 718-10 scanners from GSC systems.
Budget: With a limited project budget, it is not possible to simply select the first and best
option that presents itself. Care must be taken to minimize component and manufac-
turing costs and sometimes creative solutions need to be found for problems that may
be solved by more expensive components, but that will overshoot the budget too far.
Time: With a timeframe of 4 to 5 months to complete literature studies, hardware and soft-
ware design and synthesis, obtain all components and write a project report, the design
process must be optimized to maximize productive time. Design processes may take
place in parallel if properly coordinated, for example: software development may take
place while hardware components are being manufactured. Readily available compo-
nents must be selected as far as possible and critical non-readily available components
must be available in time.
Limited manufacturing capabilities: In some cases, the design process has to rely on
manufacturing facilities available at the Electronic Engineering faculty, as professional
manufacturing would overshoot the budget too far. In some cases, this limits component
selection and other design aspects.
As discussed in section 2.1, the leaf-nodes of the hardware branch of the design tree are
analysed in this chapter. The design process used is specified in chapter 2 and is represented
by figure 2.1. From the tree-level diagram in figure 2.2 it can be seen that the hardware
components of the project can be broken up into three main sub-systems: The power supply,
processing and communications unit and user interface.
Requirements
• Minimum 5V voltage rail.
10
CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 11
3.1.2 LCD
A standard 16-pin KS0066U or equivalent alphanumeric LCD is used for user output. As with
most components, the primary design constraint for this component is cost, and the secondary
design constraint is size. A standard 20x2 characters LCD was chosen for maximising output
space while minimising cost and physical dimensions.
For this project the model 202A-FC-BC-3LP from Displaytech was ordered from RS South
Africa. This specific model features black on white text with a white LED backlight for a
more modern and professional look than a yellow on green LCD. The LCD will be operated
in 8-bit mode, as opposed to 4-bit mode, to increase display speed. Two control lines are
also required.
The LCD requires three resistors: Two determine contrast and one determines backlight
brightness. The method for choosing these resistors was by first connecting the corresponding
resistors pins to variable resistors and tuning the resistor parameters until optimal contrast
and brightness levels was found.
Figure 3.1 represents the calibrated resistor configuration for determining LCD contrast
and brighness.
Requirements
• Minimum 5V rail.
The ISQ221 proximity sensor chip from Paarl based company, Azoteq, provides a capac-
itive sensor array with binary outputs. This means that a custom touchpad can easily be
manufactured by etching conductive pads and tracks on a standard PCB. A touchpad also
offers several advantages over a traditional keypad:
• There are no mechanical components that can wear out over time.
• Buttons can take any shape, form or layout. This allows for custom and creative
touchpad designs.
• The IQS221 is designed and supported locally in Paarl, less than 40km from Stellen-
bosch.
See below for a basic explanation of capacitive sensors. A photograph of the user inter-
face’s custom touchpad is available in appendix E, as figure E.1.
Capacitive Sensors
LionPrecision[5] describes capacitive sensors as follows:
CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 13
For this project, the IQS221 evaluation module, model AZP075A05-2008, was obtained
from Azoteq.
Requirements
• Minimum 3.3V voltage rail
• 8 digital inputs, each corresponding to one touch pad. Connected either directly to the
MCU or to a bus expander.
Protocol Selection
There are three main wireless protocols represented in the table 3.2 table: Zigbee, Bluetooth
and Wifi. The main design consideration for this component is compatibility with existing
wireless infrastructure in order to maximise operating range and minimise additional costs
and design, such as custom base station hardware. Stellenbosch University boasts a campus-
wide Wifi network, ’MatiesWifi’. Interoperability with this network will ensure wireless
connectivity across campus and in all classrooms, which makes it ideal for the objectives of
this project. Therefore, the wireless communications module choice is narrowed down to the
802.11b/g Wifi modules.
Module Selection
From the advantages and disadvantages columns in the table 3.2, it was concluded that the
most attractive option for this application is the Mini Socket iWifi module from ConnectOne.
It also happens to be least expensive of the Wifi modules (R470 at time of purchase), and is
only slightly more expensive than a Bluetooth or Zigbee solution.
The iWifi is an impressive piece of technology that lives up to all expectations. Released
in July 2008, it was very fortunate that one could be obtained in time for use in this project.
Core features include ease of use, an embedded web server, an AT command set via UART
and support for the following protocols[6]:
Internet Protocols: ARP, ICMP, IP, UDP, TCP, DHCP, DNS, NTP, SMTP, POP3, MIME,
HTTP, FTP and TELNET
Security Protocols: SSL3/TLS1, HTTPS, FTPS, RSA, AES-128/256, 3DES, RC-4, SHA-
1, MD-5, WEP, WPA and WPA2
The author can strongly recommend this module for use in future projects that require Wifi
communication capabilities.
1
Dollar to Rand conversion done using R8 per $1
CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 15
iWifi Requirements
• Minimum 3.3V (Maximum 3.6V) voltage rail
3.2.3 Microcontroller
Choosing a microcontroller is not a critical design consideration of this project. Any generic
MCU with enough General Purpose IO pins, UART channels, an I2 C bus, and flash memory
will be sufficient. As with all leaf-nodes, non-functional requirements carry the most weight
in choosing the component, and therefore availability of the MCU chip and MCU programmer
played the most important role in this case. Table 3.3 presents the three possible MCU’s
that was readily available along with their programmers.
There are no defining characteristics that put one MCU above the other. Therefore
the R8C/27 which was available immediately along with its programmer was chosen, even
though either of the other two chips would have been adequate. Furthermore, the R8C/27 is
inexpensive, and offers a familiar embedded development platform and requires little power.
Operating Voltage
One important design consideration regarding the microcontroller is its operating voltage,
as this will affect interfacing with components that operate at voltage levels different from
the MCU. Since the wireless communication module can handle an absolute maximum of
3.6V, and is considered one of the integral components of this project, it was decided that
the MCU operate at the same voltage as the wireless module at 3.3V to eliminate the need
for level translators.
Requirements
• 3.3V to 5V input voltage
Requirements
• 3.3V to 5V input voltage
• I2 C interface
Requirements
• 32.768 kHz crystal
• 5V Input
• I2 C interface
only once in order to determine which key was pressed. This method is opposed to connecting
a key- or touchpad directly to the MCU where pins would have to be polled continuously.
Since there are already two other components that make use of the I2 C bus, the bus
expander will also make use of I2 C. Any general purpose bus expander with 8 or more input
pins, an I2 C interface and an interrupt output pin is suitable for this project. The MCP23017
was chosen since it meets all these conditions and was instantly available.
Requirements
• 3.3V to 5V operating voltage
• I2 C interface
Requirements
• 3.3V input
5
linear.com
6
maxim-ic.com
CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 20
• It must be rechargeable.
All batteries in the table are capable of delivering sufficient peak current for this project’s
application. From table 3.4, it was decided that a Li-ion cell be used, as it features a high
energy density ratio and is readily available. Figure 3.2 provides a graph of estimated battery
terminal voltage in terms battery depletion.
Two 2400mAh TrustFire Protected 18650 Lithium-Ion Batteries were ordered from DealEx-
treme7 at R45 per cell8 . This battery received overwhelmingly positive reviews and includes a
protective embedded PCB for short-circuit, overcharge and discharge protection. The author
can strongly recommend these cells for any mobile application.
7
www.dealextreme.com, stock number sku.5776
8
At an exchange rate of R8 per 1 USD
CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 22
3.3V Rail
Since a 3.6V Li-ion voltage source is used, the 3.3V regulator must be a step-down DC-DC
converter. Table 3.6 is a table of 3.3V step-down DC-DC converters that was acquired.
The Texas Instruments TPS62056 was chosen for the following reasons:
• It has a wide input voltage range for use with one or two Li-Ion cells.
As the TPS62056 is a fixed 3.3V chip, no calculation of external components was required.
5V Rail
Since a 3.6V Li-ion voltage source is used, while the 5V regulator must be a step-up DC-DC
converter.
Table 3.7 is a table of 5V step-up DC-DC converters that was acquired.
The TPS61120 was chosen because it provides the highest conversion efficiency and suf-
ficient output current. It is an adjustable version of the component range and therefore
requires more external components and it has an enable/shutdown pin for power save mode.
As the TPS61120 is an adjustable voltage version chip, the following external component
calculation was made: From the datasheet:
R3 = R6 × ( VVFOB − 1)
5
Choose R6 = 200kΩ ,then R3 = 200000 × ( 0.5−1 ) = 1.8M Ω
integrated 1A 3.3V buck-boost (step-up/step-down) regulator for utilizing the full capacity
of the battery. The LTC 3567 includes control via an I2 C interface. Extensive searching
yielded no alternatives that came close to the functionality of the LTC 3567’s model range.
This IC is perfect for this project’s application in all regards, however it was not chosen due
to two design constraints:
• The component footprint is too small and sophisticated for PCB manufacturing at the
engineering faculty. This component requires a professionally manufactured PCB.
• The component requires several external passive components that are not available at
the engineering faculty. As components cannot be purchased in single unit quantities, it
was not feasible to purchase the required external components on the project’s budget.
The author can highly recommend this chip if the necessary equipment and components are
available.
As an alternative, the MAX1811 from Maxim-IC10 was chosen as it was the only USB
charger IC that could be found in a more convenient chip packaging, and that would be
sufficient for use in this project. The MAX1811 turned out to be a very convenient and
easy to use, and the author can recommend it for any application that requires a simple and
effective USB Li-Ion battery charger solution.
MAX1811
The MAX1811 allows configuration of input charge current, output charge voltage, charge
enable/disable and a charge active output pin for control. It also provides preconditioning
that soft-starts near-dead cells before charging, and other safety features. The MAX1811
supports the USB 500mA mode for maximum charge current.
Charge Control
As the Max 1811 battery charger chip does not include an internal safety timer, the mi-
crocontroller must continuously monitor and regulate battery charging. The microcontroller
must provide safety timer functionality and disable charging once the battery has charged
for 5 hours.
10
www.maxim-ic.com
CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 26
The voltage input range to the MCU’s A/D pin must be 0V to 3V.
R1
Thus: Va/d(max) = (R1+R2) × Vbat(max) = 3V
R2 Vbat(max) 4.1
1+ R1
= Va/d(max)
= 3
R2
R1
= 0.3666 , R2 = 0.3666 × R1
Choose: R2 = 33kΩ , then R1 = 90kΩ and R1 + R2 = 123kΩ > 84kΩ
Chapter 4 covers design and development of software components of the project. Both
firmware that run on the scanner device and application software is discussed in this chapter.
27
CHAPTER 4. DETAIL SOFTWARE DESIGN AND SYNTHESIS 28
• noteID - Optional field indicating the type of class. Links to the notes table.
• topic - An optional string representing the topic of this specific class instance.
Segment 1
Used for device configuration such as its device ID(2 bytes), device password(6 bytes), and
device administrator codes(18 bytes). Also reserved 14 bytes for counters and future use.
Segment 2
12 Courses are represented in this area, with 2 bytes storing a course code, and 8 bytes
storing a short-hand course name. Therefore this section must be at least 12x8 = 96 bytes
long. It is padded to 120 bytes.
CHAPTER 4. DETAIL SOFTWARE DESIGN AND SYNTHESIS 29
Segment 3
Stores the class instances for every day of the week(7 days). Each day requires a start address
offset(1 byte) for the memory space of the specific day’s first class instance, and number of
class instances for that day(1 byte). Therefore this segment is 2x7 = 14 bytes. it is padded
to 20 bytes.
Segment 4
This segment holds information for specific class instances for the week. The start addresses
for the class instances are stored in the startadroffset register for each day at a specific byte
in memory. Every class instance requires the following data: The courseID(1 byte - an offset
in segment 2 of the memory), the start address of student numbers logged for this class
instance(2 bytes). The number of student numbers logged for this class instance(2 bytes).
And the time of logging in hours (1 byte). Therefore this segment requires 6 bytes for every
class instance of the week.
Segment 5
This segment holds logged student numbers. The start address of logged numbers for a
specific class instance on a specific day is determined by segments 3 and 4, therefore this
address space is entirely dynamic and student numbers can easily be added or removed from
memory. Every student number requires 3 bytes of memory to be logged.
MM DD HH:00 CS 212
HELLO 14543109 —b38%
Where ’MM DD HH:00’ represents the current date and time, ’CS 212’ represents the current
class module, ’HELLO 14543109’ represents a greeting to the logged student and —b38%
represents the current battery condition.
4.4.1 index.html
This page will present a login form and access to all configuration parameters on successful
login. Figure E.2 in appendix E shows a screenshot of the configuration page.
CHAPTER 4. DETAIL SOFTWARE DESIGN AND SYNTHESIS 30
4.4.2 status.html
This page does not require authorisation and will return the status of the device.
4.4.3 sync.html
Logging into this page will cause the device to attempt synchronisation with the MyStudies
server via the twisted.web/SOAP interface. The source code for a configuration website
prototype is available in Appendix F.
of classes and object trivial. Unfortunately, a thin client implementation is outside the scope
of this project.
Chapter 5
The hardware testing strategy used is a ’bottom-up’ approach where the leaf-nodes of the
tree-level diagram are first tested individually, and then integrated into its parent branch
when all leaf-nodes of a specific branch is tested. The subsystem branches are then tested
and integrated into their parent subsystem branches until all components are integrated
into the completed system. When all hardware components are integrated, a full system
diagnostic is performed followed by a final field test of the device. The most important
individual components were tested first.
Testing Method:
Test1: Connect the ConnectOne iWifi module to a computer via a UART to USB/RS232
circuit, which is connected to a computer’s USB port. Supply the iWifi module with
3.3V. Set the computer’s COM port to 38400 bps baud rate. Send ’AT+I’ + RETURN
to the iWifi. The iWifi must respond with ’I/OK’.
Test2: Set up an ad-hoc wireless network with a laptop. Configure the iWifi to connect to
the ad-hoc wireless network. Ping the iWifi using the windows ’ping’ command. The
iWifi must respond to all ping requests.
Test Results:
Test1: Passed.
Test2: Passed.
32
CHAPTER 5. TESTING AND INTEGRATION 33
Revisions:
None.
Test Results:
Test Passed.
Revisions:
None.
Testing Method:
1. The board is inspected for defects and compared to the original schematic to verify all
tracks are properly connected.
2. All tracks and vias are tested with a continuity tester for broken tracks
3. Through hole components are inserted (but not soldered) into their positions to ensure
all holes line up.
Test Results:
Power Supply PCB: Passed all tests.
Revisions:
The 24-pin header on the user interface module must be mirrored.
5.1.4 Microcontroller
Testing Method:
Load firmware onto the chip that generates a 20 Hz square wave on one of the timer output
pins. Connect an LED to the pin through a 50ohm resistor to Vcc in series. Supply the
MCU with 3.3V. The LED must blink at 20Hz.
Test Results:
Passed.
Revisions:
None.
5.1.5 LCD
Output is vital in debugging and diagnostics of other components, therefore the LCD test
was conducted before all other components apart from the Wifi module, RFID scanner and
MCU.
Testing Method:
Connect the LCD to the MCU with 8 data lines and 2 control lines as indicated in the
schematic in figure D.3 available in appendix D. Load firmware on the MCU that displays:
This text was designed to fill up all 20x2 characters of the LCD and represents most alphabet
characters. Supply the LCD with 5V. Supply the MCU with 3.3V.
Test Results:
Failed. Some characters did not display correctly.
CHAPTER 5. TESTING AND INTEGRATION 35
Revisions:
Isolate LCD cover from tracks.
5.1.6 Touchpad
Input is also vital in debugging and diagnostics of other components, therefore the touchpad
test was conducted right after the LCD test.
Testing Method:
Supply the touchpad controller with 3.3V. Touch one of the touchpad buttons. Measure the
button’s corresponding output channel for a 1.
Test Results:
Failed. Touching one button resulted in several output channels returning 1 instead of 0.
Revisions:
Remove ground plane between buttons.
Testing Method:
Connect a 120 ohm resistor between the output of the regulator and ground to simulate
power-save conditions. Supply the regulator with 3.3V to 3.6V. Measure the voltage drop
across the 120 ohm resistor with a multi-meter and verify it is within 0.2V of the regulator’s
expected output (3.3V/120ohm = 27.5mA, 5V/120ohm = 42mA). Repeat the test with a
12 ohm resistor for the 3.3V regulator and 20 ohm resistor for the 5V regulator to simulate
maximum load conditions (3.3V/12ohm = 275mA, 5V/20ohm = 250mA).
Test Results:
3.3V regulator: Passed. (Measurements and oscilloscope outputs available in section 6.1.3)
5V regulator: Failed. The 5V regulator made a hissing sound and became extremely hot.
Revisions:
The MAX 682 replaces the TPS 61120 as 5V regulator.
Test Results:
All tests passed.
CHAPTER 5. TESTING AND INTEGRATION 37
Revisions:
None.
Operating Range:
The following reception distance measurements were taken using a laptop , ad-hoc network
and the windows ’ping’ tool:
Conclusion:
Measurements indicate expected results as specified in the component’s datasheet.
39
CHAPTER 6. MEASUREMENTS AND RESULTS 40
Operating Range:
1.6cm
Conclusion:
The device’s current consumption in idle mode is two times less than expected. This will
significantly increase expected battery life.
Figure 6.1 shows the digital oscilloscope outputs for low-power operation with input
voltages of 4.1V and 3.3V.
CHAPTER 6. MEASUREMENTS AND RESULTS 41
(a) Low-power regulation with 4.1V in- (b) Low-power regulation with 3.3V in-
put put
Figure 6.1: Low-power operation regulated output with max and min input voltage.
Figure 6.2 shows the digital oscilloscope outputs for full-power operation with input volt-
ages of 4.1V and 3.3V.
(a) Full-power regulation with 4.1V in- (b) Full-power regulation with 3.3V in-
put put
Figure 6.2: Full-power operation regulated output with max and min input voltage.
CHAPTER 6. MEASUREMENTS AND RESULTS 42
Conclusion:
The 3.3V regulator performs as expected, at greater than 90% efficiency and low enough
output voltage ripple.
The average estimated current that must be sourced from the battery can be calculated
as follows:
3.3 5
Ibat = I3V 3 × Vbat
/0.9 + I5V × Vbat
/0.7
Where 0.9 is the estimated efficiency of the 3.3V regulator and 0.7 the estimated efficiency
of the 5V regulator, and Vbat = 3.6V .
However, battery life can be greatly extended by putting the Wifi module in sleep mode
and shutting down the 5V regulator until a wake-up event occurs.
CHAPTER 6. MEASUREMENTS AND RESULTS 43
The aim of this project was to develop a full automated class attendance register solution.
A mobile Wifi-enabled RFID scanner device was designed and built and controlling soft-
ware was developed. Prototypes for a full application software suite were implemented. All
hardware requirements for the development of such a system were addressed. Most software
requirements were addressed, although only partial prototypes were written in some cases
due to time constraints.
Testing and integration results show that the developed modules satisfy the objectives
of this project, and are suitable for a practical application. The hardware developed can be
used as-is in the field if placed in a suitable enclosure.
The modular tree-level approach taken in synthesis and design of components allows
components to be interchanged if upgrades or superior alternatives become available. This
approach also allows for the system to be easily extended and additional functionality added
if required.
Additional time may still be spent on refining and polishing the system in order for it to
be introduced for use at the engineering faculty of Stellenbosch in 2009.
The design objectives of this project were completed successfully.
7.1 Achievements
This section can be used as a reference for new projects to be developed. It includes findings
and functionality that worked notably well and can be recommended for future solutions.
The following hardware components performed remarkably well:
• The ConnectOne iWifi module. With more functionality than similar modules that is
twice its cost, this device is perfect for adding Wifi capability to a mobile system. The
iWifi was released in the third quarter of 2008.
• The IQS221 capacitive sensor IC from Azoteq. Allowing the creation of custom touch-
pads and sliders, with minimal operating current, the IQS221 provides a perfect user
input solution with no mechanical components that are subject to wear and tear.
• The MAX1811 USB Li-Ion charger IC from Maxim-IC. Minimal external components
required for an effective USB powered Li-Ion battery charger.
44
CHAPTER 7. CONCLUSION AND RECOMMENDATIONS 45
The following software components were critical to the development of this project:
• Python. Python is a powerful and versatile language suitable for high- and low-level
application development.
• For web based interfaces, it is recommended that Python Nevow and Athena be inves-
tigated.
7.2 Recommendations
This section includes recommendations for extending the existing system, and enhancing
system design.
Use of Surface Mount Components: The processing and communications module was
designed for surface-mount only components as the manufacturing for surface mount
components and their availability was not clear. However, the manufacturing processes
at the engineering faculty are sufficient for surface mount component utilisation, and
the use of surface mount components is recommended.
’Thin’ Clients: The use of ’thin-clients’ must be investigated for application software GUIs.
This refers to minimal client code that extracts and presents GUI information from a
central database.
Access Control: This project can easily be adopted for use in an effective wireless access
control system.
Bibliography
[1] Inc., C.E.: Lithium ion battery discharge graph. Available at:
http://www.buchmann.ca/, [2008, October 27], 2008.
[3] Reinhold, C. and Scholz, P.: Efficient antenna design of inductive coupled rfid-systems
with high power demand. Journal of Communications, vol. 2, no. 6, 2007.
[6] ConnectOne: Mini socket iwifi data sheet ver. 1.1. Available at:
http://www.connectone.com/media/upload/Mini_Socket_iWiFi_DS.pdf, [2008,
October 27], 2008.
46
Appendix A
Table A.1 represents a weekly schedule for the planned completion of different aspects of this
project.
47
Appendix B
Project Specification
The project specification as derived from the original project proposal by H.R. Gerber.
• Provide user feedback by means of an LCD, displaying current module data and ad-
ministration information.
• Provide a USB battery charger for charging the power supply battery.
48
APPENDIX B. PROJECT SPECIFICATION 49
• Provide sufficient database structures for user/timetable and Wifi device control.
• Provide a means for different lecturers to post information about the work that will be
or has been covered in a specific lecture.
B.2 Performance
The system must adhere to the following non-functional requirements, or performance char-
acteristics:
• Card data must be scanned and processed as fast as possible.
• The system must be secure. Data transmission and configuration must be secured.
B.3 Interfaces
System user interfaces include:
• Physical user input and feedback via the user interface hardware module.
• Wires connect the power supply module with the processing and communications unit.
• The device communicates with a webserver for transmitting data via HTTP POST.
• The received HTTP POST data is parsed and passed to the MyStudies server via
SOAP.
• The MyStudies server provides an interface between the database and other client
software.
Appendix C
Outcomes Compliance
The following list shows the ECSA level outcomes for this project, and a cross reference for
where specific requirements are met within this document.
1. Problem Solving
Demonstrate competence to identify, assess, formulate and solve convergent and divergent
engineering problems creatively and innovatively.
The problem definition is stated explicitly in section 1.2 on page 1. The scope of the
problem is formulated in section 1.3 on page 2. The divergent engineering problem of system-
level design is discussed in Chapter 2 on page 4, and the component design problems are solved
in a convergent manner in Chapter 4 and 5.
3. Engineering Design
Demonstrate competence to perform creative, procedural and nonprocedural design and syn-
thesis of components, systems, engineering works, products or processes.
The tree-level diagram of figure 2.2 on page 6 is an example of a recursive, non-procedural
design process. The detail level design of individual components in chapters 3 and 4 is a more
procedural approach. The touchpad as shown in figure E.1 in appendix E is an example of
a creative solution to the problem of user input.
51
APPENDIX C. OUTCOMES COMPLIANCE 52
53
APPENDIX D. CIRCUIT DIAGRAMS AND PCB LAYOUTS 54
Figure E.1: Photo of user interface ontop of processing and communications unit.
59
APPENDIX E. PHOTOS AND SCREENSHOTS 60
Source Code
import SOAPpy
#Set up logging:
logging.basicConfig(level=logging.DEBUG,
format=’%(asctime)-25s %(levelname)-8s %(message)s’,
filename=’secure-webserver.log’,
filemode=’a’)
console = logging.StreamHandler()
console.setLevel(logging.DEBUG)
formatter = logging.Formatter(’%(asctime)-25s: %(levelname)-8s %(message)s’)
console.setFormatter(formatter)
logging.getLogger(’’).addHandler(console)
class SecureWebInterface(resource.Resource):
isLeaf = True
def render_GET(self, request):
self.host = "127.0.0.1"
self.port = 9080
self.client = "127.0.0.1"
###
try:
logging.debug("Info: Connecting to " + self.host+":"+str(self.port))
self.headerdata = {"username": "8001", "password":"aaBB33", "client":self.client}
self.__header = SOAPpy.headerType(data = self.headerdata)
self.server = SOAPpy.SOAPProxy(self.host+":"+str(self.port), header=self.__header)
self.server.status()
logging.debug(’Info: Connected successfully to SOAPProxy @ %s:%s’ % (str(self.host), str(self.port)))
return "<html>Worked</html>"
except Exception, why:
logging.error(’Error: connect error: ’ + str(why))
62
APPENDIX F. SOURCE CODE 63
return False
###
return "<html>Hello, world!</html>"
def render_POST(self,request):
print request.received_headers
print request.content.readlines()
print request.args
print request
return "<html></html>"
site = server.Site(SecureWebInterface())
try:
sslContext = ssl.DefaultOpenSSLContextFactory(’keys/ca.key’,’certs/ca.cer’)
reactor.listenSSL(8080, site, contextFactory = sslContext)
logging.debug("Starting server and waiting for connections...")
reactor.run()
except Exception, why:
logging.error("Unable to start server: %s" % (str(why),))
#include "rfid_scanner.h"
char dataReceived;
char data;
smd0_u0mr=1;smd1_u0mr=0;smd2_u0mr=1; //UART mode transfer data 8 bits long selected(u0mr bit 0, 1 and 2)
ckdir_u0mr=0; //Internal clock selected(u0mr bit 3)
stps_u0mr=0; //1 stop bit selected(u0mr bit 4)
prye_u0mr=0; //Parity disabled(u0mr bit 6)
clk0_u0c0=0;clk1_u0c0=0; //BRG count source f1 selected(u0c0 bit 0 and 1)
uform_u0c0=0; //Transfer LSB first(u0c0 bit 7)
u0brg=32; //Setting UART0 baud rate generator(max 255). Calculated value is round to th
te_u0c1=1;
re_u0c1=1; //Reception enabled(u0c1 bit 2)
u0rrm_u0c1=0;
u0c0 = 0x00;
//dataReceived = 0;*/
//**************************************
// UART 1 Setting - RFID READER
//**************************************
//Set TXD1 pin to output port direction, set RXD1 pin to input port direction
//By default, TXD1 is at P0_0 pin, RXD1 is at P3_7 pin
//Set uart1sel0 and uart1sel1 of pinsr1 register and u1pinsel, txd1sel and txd1en of pmr register to change TXD1 and R
//Poll for the status of Ri(Receive complete flag) in your UART 1 routine to check whether reception has completed
uart1sel1 = 0;
uart1sel0 = 0;
u1pinsel = 0;
txd1sel=0;
txd1en=0;
smd0_u1mr=1;smd1_u1mr=0;smd2_u1mr=1;//UART mode transfer data 8 bits long selected(u1mr bit 0, 1 and 2, pmr bit 5)
ckdir_u1mr=0; //Internal clock selected(u1mr bit 3)
stps_u1mr=0; //1 stop bit selected(u1mr bit 4)
prye_u1mr=0; //Parity disabled(u1mr bit 6)
clk0_u1c0=0;clk1_u1c0=0; //BRG count source f1 selected(u1c0 bit 0 and 1)
uform_u1c0=0; //Transfer LSB first(u1c0 bit 7)
u1brg=64; //Setting UART1 baud rate generator(max 255). Calculated value is round to the
te_u1c1=1;
re_u1c1=1; //Reception enabled(u1c1 bit 2)
s1tic=0x00; //Set UART1 transmit interrupt piority level 0(s1tic)
s1ric=0x04; //Set UART1 receive interrupt piority level 2(s1ric)
}
void ch0_handle_input()
{
char received;
received = u0rb;
lcd_write_char(received);
}
{
while(ti_u0c1 == 0);
u0tb = msg;
}
/**Function is called when data is received on UART1 channel called due to interrupt.*/
void ch1_handle_input()
{
char received;
received = u1rb;
//while (ri_u1c1); //Wait while data is read
rfid_handle_received(received);
}