UNI V E R SI T EI T• S T E L L EN BO S CH•UNI V E R SI T Yj o u k e n n i s v e n n o o t • y o u r k n ow l e d g e p a r t n e rDesign Of An AutomatedClass Attendance Recording SystembyCarel van Wyk14543109Project E448Report submitted in partial fulﬁlment of the requirements ofthe module Project (E) 448 for the degree Baccalaureus inEngineering in the Department of Electrical and ElectronicEngineering at the University of StellenboschSupervisor: H.R. GerberOctober 2008AcknowledgementsI would like to express my sincere gratitude towards the technical and teaching staﬀ ofthe E&E Department of the Stellenbosch University Engineering faculty. Without theirprofessional and friendly assistance, this project would not have been realisable.I would like to thank the following people speciﬁcally:• Mr H.R. Gerber• Mr Ashley Cupido• Mr Ralph A. Dreyer• Mr Quintis Brandt• Mr Wessel Croukamp• Mr Charles S. Fredericks• Mr Johan Arendse
iDeclarationBy submitting this report electronically, I declare that the entirety of the work containedtherein is my own, original work, and that I am the owner of the copyright thereof (unlessto the extend explicitly otherwise stated) and that I have not previously in its entirety or inpart submitted it for obtaining any qualiﬁcation.Signature: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C.P.J. van WykDate: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Copyright °c 2008 Stellenbosch UniversityAll rights reserved.iiAbstractThe goal of this project is to design and develop a fully functional automated class attendanceregister system, including hardware, ﬁrmware and application software. The project makesuse of RFID and Wiﬁ technology, and basic research of RFID equipment was conducted. Itwas shown that an eﬀective attendance register system can be implemented with the help ofnew and emerging technologies. ConnectOne’s iWiﬁ module is used for Wiﬁ communication.Python is used as far as possible in the development of application software. The applicationsoftware will be integrated with H.R. Gerber’s MyStudies application and server. This reportprovides background information and an introduction to the project, a system level designoverview and detailed design solutions. Tests and measurements are also provided in theﬁnal chapters.iiiUittrekselDie doel van hierdie projek is om ’n volledige klasbywonings-register stelsel te ontwerp en teimplimenteer. Dit sluit in die ontwerp van hardeware, ’middel’-ware en sagteware. Die projek maakgebruik van ’RFID’ tegnologie en ’Wiﬁ’ draadlose kommunikasie. Die werking van’RFID’ is oppervlakkig ondersoek. Daar word gewys dat ’n eﬀektiewe klasbywonings-register
stelsel met behulp van nuwe en opkomende tegnologie ontwikkel kan word. ConnectOne se’iWiﬁ’ module word gebruik vir draadlose kommunikasie. ’Python’ is so ver as moontlikgebruik in die skryf van sagteware. Die stelsel se sagteware sal met H.R. Gerber se ”MyStudies”programen bediener integreer. Hierdie verslag voorsien ’n agtergrond en inleiding totdie projek, so wel as ’n stelsel vlak oorsig en detail ontwerpsoplossings. Toetse en meetingsword ook voorsien in latere hoofstukke.ivContentsDeclaration iiAbstract iiiUittreksel ivContents vList of Figures viiiList of Tables ixNomenclature x1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Problem Deﬁnition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Scope and Aims of Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Introduction to Other Chapters . . . . . . . . . . . . . . . . . . . . . . . . . 32 System Analysis and Design 42.1 System and Design Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 52.1.1 Technologies Utilised . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Study of RFID technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2.1 General concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2.2 Antenna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.2.3 Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
LED - Light Emitting DiodeMCU - MicrocontrollerPCB - Printed Circuit BoardGSM - Global System for Mobile communicationsIO - Input/OutputGPIO - General Purpose Input/OutputGUI - Graphical User InterfaceUART - universal asynchronous receiver/transmitteEEPROM - Electrically Erasable Programmable Read-Only MemoryRAM - Random Access MemoryRTC - Real Time ClockDIP - Dual Inline PackageIC - Integrated CircuitLDO - Low Dropoutbps - Bits per secondxChapter 1IntroductionThis chapter provides an introduction to this report, and provides background informationto the project. It includes a deﬁnition of the problem, and states the scope and aim of thisproject. An introduction to following chapters are provided at the end of this chapter.1.1 BackgroundUp until now, class attendance records have been maintained manually by having studentssign next to their names on printed class lists during class. This method is outdated andtime-consuming, and may be improved by applying technology and designing an automatedelectronic class attendance recording system.
There are many cases in which it would be beneﬁcial for the University of Stellenbosch tobe in possession of an automated class register system. Such a system would be of most valueto students, who may make use of system reports and statistics to assess their own approachto their studies, and be kept informed about course material covered in classes attended andmissed.An automated attendance recording system would be advantageous to the lecturer, byproviding data on student attendances which may be correlated with a student’s academicprogress.Attendance recording is an important aspect of tests and exams, where a record must bekept of students writing the paper.Finally, such a system could provide evidence of a student’s class attendance habits incases where the University is accused by a student of providing insuﬃcient guidance inlectures. In such cases, the University holds no liability if it can be showed that the studentwas regularly absent from class.1.2 Problem DeﬁnitionThis project is derived from a topic suggested by Mr. H.R. Gerber for the development of anautomated class attendance recording device. The device must positively identify studentsand provide reliable class attendance logs for the beneﬁt of students, lecturers and the University, asdescribed in the previous section.1CHAPTER 1. INTRODUCTION 2Attendance logs must be stored on a centralised database in order to generate reports andstatistics. 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 thesystem for eﬀective self-assessment and keeping up to date. Lecturers should be able to viewattendance 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.1.3 Scope and Aims of ProjectAs part of the original project proposal, it was speciﬁed that the student identiﬁcation devicemake use of RFID scanner technology, and that the device should be able to communicatevia wireless with the central database server. As such, using an RFID scanner and wirelesscommunications is part of the project scope, however alternatives to RFID and wireless communicationis discussed in Chapter 3 section 3.1.1 and 3.2.1 of this report.The aims of this project are, in order:• Provide a mobile RFID scanner device capable of scanning student cards with embeddedRFID chips and processing the data on the card.• Provide a software suite to log information about scanned cards against a database andprovide detailed statistics and feedback about attended and missed classes to studentsand the lecturer. The software suite must include suﬃcient administration capabilities.• Provide a wireless interface between the scanner and database server.• Maximize battery life of the mobile scanner device and provide a simple USB-chargerinterface.The scope of this project includes designing and assembling the mobile, Wiﬁ enabled,student card scanning device, designing and writing the ﬁrmware required for operating thedevice, and designing and writing a full software suite for managing multiple scanning devices andproviding detailed feedback to students and lecturers as described in the projectspeciﬁcation in appendix B. The software suite must be integrated with H.R. Gerber’s MyStudiesframework as far as possible. The scope of this project does not include an in-depththeoretical study on a particular subject.CHAPTER 1. INTRODUCTION 31.4 Introduction to Other ChaptersChapter 2 speciﬁes the design process used, and states design limitations. It includes ananalysis of the problem, the design process and a system level analysis.Chapter 3 and 4 contains detailed design considerations for all leaf-node components of this
project, as deﬁned in chapter 2Chapter 5 contains testing and integration information.Chapter 6 contains recommendations and a conclusion to the project.Chapter 2System Analysis and DesignThe design approach used in this project involves breaking the main system up into subsystems 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 levelof subsystems. This method forms a tree-like structure overview of the system as representedin ﬁgure 2.2. In this way, system level analysis and design is done by looking at the overlaying structureof the system, while detail design is limited to the leaf nodes. At the lowestlevel, components and design methods are chosen based on functional and non-functionalrequirements 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 encompassingtop-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 ﬂow-chart representation specifyingthe design approach used for this project, with inherent awareness of design constraints andlimitations.Focusing on designing subsystems provides an advantage in that once one sub-system’sdesign is completed, it may be sent in for manufacturing while design of the other subsystemscan continue in parallel with manufacturing, which saves time. If one subsystem fails, it canbe redesigned without inﬂuencing other sub-systems, and in this way valuable time is saved.4CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 5STARTCan System bebroken up into
subsystems?Identify functionalrequirements.Create new branch.YesCreate Leaf-Node.Find suitable componentbased on functional requirements.NoDoes the component adhereto non-functional requirementsand design constraints?Use ComponentYesNoFigure 2.1: Design decision ﬂow chart2.1 System and Design OverviewBefore subsystems can be identiﬁed, the functional requirements for this project must beidentiﬁed ﬁrst. The requirements have been derived from the original project proposal byH.R. Gerber and are available in appendix B. Analysing the problem as deﬁned in 1.2 thenbecomes simple. By examining the project requirements, a tree-level diagram of subsystemsis created which represents a full system level overview.The tree diagram in Figure 2.2 represents the system level analysis of the problemdeﬁned in 1.2. The three main parts of the system is the hardware, ﬁrmware and application
software components. Hardware can be broken up into three main modules: A power supply,a processing and communications module and a user interface. The ﬁrmware will control thehardware and manage the interfaces between the hardware, application software and the user.The application software component can also be broken up into three logical subsections: Thedatabase, GUIs and wireless device administration and synchronisation. The bottom-levelor leaf-nodes are discussed in chapters 3 and 126.96.36.199 Technologies UtilisedRFIDAs per the project speciﬁcation, an RFID scanner is used for student identiﬁcation. A briefstudy of RFID is included in the next section.CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 6Figure 2.2: Tree-level diagram802.11b/g WiﬁThe mobile scanner device will use an 802.11b/g Wiﬁ module to communicate with theStellenbosch University campus wide wireless network, ’Maties Wiﬁ’.Capacitive SensorsThe 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.MyStudiesMyStudies is a framework for the management of students, courses, classes and work. Itconsists 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 integratedwith the MyStudies framework and will rely on the MyStudies server for data storage andmanagement.CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 7SOAPSOAP 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.PythonPython1is a highly versatile and dynamic interpreted programming language. It will beused as the basis for most application software in this project with the exception of deviceﬁrmware and conﬁguration webpages. Python really is a remarkable language that providespowerful libraries, and allows for rapid prototyping and development. VisualWx was usedfor making WXPython based GUIs.TwistedTwisted2is an event-driven networking engine programmed in Python. Twisted.Web is usedas webserver instead of apache to allow direct integration of the python based web servercode and other python based application software code. Data is transferred from the wirelessscanner device to a Twisted.Web server webpage via HTTP POST. The data is parsed andthen submitted to the MyStudies server via SOAP.MySQL DatabaseMySQL is a relational database that is used by the MyStudies framework. The MySQLdatabase will be used for all data storage in this project.2.2 Study of RFID technologyAs RFID is an integral part of this project, the literature study focuses on a white paper onRFID technology released by BITKOM, German Association for Information Technology,Telecommunications and New Media.2.2.1 General concept
RFID, or Radio Frequency Identiﬁcation, relies on two main components: The RFID scanneror reader and the RFID tag or transponder. For the one to communicate with the other,both must make use of the same carrier frequency, with RFID frequencies currently rangingfrom 125 kHz in the LF range to 5.8 Ghz in the UHF range. Additionally, a secured systemmay make use of cryptographic functions for one-way or two-way identiﬁcation.1www.python.org2http://twistedmatrix.com/CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 82.2.2 AntennaAccording to BITKOM, the typical read-range of ISO 14443 based cards (as used byStellenbosch University) are 7-15cm, even though tests mentioned elsewhere in this reportshows proximity distances of 1.6cm or less for this report’s speciﬁc application. In shortread-distance applications like this, the tag is within the near-ﬁeld of the reader antenna’selectromagnetic wave pattern when it is scanned. The card’s antenna is in the form of acoil or inductive loops that run around the edge of the card, and the card’s RFID microchipis powered by energy transferred from the reader to the card antenna’s inductive loops viamagnetic coupling.2.2.3 ModulationFigure 2.3: Airgap Interface between card and scannerIn essence, the connection between the reader and card is represented by an airgap interface which isthe 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 thatcouples the reader and card antennas at a speciﬁc carrier frequency. This is representedin ﬁgure 2.3.
• To enable a layer of communication, information must be modulated on the wave.• On the logical layer, the structure of commands and data are speciﬁed by ISO or otherproprietary standards. It is important that all layers of the air interface adhere toglobal standards in order to ensure compatibility with other RFID systems worldwide.2.2.4 Stellenbosch University ImplementationThe RFID tags embedded in Stellenbosch University student cards are Write Once ReadMany (or WORM) modules, with 26 bytes of user data, including 8 bytes representing thestudent’s unique student number and 4 bytes representing the year of issue. These cardsoperate at 13.56MHz and makes use of the ISO 14443 based, MIFARE secure encodingCHAPTER 2.SYSTEM ANALYSIS AND DESIGN 9standard, which has been shown by Nohl and Plotz to have critical security vulnerabilities.The RFID reader units used by the University are Model 718-10 scanners from GSC systems.2.3 Design ConstraintsOne of the most important factors in deciding on a design process is to be fully aware of designconstraints and limitations. The chosen design process for this project aims to minimise theimpact of design constraints, and to defer design limitation resolution to the leaf-nodes (orbottom design layers). This project was subject to several key design limitations which islisted here:Budget: With a limited project budget, it is not possible to simply select the ﬁrst and bestoption that presents itself. Care must be taken to minimize component and manufacturing costs andsometimes creative solutions need to be found for problems that maybe 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 software designand synthesis, obtain all components and write a project report, the designprocess must be optimized to maximize productive time. Design processes may takeplace in parallel if properly coordinated, for example: software development may take
place while hardware components are being manufactured. Readily available components must beselected as far as possible and critical non-readily available componentsmust be available in time.Limited availability of passive components: Even though surface-mount resistors, capacitors or inductorsmay work better in some situations, these components are notreadily available in faculty stores. As these components are purchased in reels of thousands and typicallyonly one or two of speciﬁc values are required at a time, it is notfeasible to purchase such components on the project’s budget. Other examples of limited componentsinclude basic elements such as screw terminals, spacers, screws andstand-oﬀs.Limited manufacturing capabilities: In some cases, the design process has to rely onmanufacturing facilities available at the Electronic Engineering faculty, as professionalmanufacturing would overshoot the budget too far. In some cases, this limits componentselection and other design aspects.2.4 Chapter 2 ConclusionA system level design overview of the project can easily be seen in ﬁgure 2.2. As mentionedin 2.1.1, this project implements several cutting edge and exciting technologies, both interms of hardware and software, to solve design problems.Chapter 3Detail Hardware Design and SynthesisAs discussed in section 2.1, the leaf-nodes of the hardware branch of the design tree areanalysed in this chapter. The design process used is speciﬁed in chapter 2 and is representedby ﬁgure 2.1. From the tree-level diagram in ﬁgure 2.2 it can be seen that the hardwarecomponents of the project can be broken up into three main sub-systems: The power supply,processing and communications unit and user interface.3.1 User Interface3.1.1 Student Identiﬁcation ScannerThe project speciﬁcation requires RFID to be used for student identiﬁcation, and the RFID
scanner must be provided by the University’s access control department since it is preconﬁgured withencryption keys for Stellenbosch University student cards. Therefore, there were nodesign choices possible for this hardware component, although alternatives are listed below.Student cards are the primary method of student identiﬁcation on campus. From the startof 2007, all Stellenbosch University student cards are equipped with an RFID chip that can beread by holding it brieﬂy against a conﬁgured proximity sensor. Due to its ease of use, RFIDtechnology is perfectly suited for use in an automated class attendance recording system.The advantages of using RFID are speed (cards can even be scanned through wallets), andavailability (students should have their cards available at all times). The disadvantages ofRFID are that students could lose their student cards, and that students could ’lend’ theircards to their friends to have it scanned for them. In the former case, a class list may still bemade available for individuals without cards and the latter case is outside the scope of thisproject.Table 3.1 represents a list of possible solutions to the problem of student identiﬁcation.For this project, the GSC systems Model 718-10 Mifare RFID scanner is used.Requirements• Minimum 5V voltage rail.• Approximately 120mA @ 5V according to datasheet.10CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 11• RS232 receiver @ 19200 bps baudrateName Description Advantages DisadvantagesRFID RFID chips embedded in all student cards.Fast, Eﬃcient,AvailabilityCard may begiven to friend
for scanning.Biometrics Finger print or retina scanner. Absolute positive identiﬁcationVery expensive,SlowMagstripe The magnetic strip on all studentcards.Availability Slow, Wear andTear, Old technology, Cardmay be givento friend forscanningTable 3.1: Student Identiﬁcation Solutions3.1.2 LCDA standard 16-pin KS0066U or equivalent alphanumeric LCD is used for user output. As withmost components, the primary design constraint for this component is cost, and the secondarydesign constraint is size. A standard 20x2 characters LCD was chosen for maximising outputspace while minimising cost and physical dimensions.For this project the model 202A-FC-BC-3LP from Displaytech was ordered from RS SouthAfrica. This speciﬁc model features black on white text with a white LED backlight for amore modern and professional look than a yellow on green LCD. The LCD will be operatedin 8-bit mode, as opposed to 4-bit mode, to increase display speed. Two control lines arealso required.The LCD requires three resistors: Two determine contrast and one determines backlightbrightness. The method for choosing these resistors was by ﬁrst connecting the correspondingresistors pins to variable resistors and tuning the resistor parameters until optimal contrast
and brightness levels was found.Figure 3.1 represents the calibrated resistor conﬁguration for determining LCD contrastand brighness.Requirements• Minimum 5V rail.• Approximately 10mA @ 5V operating current + 20mA @ 5V backlight current.• 8+2 General Purpose I/O lines directly to the MCUCHAPTER 3. DETAIL HARDWARE DESIGN ANDSYNTHESIS 12Figure 3.1: Calibrated LCD resistor values.3.1.3 Keypad or TouchpadFor user input, the conventional choice would have been a matrix keypad, but it was decidedthat a more exciting and creative approach would be appropriate for this project, since othercentral components used in this design (such as the RFID scanner and Wiﬁ module mentioned later) arealso examples of new and interesting technologies.The ISQ221 proximity sensor chip from Paarl based company, Azoteq, provides a capacitive sensor arraywith binary outputs. This means that a custom touchpad can easily bemanufactured by etching conductive pads and tracks on a standard PCB. A touchpad alsooﬀers 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 creativetouchpad designs.• When a button pad is touched, a binary 1 is immediately output on the correspondingoutput channel, as opposed to a matrix keypad that requires scanning which takesseveral clock cycles.• The IQS221 is designed and supported locally in Paarl, less than 40km from Stellenbosch.See below for a basic explanation of capacitive sensors. A photograph of the user interface’s customtouchpad is available in appendix E, as ﬁgure E.1.
Capacitive SensorsLionPrecision describes capacitive sensors as follows:CHAPTER 3. DETAIL HARDWARE DESIGN ANDSYNTHESIS 13’Capacitive sensors use the electrical property of capacitance to make measurements. Capacitance is aproperty that exists between any two conductive surfaceswithin some reasonable proximity. A change in the distance between the surfaceschanges the capacitance. It is this change of capacitance that capacitive sensorsuse to indicate changes in position of a target.’For this project, the IQS221 evaluation module, model AZP075A05-2008, was obtainedfrom Azoteq.Requirements• Minimum 3.3V voltage rail• 190uA operating current @ 3.3V• 8 digital inputs, each corresponding to one touch pad. Connected either directly to theMCU or to a bus expander.3.1.4 Interface PCBThe PCB and schematic for the user interface module is available in appendix D. There isno critical design constraints involved in the user interface’s PCB design. The only notableaspect of this PCB’s design is the custom touchpad area, as discussed in section 3.1.3. Otherwise, somecare was taken to ensure proper mounting of the LCD, touchpad controllermodule, RFID scanner and the other two project PCBs (Processing and communicationsmodule and power supply module).CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 143.2 Processing and Communications UnitThe processing and communications unit is the core of the hardware device sub-systemsthat the other sub-systems connect to. It handles processing and storage of data, provideswireless communications and provides the appropriate interfaces for the power supply anduser interface module to connect to. The most integral leaf-node component (As deﬁned
in chapter 2) of this subsystem is the wireless communications module. All other leaf-nodedesign choices for this sub-system must be compatible with the choice of wireless module.3.2.1 Wireless Communications ModuleThe most integral design aspect of the processing and communications unit is the wirelesscommunications module, and therefore much care was taken in ﬁnding a suitable module.Table 3.2 represents several possible solutions to this problem1:Protocol SelectionThere are three main wireless protocols represented in the table 3.2 table: Zigbee, Bluetoothand Wiﬁ. The main design consideration for this component is compatibility with existingwireless infrastructure in order to maximise operating range and minimise additional costsand design, such as custom base station hardware. Stellenbosch University boasts a campuswide Wiﬁnetwork, ’MatiesWiﬁ’. Interoperability with this network will ensure wirelessconnectivity across campus and in all classrooms, which makes it ideal for the objectives ofthis project. Therefore, the wireless communications module choice is narrowed down to the802.11b/g Wiﬁ modules.Module SelectionFrom the advantages and disadvantages columns in the table 3.2, it was concluded that themost attractive option for this application is the Mini Socket iWiﬁ module from ConnectOne.It also happens to be least expensive of the Wiﬁ modules (R470 at time of purchase), and isonly slightly more expensive than a Bluetooth or Zigbee solution.The iWiﬁ is an impressive piece of technology that lives up to all expectations. Releasedin 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 UARTand support for the following protocols:Internet Protocols: ARP, ICMP, IP, UDP, TCP, DHCP, DNS, NTP, SMTP, POP3, MIME,
HTTP, FTP and TELNETSecurity Protocols: SSL3/TLS1, HTTPS, FTPS, RSA, AES-128/256, 3DES, RC-4, SHA-1, MD-5, WEP, WPA and WPA2The author can strongly recommend this module for use in future projects that require Wiﬁcommunication capabilities.1Dollar to Rand conversion done using R8 per $1CHAPTER 3. DETAIL HARDWARE DESIGN ANDSYNTHESIS 15Name Description Advantages Disadvantages PriceJennicJN5121(Zigbee802.15.4) Used forwireless personalarea networks(WPANs). Simplerthan Bluetooth.Low Power consumption, Compact, Simple, Combined wireless module and MCULow data rate, ShortRange (20m indoors),Requires base stationhardwareR260+R800ProgrammerBluetooth (802.15.1) Used
for Wireless Personal Area Networks.Low power consumption, Compact, Universal hardware (laptops, PCs), AT command set interfaceLow data rate, ShortrangeR460GSM (GSM 07.07)Global System forMobile communications. Used fordata transmissionby mobile phones.Universal hardware(mobile phones,laptops, PCs), ATcommand set interface, Higher Datarate,Very long rangeHigh power consumption, Data transmission not freeR160toR930RabbitCoreRCM5400W(Wiﬁ 802.11b/g)Wiﬁ enabled MCUwith 39 GPIO and512K Flash memory
Universal hardware(laptops, PCs, APs),High datarate, Programmed over serial,Standard externalantenna connector,long rangeRelatively high powerconsumption, ExpensiveR790EzurioWISMC01(Wiﬁ 802.11b/g)Wiﬁ enabled MCUwith 12 GPIO, 210bit A/Ds andUARTUniversal Hardware(laptops, PCs, APs),High datarate, Programmed over serial,Relatively Low powerconsumptionNo external antenna,Shorter range thanother 802.11 modules,Expensive
External antenna connector, Long range,CompactRelatively high powerconsumption (but lessthan some other wiﬁmodules)R470Table 3.2: Wireless Communications Module SolutionsCHAPTER 3. DETAIL HARDWARE DESIGN ANDSYNTHESIS 16iWiﬁ Requirements• Minimum 3.3V (Maximum 3.6V) voltage rail• 250 mA @ 3.3V for transmit, 8 mA @ 3.3V in power save mode• One UART channel• Any standard reverse polarity SMA connector dipole antenna3.2.2 Antenna SelectionAny standard reverse polarity SMA connector 2.4 GHz antenna may be used with this module. A 2.5dBidipole antenna is recommended by ConnectOne, and one was ordered alongwith the iWiﬁ module from Mouser.com. Larger dipole antenna’s up to 9dBi is availablefrom Scoop Distributions2in Cape Town. Range tests are available in Chapter 6.2www.scoop.co.zaCHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 173.2.3 MicrocontrollerChoosing a microcontroller is not a critical design consideration of this project. Any genericMCU with enough General Purpose IO pins, UART channels, an I
2C bus, and ﬂash memorywill be suﬃcient. As with all leaf-nodes, non-functional requirements carry the most weightin choosing the component, and therefore availability of the MCU chip and MCU programmerplayed the most important role in this case. Table 3.3 presents the three possible MCU’sthat was readily available along with their programmers.Name Description Advantages DisadvantagesRenesasR8C/2732 pin, 20Mhz general purpose MCU used in DesignE314.Immediately available, 32 pin wideDIP socket.No Built-in RS232RenesasR8C/2B62 pin general purposeMCU. Advanced version ofthe R8C/27Faster thanR8C/27, Moreﬂash memorySurfacemount LQFP64,Not immediately
available, Nobuilt-in RS232MicrochipPIC18F255028 pin general purposeMCU.Built-in RS232 interfaceUnfamiliar platformTable 3.3: Possible Microcontroller SolutionsThere are no deﬁning characteristics that put one MCU above the other. Thereforethe R8C/27 which was available immediately along with its programmer was chosen, eventhough either of the other two chips would have been adequate. Furthermore, the R8C/27 isinexpensive, and oﬀers a familiar embedded development platform and requires little power.Operating VoltageOne important design consideration regarding the microcontroller is its operating voltage,as this will aﬀect interfacing with components that operate at voltage levels diﬀerent fromthe MCU. Since the wireless communication module can handle an absolute maximum of3.6V, and is considered one of the integral components of this project, it was decided thatthe MCU operate at the same voltage as the wireless module at 3.3V to eliminate the needfor level translators.Requirements• 3.3V to 5V input voltage• 32.768 kHz crystal• Approximately 10mA @ 3.3VCHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 183.2.4 Memory Module
The memory module must provide non-volatile data storage for when the scanning device isout of range or in case of power loss. Any ﬂash memory module with at least 8 kilobytesof RAM will be suﬃcient for this project’s purposes. An M24C64 EEPROM module with8 kilobytes of memory and I2C interface was chosen as it was immediately available, has asmall footprint and is simple to program. The memory map of the EEPROM module for theWiﬁ RFID scanner device is available in chapter 4.Requirements• 3.3V to 5V input voltage•I2C interface• 5uA in standby mode, 2-5mA in read/write mode3.2.5 Real Time ClockA real time clock component will keep track of time, even if the device loses power, by meansof a separate battery backup. As motivated in 3.2.9, it was decided that the processing andcommunications module PCB consist only of through-hole components. At time of writing,there is only one I2C real time clock available from RS South Africa3in 8 pin DIP format,the DS1307+ from Maxim-IC4
, and it was chosen for this project. Any I2C RTC would havebeen suﬃcient for this design. The DS1307 provides an ultra-low battery backup mode at500nA with a 3V battery backup power supply, while the standard operating voltage forreads and writes are 5V.Requirements• 32.768 kHz crystal• 5V Input• 1.5mA supply current @ 5V•I2C interface• 3V battery + battery clip3.2.6 Bus ExpanderA bus expander interface is useful for key- or touchpad input. It frees up valuable generalpurpose IO pins on the microcontroller and also provides suitable interrupt functionality. Forinstance, a bus expander can generate an interrupt if any of its input pins change state, sothat the microcontroller is notiﬁed of a key change event, and need to poll the bus expander3www.rssouthafrica.com4www.maxim-ic.comCHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 19only once in order to determine which key was pressed. This method is opposed to connectinga 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 I2C bus, the busexpander will also make use of I2C. Any general purpose bus expander with 8 or more inputpins, an I2C interface and an interrupt output pin is suitable for this project. The MCP23017was chosen since it meets all these conditions and was instantly available.Requirements• 3.3V to 5V operating voltage• 1mA operating current @ 3.3V•I2C interface• One interrupt line3.2.7 RS232 InterfaceThe RFID scanner outputs scanned student card data in RS232 format. The renesas R8C/27microcontroler chosen for this project does not include a built-in RS232 interface. WhereUART represents a logical 1 with Vhigh and a logical 0 with Vlow, RS232 represents a logical 1with -12V and a logical 0 with +12V. The R8C is unable to generate these output levels,so an RS232 interface chip is required. Since it was decided in 3.2.3 that the microcontrolleroperate at 3.3V, the RS232 interface chip must also operate at 3.3V.Two pin-identical DIP18 chips were obtained: The LTC1385 from Linear Technologies
5and the MAX3222CPN+ from Maxim-IC6. These two chips are identical in almost all regards,both are low-power chips, both operate at 3.3V and provide two RS232 to UART interfacechannels, and they have identical pin-outs. There are only two diﬀerences. The ﬁrst beingthat the LTC1385 has electrostatic discharge protection while the MAX3222 does not, andthe second being that the LTC1385 actually supports EIA/TIA-562 (which is the low-voltageversion of RS232), while the MAX3222 supports true RS232. Both are compatible with theRFID scanner.Since both chips were already available, the LTC1385 was chosen, although it could beswapped with the MAX3222 without any changes in PCB layout or component design.Requirements• 3.3V input• 200uA @ 3.3V input operating current• One UART channel5linear.com6maxim-ic.comCHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 203.2.8 USB CommunicationIt was decided that USB communication between the Wiﬁ scanner device and a host device isan unnecessary feature. Even though it would be trivial to implement, USB communicationrequires additional UART to USB conversion hardware and will only increase costs. Implementing wiredcommunication on a wireless device defeats the purpose of using a wirelesscommunication module.If serial communication with a host device is required, it can easily be implemented by
using the unused secondary channel on the RS232 interface chip.3.2.9 Processing and Communications PCBThe PCB and schematic for this module is available in appendix D. The processing andcommunications PCB was the ﬁrst to be completed, and at the time of layout there wasstill uncertainty regarding the level of detail available in the manufacturing process madeavailable at the electronic engineering faculty. As such it was decided that components forthis PCB be limited to through-hole components and that surface-mount components beeliminated. This also had the advantage of a simpliﬁed PCB design and use of more robustcomponents.CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 213.3 Power SupplyDesign of the wireless scanner’s power supply is dependant on the requirements of all otherchosen hardware components. The DC voltage regulators are dependant on the requirementsof the other components used in hardware design, and the DC voltage source is dependanton the power required by the voltage regulators.3.3.1 Power SourceThe project speciﬁcation indicates that the scanner device must be mobile; therefore thepower source must be a battery. The battery must adhere to the following requirements:• It must be rechargeable.• It must have large capacity.• It must be compact with an optimal energy density ratio.• It must have a long lifespan.• It must be able to deliver enough peak-current.Table 3.4 lists possible battery solutions:Type Nominal Voltage[V] Energy Density [Wh/kg] Lifespan [years]Alkaline 1.5 85 <5
Ni-Cad 1.2 60NiMH 1.2 80Li-Ion 3.6 160 2-3Li-Poly 3.7 130-200 2-3Table 3.4: Rechargeable Battery TypesAll batteries in the table are capable of delivering suﬃcient peak current for this project’sapplication. From table 3.4, it was decided that a Li-ion cell be used, as it features a highenergy density ratio and is readily available. Figure 3.2 provides a graph of estimated batteryterminal voltage in terms battery depletion.Two 2400mAh TrustFire Protected 18650 Lithium-Ion Batteries were ordered from DealExtreme7at R45 per cell8. This battery received overwhelmingly positive reviews and includes aprotective embedded PCB for short-circuit, overcharge and discharge protection. The authorcan strongly recommend these cells for any mobile application.7www.dealextreme.com, stock number sku.57768At an exchange rate of R8 per 1 USDCHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 22Figure 3.2: Li-Ion Output Voltage Depletion Chart3.3.2 Voltage RailsInspection of the other leaf-nodes of the hardware design branch, as indicated in ﬁgure 2.2,indicates that two voltage rails are required: 3.3V and 5V. A rough estimation of the powerconsumption for each rail must be made in order to determine the required power rating ofeach rail’s regulator.
Assessment of the previous sections in this chapter shows the following components foreach rail, with their estimated peak current consumption:3.3V Rail: Touchpad (190uA), Wiﬁ (250mA), MCU (10mA), memory (5mA), bus expander(1mA), RS232 (200uA)5V Rail: RFID scanner (120mA), LCD (30mA), RTC (1.5mA)As shown in table 3.5, the 3.3V regulator must be able to source a minimum of 293mApeak current, while the 5V regulator must be able to source at least 167mA. The 5V regulatormust also include a disable/shutdown option, to provide an enhanced sleep mode for thedeviceThe requirements for both regulators are:• It must be ultra-eﬃcient.CHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 233.3V Rail 5V RailTotal Estimated Peak Current Consumption 266mA 152mA10% Safety Factor 26.6mA 15.2mA293mA 167mATable 3.5: Estimated Current Consumption• It must require minimum external components.• It must be as stable as possible.• It must have an enable/shutdown control pin.• It must be low-dropout (LDO).3.3V RailSince a 3.6V Li-ion voltage source is used, the 3.3V regulator must be a step-down DC-DCconverter. Table 3.6 is a table of 3.3V step-down DC-DC converters that was acquired.Name Description MaximumOutput
CurrentEﬃciency InputVoltageTexas InstrumentsTPS622602.25Mhz high eﬃciency synchronous step-down converterwith low dropout. (Adjustableversion)600mA 88 to 94% 2V-6VTexas InstrumentsTPS62056High eﬃciency synchronous stepdown converter with low dropoutand low noise operation (Fixed3.3V version)800mA 90 to 9% 2.7V-10VLinearTechnologiesLTC1879High Eﬃciency Synchronous buck(step-down) converter with lowdropout. (Adjustable version)1200mA 93 to 95% 2.65V-10VTable 3.6: Available 3.3V RegulatorsThe Texas Instruments TPS62056 was chosen for the following reasons:• It provides the highest eﬃciency.
• It is a ﬁxed output voltage version which means less external components.• It has a wide input voltage range for use with one or two Li-Ion cells.• It can provide more than enough output current.CHAPTER 3. DETAIL HARDWARE DESIGN ANDSYNTHESIS 24• It is a low noise component.As the TPS62056 is a ﬁxed 3.3V chip, no calculation of external components was required.5V RailSince a 3.6V Li-ion voltage source is used, while the 5V regulator must be a step-up DC-DCconverter.Table 3.7 is a table of 5V step-up DC-DC converters that was acquired.Name Description MaximumOutputCurrentEﬃciency MinimumInputVoltageTexas InstrumentsTPS61120High Eﬃciency Synchronousboost (step-up) converter. Adjustable version.600mA 94 to 95% 1.8VMaximICMAX682Compact charge-pump (step-up)regulator with minimal externalcomponents. Fixed 5V version.
250mA 70 to 71% 2.7VLinearTechnologiesLTC1306High Eﬃciency synchronousboost (step-up) regulator. Adjustable version1000mA 83 to 87% 2.5VTable 3.7: Available 5V RegulatorsThe TPS61120 was chosen because it provides the highest conversion eﬃciency and suf-ﬁcient output current. It is an adjustable version of the component range and thereforerequires 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 componentcalculation was made: From the datasheet:R3 = R6 × (VOVF B− 1)VF B = 0.5V, VO = 5V. The suggested range for R6 is 180kΩ.Choose R6 = 200kΩ ,then R3 = 200000 × (50.5−1) = 1.8MΩ3.3.3 Battery ChargerMuch research and searching was done for an appropriate USB battery charger chip for thisproject. Initially, the perfect chip was found in terms of total power management. The
Linear Technologies9LTC 3567 is a high eﬃciency, next generation USB power manager plus9www.linear.comCHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 25integrated 1A 3.3V buck-boost (step-up/step-down) regulator for utilizing the full capacityof the battery. The LTC 3567 includes control via an I2C interface. Extensive searchingyielded 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 dueto two design constraints:• The component footprint is too small and sophisticated for PCB manufacturing at theengineering faculty. This component requires a professionally manufactured PCB.• The component requires several external passive components that are not available atthe engineering faculty. As components cannot be purchased in single unit quantities, itwas 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 areavailable.As an alternative, the MAX1811 from Maxim-IC10was chosen as it was the only USBcharger IC that could be found in a more convenient chip packaging, and that would besuﬃcient for use in this project. The MAX1811 turned out to be a very convenient andeasy to use, and the author can recommend it for any application that requires a simple and
eﬀective USB Li-Ion battery charger solution.MAX1811The MAX1811 allows conﬁguration of input charge current, output charge voltage, chargeenable/disable and a charge active output pin for control. It also provides preconditioningthat soft-starts near-dead cells before charging, and other safety features. The MAX1811supports the USB 500mA mode for maximum charge current.3.3.4 Power Supply ControlPower Save ModeSince only the RFID scanner, LCD and Real Time Clock (with battery backup) is connectedto the 5V rail, the wireless scanner device can allow the 5V regulator to be disabled whenentering a power saving sleep mode. The device can be awakened from sleep by pushing abutton on the touchpad which will remain active in sleep mode. This functionality requiresthe 5V regulator to have an enabled/shutdown pin connected to a microcontroller output.Charge ControlAs the Max 1811 battery charger chip does not include an internal safety timer, the microcontrollermust continuously monitor and regulate battery charging. The microcontrollermust provide safety timer functionality and disable charging once the battery has chargedfor 5 hours.10www.maxim-ic.comCHAPTER 3. DETAIL HARDWARE DESIGN AND SYNTHESIS 263.3.5 Battery Level MonitorThe battery’s voltage level will be monitored continuously by connecting the battery voltageterminals to a microcontroller’s analog-to-digital input through a high-impedance voltagedivider resistor pair. Battery status will be calibrated in the device’s ﬁrmware and by examining ﬁgure3.2 (battery discharge level curve). From the discharge curve, it can be seen thatthe voltage range to monitor is between 2.8V and 4.2V. Since the MCU requires a minimum
of 3.3V, the voltage range to monitor changes to 3.3V to 4.2V, since a voltage below 3.3V willcause system failure. The MCU’s reference voltage is 3.3V. The calculation for determiningresistor pair values:A maximum leakage current of 50uA is deﬁned and Vbat(max)is 4.2V.Then Ileak(max) >Vbat(max)(R1+R2)R1 + R2 >4.210 × 10−6 > 84kΩThe voltage input range to the MCU’s A/D pin must be 0V to 3V.Thus: Va/d(max) =R1(R1+R2) × Vbat(max) = 3V1+R2R1=Vbat(max)Va/d(max)=4.13
R2R1= 0.3666 , R2 = 0.3666 × R1Choose: R2 = 33kΩ , then R1 = 90kΩ and R1 + R2 = 123kΩ > 84kΩ3.3.6 Power Supply PCBThe PCB and schematic for the user interface module is available in appendix D. The critical powersupply chips are all surface mount components, and most specify that externalcomponents be placed as close as possible to the chip’s pins, therefore the PCB was mostlydesigned for surface mount components. Additionally, connected ground planes must be usedas far as possible to reduce noise and avoid instability.The manufactured PCB showed that PCB’s manufactured at the engineering faculty isable to support components with 0.27mm pins and 0.23mm gaps between pads, which isquite remarkable considering the manufacturing process used.3.4 Chapter 3 conclusionThe result is a collection of stable and eﬀective components that may be combined into acomplete system solution. Testing and integration of individual hardware components arecovered in chapter 5. It was attempted to ﬁnd the best possible solution to a speciﬁc designproblem in all cases.Chapter 4Detail Software Design and SynthesisChapter 4 covers design and development of software components of the project. Bothﬁrmware that run on the scanner device and application software is discussed in this chapter.4.1 Database Table DesignOne of the most important software design consideration is how data will be stored and presented inthe database. This section covers the database tables integrated into the MyStudiesdatabase by the attendance register system.4.1.1 Attendance Table
This table represents a logged attendance of a student during a speciﬁc instance of a class.The attendance table contains the following ﬁelds:• ID - Primary Key, Auto Increment.• UserCode - An indexed ﬁeld linking to a MyStudies user in the user table.• classInstanceId - An indexed ﬁeld linking to a speciﬁc instance of a class in the classinstance table.• Time - An optional ﬁeld specifying the time of the logged attendance.4.1.2 ClassInstance TableThis table represents every instance of a class. For example, if a class occurs once every weekfor 10 weeks, there will be 10 entries in the classinstance table for the class. The classinstancetable contains the following ﬁelds:• ID - Primary Key, Auto Increment.• courseCode - An indexed ﬁeld linking to a MyStudies course in the course table.• typeID - Indicating the type of class, links to the classtype table.27CHAPTER 4. DETAIL SOFTWARE DESIGN AND SYNTHESIS 28• noteID - Optional ﬁeld indicating the type of class. Links to the notes table.• startTime - The start time of this class.• length - The length of this class.• topic - An optional string representing the topic of this speciﬁc class instance.• date - Day of class instance.• year - Year of class instance.4.1.3 Notes TableThis table holds notes added to speciﬁc class instances by lecturers. The notes table containsthe following ﬁelds:• ID - Primary Key, Auto Increment.• noteString - A string representation of the note.
4.1.4 classtype TableThis table holds strings for the diﬀerent types of classes The classtype table contains thefollowing ﬁelds:• ID - Primary Key, Auto Increment.• typeString - A string representation of the class type.4.2 Memory MapThe EEPROM’s memory map is also an important software design consideration. Care mustbe taken to ensure a dynamic memory environment is created so that available memoryspace is used eﬀectively.The following graph represents the memory layout of the EEPROM:12345Segment 1Used for device conﬁguration such as its device ID(2 bytes), device password(6 bytes), anddevice administrator codes(18 bytes). Also reserved 14 bytes for counters and future use.Segment 212 Courses are represented in this area, with 2 bytes storing a course code, and 8 bytesstoring a short-hand course name. Therefore this section must be at least 12x8 = 96 byteslong. It is padded to 120 bytes.CHAPTER 4. DETAIL SOFTWARE DESIGN AND SYNTHESIS 29Segment 3Stores the class instances for every day of the week(7 days). Each day requires a start addressoﬀset(1 byte) for the memory space of the speciﬁc day’s ﬁrst class instance, and number ofclass instances for that day(1 byte). Therefore this segment is 2x7 = 14 bytes. it is paddedto 20 bytes.Segment 4This segment holds information for speciﬁc class instances for the week. The start addressesfor the class instances are stored in the startadroﬀset register for each day at a speciﬁc byte
in memory. Every class instance requires the following data: The courseID(1 byte - an oﬀsetin segment 2 of the memory), the start address of student numbers logged for this classinstance(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 everyclass instance of the week.Segment 5This segment holds logged student numbers. The start address of logged numbers for aspeciﬁc class instance on a speciﬁc day is determined by segments 3 and 4, therefore thisaddress space is entirely dynamic and student numbers can easily be added or removed frommemory. Every student number requires 3 bytes of memory to be logged.4.3 LCD LayoutThe LCD layout will be as follows:MM DD HH:00 CS 212HELLO 14543109 —b38%Where ’MM DD HH:00’ represents the current date and time, ’CS 212’ represents the currentclass module, ’HELLO 14543109’ represents a greeting to the logged student and —b38%represents the current battery condition.4.4 iWiﬁ conﬁguration websiteThe iWiﬁ embedded webserver will serve three pages:4.4.1 index.htmlThis page will present a login form and access to all conﬁguration parameters on successfullogin. Figure E.2 in appendix E shows a screenshot of the conﬁguration page.CHAPTER 4. DETAILSOFTWARE DESIGN AND SYNTHESIS 304.4.2 status.htmlThis 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 MyStudiesserver via the twisted.web/SOAP interface. The source code for a conﬁguration websiteprototype is available in Appendix F.4.5 Lecturer Administration GUIThe administration GUI allows for new class instances to be added to a timetable and forchanging class instance types and class note information. Figure E.3 is a screenshot of theadministration GUI before a new repeated class instance is added to the database. TheGUI communicates with the MyStudies server via SOAP and pushes data over the SOAPprotocol to be inserted into the database. The GUI component was designed using VisualWXfor visual design of WxPython applications.4.6 Wiﬁ to MyStudies interface ServerThe Wiﬁ device can push data to, and retrieve data from the MyStudies server by means of awebserver interface. For transmitting data to the MyStudies server, the Wiﬁ device connectsto the interface server and performs an HTTP POST with the transmission data. Theinterface server parses the POST data and converts it into a form suitable for transmission viaSOAP. A SOAP request is then sent to the MyStudies server with the applicable information.A reply is also sent back to the wiﬁ device indicating a successful transaction.For retrieving data from the MyStudies server, the wiﬁ device connects to the interfaceserver and performs an HTTP POST request with the variables it wants to retrieve. Theinterface server then retrieves the data from the MyStudies server via SOAP and pass italong to the wiﬁ device.The interface server must make use of SSL encryption to prevent packet sniﬃng of usernames,passwords and data.The source code for a secure interface server implemented in python twisted.web1is
available in Appendix F. A screenshot of the server’s initialisation together with a promptfor the SSL PEM key can be seen in ﬁgure E.4.4.7 Thin ClientsThe use of a ’thin client’ was investigated. A thin client is a graphical user interface thatcontains no business logic code, but rather extracts GUI component code from a database.This approach could work well with the MyStudies framework as python makes serialisation1http://twistedmatrix.com/CHAPTER 4. DETAIL SOFTWARE DESIGN AND SYNTHESIS 31of classes and object trivial. Unfortunately, a thin client implementation is outside the scopeof this project.Chapter 5Testing and IntegrationThe hardware testing strategy used is a ’bottom-up’ approach where the leaf-nodes of thetree-level diagram are ﬁrst tested individually, and then integrated into its parent branchwhen all leaf-nodes of a speciﬁc branch is tested. The subsystem branches are then testedand integrated into their parent subsystem branches until all components are integratedinto the completed system. When all hardware components are integrated, a full systemdiagnostic is performed followed by a ﬁnal ﬁeld test of the device. The most importantindividual components were tested ﬁrst.5.1 Testing Hardware Components5.1.1 Wiﬁ ModuleAs this is one of the most critical (and expensive) components of this project, the wirelessmodule was tested ﬁrst.Testing Method:Test1: Connect the ConnectOne iWiﬁ module to a computer via a UART to USB/RS232circuit, which is connected to a computer’s USB port. Supply the iWiﬁ module with
3.3V. Set the computer’s COM port to 38400 bps baud rate. Send ’AT+I’ + RETURNto the iWiﬁ. The iWiﬁ must respond with ’I/OK’.Test2: Set up an ad-hoc wireless network with a laptop. Conﬁgure the iWiﬁ to connect tothe ad-hoc wireless network. Ping the iWiﬁ using the windows ’ping’ command. TheiWiﬁ must respond to all ping requests.Test Results:Test1: Passed.Test2: Passed.32CHAPTER 5. TESTING AND INTEGRATION 33Revisions:None.5.1.2 RFID ScannerTesting Method:Connect the RFID scanner to an LTC1306, RS232 to UART interface chip in its correctconﬁguration. Supply the RFID scanner with 5V and the LTC1306 with 3.3V. Connect theLTC1306’s UART output is to a UART to USB circuit, which is connected to a computer’sUSB port. Set the computer’s COM port to 19200 bps baud rate. Scan a student card withthe RFID scanner. A 26 byte string, which includes the card’s student number, must bedisplayed on the computer screen.Test Results:Test Passed.Revisions:None.5.1.3 Printed Circuit BoardsThis project uses three printed circuit boards, one for the wireless scanner device’s power
supply, one for its user interface module and one for its processing and communicationsmodule. All three printed circuit boards are tested in the following way:Testing Method:1. The board is inspected for defects and compared to the original schematic to verify alltracks are properly connected.2. All tracks and vias are tested with a continuity tester for broken tracks3. Through hole components are inserted (but not soldered) into their positions to ensureall holes line up.Test Results:Power Supply PCB: Passed all tests.Processing and Communications Module: Passed all tests.User Interface Module: Passed only tests 1 and 2. Failed test 3.CHAPTER 5. TESTING AND INTEGRATION34Problem Diagnosis and Solution:It was determined that the 24-pin header for connecting the user interface module to theprocessing and communications module is mirrored relative to a standard ﬂoppy drive ribboncable. One of the two connecters of the ribbon cable was removed and each wire was connectedto the header pins on the PCB in a mirrored fashion.Revisions:The 24-pin header on the user interface module must be mirrored.5.1.4 MicrocontrollerTesting Method:Load ﬁrmware onto the chip that generates a 20 Hz square wave on one of the timer outputpins. Connect an LED to the pin through a 50ohm resistor to Vcc in series. Supply theMCU with 3.3V. The LED must blink at 20Hz.Test Results:
Passed.Revisions:None.5.1.5 LCDOutput is vital in debugging and diagnostics of other components, therefore the LCD testwas conducted before all other components apart from the Wiﬁ module, RFID scanner andMCU.Testing Method:Connect the LCD to the MCU with 8 data lines and 2 control lines as indicated in theschematic in ﬁgure D.3 available in appendix D. Load ﬁrmware on the MCU that displays:the quick brown foxjumps over lazy dog.This text was designed to ﬁll up all 20x2 characters of the LCD and represents most alphabetcharacters. 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 35Problem Diagnosis and Solution:It was determined that the character ’b’ displays correctly, but printing the character ’c’resulted in a ’b’ being displayed. The binary values of these characters are: b - 01100010, c - 01100011 . The only diﬀerence between the two characters is in the least signiﬁcantbit. It was deduced that the PCB track of the least signiﬁcant bit may form a short circuitwith ground, thus forcing it to 0 when it should be 1 as in the case of the character ’c’. Acontinuity test was performed and it was conﬁrmed that the least signiﬁcant bit track wasconnected to ground. It was discovered that the LCD’s cover caused the short circuit as itwas simultaneously touching the least signiﬁcant bit track and the ground plane. The LCDcover was isolated from the tracks and the LCD test was repeated and passed.
Revisions:Isolate LCD cover from tracks.5.1.6 TouchpadInput is also vital in debugging and diagnostics of other components, therefore the touchpadtest was conducted right after the LCD test.Testing Method:Supply the touchpad controller with 3.3V. Touch one of the touchpad buttons. Measure thebutton’s corresponding output channel for a 1.Test Results:Failed. Touching one button resulted in several output channels returning 1 instead of 0.Problem Diagnosis and Solution:It was determined that the ground plane between the buttons caused the touchpad controllerto register button presses on multiple buttons when one button is pressed, due to its capacitivesensing sensitivity. The ground plane was removed and the buttons covered with 1.5mmtransparent Perspex, which solved the problem of false button presses.Revisions:Remove ground plane between buttons.5.1.7 Voltage RailsThe testing method for the 3.3V and 5V voltage rails were identical.CHAPTER 5. TESTING ANDINTEGRATION 36Testing Method:Connect a 120 ohm resistor between the output of the regulator and ground to simulatepower-save conditions. Supply the regulator with 3.3V to 3.6V. Measure the voltage dropacross the 120 ohm resistor with a multi-meter and verify it is within 0.2V of the regulator’sexpected output (3.3V/120ohm = 27.5mA, 5V/120ohm = 42mA). Repeat the test with a12 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.Problem Diagnosis and Solution:The 5V regulator chip was removed and it was veriﬁed that the PCB connections and components areexactly as speciﬁed in the 5V regulator’s datasheet. The continuity test wasredone on all tracks to eliminate the possibility of short circuits. A new 5V regulator chipwas soldered and it was again veriﬁed that the PCB connections and components are correct.A continuity test was repeated again to ensure no short circuits were present. The abovetesting method was redone and the new chip made a hissing sound and became extremelyhot. It was decided that a diﬀerent 5V regulator chip be used, and the Maxim-IC MAX 682was chosen from table 3.7 because it has a ﬁxed 5V output.Unfortunately, the new PCB for the MAX 682 was not available in time for testing andresults to be published in this report.Revisions:The MAX 682 replaces the TPS 61120 as 5V regulator.5.1.8 Battery ChargerTesting Method:Insert a battery into the battery clips of the power supply module. Connect the power supplymodule to a computer’s USB port with a USB cable.Connect the battery charger’s chargeenable pin to ground and verify battery charger’s CHG pin is not 0. Connect the batterycharger’s charge enable pin to the USB input voltage and verify the battery charger’s CHGpin is 0. With charge enabled, verify the voltage across the battery is approximately 4.1V.Test Results:All tests passed.CHAPTER 5. TESTING AND INTEGRATION 37
Revisions:None.5.1.9 Other ComponentsThe Bus expander, Memory Module and Real Time Clock were tested by writing data tothese devices and reading data back. The returned data was displayed on the LCD andveriﬁed. All other components passed testing.5.2 Integration of Hardware ComponentsThe hardware components of the individual branches were integrated into their individualsubsystems ﬁrst and tested.5.2.1 Processing and Communications UnitThe Processing and Communications unit was completed ﬁrst. The MCU, Wiﬁ module,EEPROM, Bus expander and Real Time Clock were tested together with no problems.5.2.2 User interface moduleNext the user interface module was completed. The keypad started registering false keypresses when the RFID scanner was mounted on the PCB. Engineering science was appliedin the diagnosis and solution of the problem. It was speculated that the false key presses wereas a result of electromagnetic interference from the RFID scanner. An Aluminium shield wasdesigned and inserted between the RFID scanner and the rest of the PCB. Once the shieldwas in place, the keypad no longer registered false key presses.The user interface module was connected to the processing and communications moduleand the diagnostic tests of each individual component were repeated within the integratedsystems. All tests were passed.5.2.3 Power Supply moduleAs the 5V regulator of the power supply was burnt out, the power supply unit could not befully integrated. Unfortunately the replacement PCB was not available in time for writing
of this report and integration tests could not be fully completed.5.3 Testing Software ComponentsThe individual software components were tested as they were being developed. The only casewhere an explicit test was designed was with the webserver/MyStudies interface server. Aclient that simulates an iWiﬁ HTTP POST request was quickly written in python to simulatedata POST events and verify that the interface server worked correctly.CHAPTER 5. TESTING ANDINTEGRATION 385.4 Integration of Software ComponentsThe main components were designed from the ground up to be compatible with the MyStudiesserver, therefore a level of integration was maintained from the start. Unfortunately therewas not enough time to fully integrate the administration GUIs with the MyStudies client,but it will be trivial to do so.Chapter 6Measurements and ResultsMeasurement of hardware and software’s non-functional parameters is important in determining theeﬀectiveness of the system. From measurements, estimates can be made in termsof things such as operating time, operating range, number of users supported, and ultimatelythe successfulness of the entire system. Current consumption measurements were taken witha standard multi-meter, output graphs were obtained from digital oscilloscopes available inthe engineering faculty’s labs, and distance measurements were either estimated in cases oflong distances, or measure with a ruler in cases of short distances.6.1 Hardware Measurements6.1.1 iWiﬁCurrent Consumption:• Power save mode: 7.6mA @ 3.3V• Transmit mode: 243mA @ 3.3VOperating Range:
The following reception distance measurements were taken using a laptop , ad-hoc networkand the windows ’ping’ tool:• Line of sight: 150m• No line of sight: 50m (Due to weak laptop wiﬁ card)• MatiesWiﬁ reception: EverywhereConclusion:Measurements indicate expected results as speciﬁed in the component’s datasheet.39CHAPTER 6. MEASUREMENTS AND RESULTS 406.1.2 RFID ScannerCurrent Consumption:• 63mA @ 5V in idle mode.• 102mA @ 5V when a student card is scanned.Operating Range:1.6cmConclusion:The device’s current consumption in idle mode is two times less than expected. This willsigniﬁcantly increase expected battery life.6.1.3 3.3V Voltage RailThe 3.3V rail was ﬁrst tested by putting the device in sleep mode and measuring input andoutput currents for an input voltage range of 3.3V to 4.1V. Next, the device was operated infull operating maximum power mode and the same measurements were taken.Table 6.1 lists the results of the low-power mode tests.Input Voltage Regulated Output VoltageCurrentfrom Source
OutputCurrentOutputVoltageRipple3.3V 3.29V 23.9mA 22mA 80mV3.6V 3.4V 24mA 21.6mA 160mV4.1V 3.32V 22.3mA 20.9mA 280mVTable 6.1: Measurements taken at diﬀerent input voltage levels for low-power operation.Figure 6.1 shows the digital oscilloscope outputs for low-power operation with inputvoltages of 4.1V and 3.3V.CHAPTER 6. MEASUREMENTS AND RESULTS 41(a) Low-power regulation with 4.1V input(b) Low-power regulation with 3.3V inputFigure 6.1: Low-power operation regulated output with max and min input voltage.Table 6.2 lists the results of the full-power mode tests.Input Voltage Regulated Output VoltageCurrentfrom SourceOutputCurrentOutputVoltageRipple3.3V 3.24V 293mA 270mA 40mV3.6V 3.36V 302mA 272mA 80mV
4.1V 3.4V 286mA 269mA 240mVTable 6.2: Measurements taken at diﬀerent input voltage levels for full-power operation.Figure 6.2 shows the digital oscilloscope outputs for full-power operation with input voltages of 4.1Vand 3.3V.(a) Full-power regulation with 4.1V input(b) Full-power regulation with 3.3V inputFigure 6.2: Full-power operation regulated output with max and min input voltage.CHAPTER 6.MEASUREMENTS AND RESULTS 42Conclusion:The 3.3V regulator performs as expected, at greater than 90% eﬃciency and low enoughoutput voltage ripple.6.1.4 5V Voltage RailUnfortunately, the 5V regulator failed before measurements could be taken. The replacementPCB and chip was not available for measurement at time of writing this report, however theexact same method of measurement as for the 3.3V regulator will be done.6.1.5 Battery ChargerThe output voltage of the battery charger was measured with a multi-meter as 4.12V whenthe charger is enabled. The current consumption was dependant on the state of the battery.6.2 Total Power ConsumptionThe total current consumption for the 3.3V and 5V rails were measured for normal operatingconditions using a multi-meter and a power source as a replacement for the 5V rail. Thefollowing normal-mode measurements were made:• Processor and communications board + keypad: 189mA @ 3.3V• LCD+RTC+RFID scanner: 69mA @ 5VThe average estimated current that must be sourced from the battery can be calculatedas follows:
Ibat = I3V 3 ×3.3Vbat/0.9 + I5V ×5Vbat/0.7Ibat = 0.189 × 0.916/0.9 + 0.069 × 1.388/0.7Ibat = 0.192 + 0.137 = 0.329mAThe estimated battery lifetime at constant normal operating conditions is then: t =2400mAh/329mA = 7.29hoursWhere 0.9 is the estimated eﬃciency of the 3.3V regulator and 0.7 the estimated eﬃciencyof the 5V regulator, and Vbat = 3.6V .However, battery life can be greatly extended by putting the Wiﬁ module in sleep modeand shutting down the 5V regulator until a wake-up event occurs.CHAPTER 6. MEASUREMENTS ANDRESULTS 436.3 Software MeasurementsSoftware tests were mainly done in determining the responsiveness of the administrationGUIs. The lecturer administration GUI was tested with the following results:Adding one class instance to the databaseThe GUI component was used to add one class instance to the database. The functionexecuted in under 2ms.Adding the maximum amount of class instances to the databaseThe GUI component was used to add the maximum amount of class instances to the database(53).The function executed in under 2ms.Chapter 7Conclusion and Recommendations
The aim of this project was to develop a full automated class attendance register solution.A mobile Wiﬁ-enabled RFID scanner device was designed and built and controlling software wasdeveloped. Prototypes for a full application software suite were implemented. Allhardware requirements for the development of such a system were addressed. Most softwarerequirements were addressed, although only partial prototypes were written in some casesdue to time constraints.Testing and integration results show that the developed modules satisfy the objectivesof this project, and are suitable for a practical application. The hardware developed can beused as-is in the ﬁeld if placed in a suitable enclosure.The modular tree-level approach taken in synthesis and design of components allowscomponents to be interchanged if upgrades or superior alternatives become available. Thisapproach also allows for the system to be easily extended and additional functionality addedif required.Additional time may still be spent on reﬁning and polishing the system in order for it tobe introduced for use at the engineering faculty of Stellenbosch in 2009.The design objectives of this project were completed successfully.7.1 AchievementsThis section can be used as a reference for new projects to be developed. It includes ﬁndingsand functionality that worked notably well and can be recommended for future solutions.The following hardware components performed remarkably well:• The ConnectOne iWiﬁ module. With more functionality than similar modules that istwice its cost, this device is perfect for adding Wiﬁ capability to a mobile system. TheiWiﬁ was released in the third quarter of 2008.• The IQS221 capacitive sensor IC from Azoteq. Allowing the creation of custom touchpads and sliders,with minimal operating current, the IQS221 provides a perfect userinput solution with no mechanical components that are subject to wear and tear.
• The MAX1811 USB Li-Ion charger IC from Maxim-IC. Minimal external componentsrequired for an eﬀective USB powered Li-Ion battery charger.44CHAPTER 7. CONCLUSION AND RECOMMENDATIONS 45The following software components were critical to the development of this project:• Python. Python is a powerful and versatile language suitable for high- and low-levelapplication development.• Python Twisted. The twisted.web web server methodology is superior to alternativeweb server solutions and provides many advantages over systems such as Apache.• For web based interfaces, it is recommended that Python Nevow and Athena be investigated.7.2 RecommendationsThis section includes recommendations for extending the existing system, and enhancingsystem design.Use of Surface Mount Components: The processing and communications module wasdesigned for surface-mount only components as the manufacturing for surface mountcomponents and their availability was not clear. However, the manufacturing processesat the engineering faculty are suﬃcient for surface mount component utilisation, andthe use of surface mount components is recommended.Battery Temperature Monitoring: Additional functionality for monitoring battery temperature can beimplemented.’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 acentral database.Access Control: This project can easily be adopted for use in an eﬀective wireless accesscontrol system.Bibliography Inc., C.E.: Lithium ion battery discharge graph. Available at:http://www.buchmann.ca/, [2008, October 27], 2008.
 BITKOM Radio Frequency Identiﬁcation (RFID) Project Group:Rﬁd white paper. technology, systems, and applications. Available at:http://www.rfidconsultation.eu/docs/ficheiros/White_Paper_RFID_english_12_12_2005_final.pdf, [2008, October 27], 2005. Reinhold, C. and Scholz, P.: Eﬃcient antenna design of inductive coupled rﬁd-systemswith high power demand. Journal of Communications, vol. 2, no. 6, 2007. Nohl, K.: Cryptanalysis of crypto-1. Available at:http://www.cs.virginia.edu/~kn5f/pdf/Mifare.Cryptanalysis.pdf, [2008, October 27], 2008. LionPrecision: Capacitive sensors - an overview. Available at:http://www.lionprecision.com/capacitive-sensors, [2008, October 27], 2005.*6+ ConnectOne: Mini socket iwiﬁ data sheet ver. 1.1. Available at:http://www.connectone.com/media/upload/Mini_Socket_iWiFi_DS.pdf, [2008,October 27], 2008. Strangio, C.: The rs232 standard. Available at:http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html, [2008,October 27], 2006.46Appendix AProject Planning ScheduleTable A.1 represents a weekly schedule for the planned completion of diﬀerent aspects of thisproject.Week StartDateSchedule1 21 July System analysis and planning2 28 July Find important component solutions: Wiﬁ module, batterycharger, batteries, regulators, touchpad.
3 4 Aug Request quotation for Wiﬁ module and place sample orders forcomponents.4 11 Aug Analysis review and further planning.4 18 Aug Find and order secondary component solutions: MCU, memory,bus expander, RTC, RS232 interface5 25 Aug Obtain and test RFID scanner. Test Wiﬁ module. Begin withsoftware development.6 1 Sept Test Week.7 8 Sept Design and manufacture Processing and Communications module.Software integration with MyStudies tests.8 15 Sept Design and manufacture of user interface module. Softwaredatabase layouts and design.9 22 Sept Test processing and communications module and integrate modulecomponents. Software GUI design.11 29 Sept Test user interface module and integrate module components. Continue softwaredevelopement. Firmware development.12 6 Oct Design and manufacture power supply module. Continue softwaredevelopment. Software GUI development.13 13 Oct Complete ﬁnal integration of all hardware components. Softwareintegration.14 20 Oct Measurements and report writing.Table A.1: Project Planning Schedule47Appendix BProject SpeciﬁcationThe project speciﬁcation as derived from the original project proposal by H.R. Gerber.B.1 Functional Requirements
B.1.1 Hardware• Use an RFID scanner to obtain a studentcard’s student number.• Use non-volatile for logging card and timestamp data.• Provide user input by means of a keypad or touchpad for device administration.• Provide user feedback by means of an LCD, displaying current module data and administrationinformation.• Provide a buzzer and LEDs for device status feedback.• Provide an 802.11b wiﬁ component with a microcontroller for wireless transmission oflogged data.• Provide a power supply for the mobile wireless scanner device.• Provide a USB battery charger for charging the power supply battery.B.1.2 Software and Firmware• Provide a basic administration interface via the keypad and LCD for setting up Wiﬁnetwork parameters.• Provide an extended administration interface via an onboard webpage accessible viaWiﬁ for setting extended parameters such as security, logging and log-in information.• Provide an appropriate authentication system to validate conﬁguration via the keypador webpage interfaces.48APPENDIX B. PROJECT SPECIFICATION 49• Interface with MyStudies via SOAP• Log attendance records in permanent database.• Provide suﬃcient database structures for user/timetable and Wiﬁ device control.• Generate detailed per-user/per-module/per-class/etc statistics from database data.• Provide real-time feedback of scanned cards.• Provide a personalized calendar of each student’s timetable, including information onlectures attended and missed.
• Provide a means for diﬀerent lecturers to post information about the work that will beor has been covered in a speciﬁc lecture.• Provide appropriate authentication, log-in and security mechanisms in order to validatedata pushed from the device and data posted by users (lecturers).• Provide a suﬃcient administration interface for admin of timetables and students• Provide a suﬃcient administration interface for admin of Wiﬁ Scanners.B.2 PerformanceThe system must adhere to the following non-functional requirements, or performance characteristics:• Card data must be scanned and processed as fast as possible.• The system must be easy to use and conﬁgure.• The system must be secure. Data transmission and conﬁguration must be secured.• The system must be able to handle many users logged in at once.B.3 InterfacesSystem user interfaces include:• Physical user input and feedback via the user interface hardware module.• The iWiﬁ’s embedded webserver conﬁguration webpage.• Student and lecturer conﬁguration GUIs.Inter system interfaces include:• A ribbon cable connects the processing and communications unit with the user interfacemodule.APPENDIX B. PROJECT SPECIFICATION 50• 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 viaSOAP.• The MyStudies server provides an interface between the database and other client
software.Appendix COutcomes ComplianceThe following list shows the ECSA level outcomes for this project, and a cross reference forwhere speciﬁc requirements are met within this document.1. Problem SolvingDemonstrate competence to identify, assess, formulate and solve convergent and divergentengineering problems creatively and innovatively.The problem deﬁnition is stated explicitly in section 1.2 on page 1. The scope of theproblem is formulated in section 1.3 on page 2. The divergent engineering problem of systemleveldesign is discussed in Chapter 2 on page 4, and the component design problems are solvedin a convergent manner in Chapter 4 and 5.2. Application of scientiﬁc and engineering knowledgeDemonstrate competence to apply knowledge of mathematics, basic science and engineeringsciences from ﬁrst principles to solve engineering problems.Knowledge of the scientiﬁc phenomenon of ’capacitive sensing’ was applied as describedin section 3.1.3 on page 12. Mathematics was applied from ﬁrst principles in the calculationof various components and in power consumption calculations. These calculations are available onpages 24, 26, 42 and 23. Engineering science was applied to solve the problem ofelectromagnetic interference in section 5.2.2 on page 36.3. Engineering DesignDemonstrate competence to perform creative, procedural and nonprocedural design and synthesis ofcomponents, systems, engineering works, products or processes.The tree-level diagram of ﬁgure 2.2 on page 6 is an example of a recursive, non-proceduraldesign process. The detail level design of individual components in chapters 3 and 4 is a moreprocedural approach. The touchpad as shown in ﬁgure E.1 in appendix E is an example ofa creative solution to the problem of user input.51APPENDIX C. OUTCOMES COMPLIANCE 52