Your SlideShare is downloading. ×
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Uni v e r si t ei t
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Uni v e r si t ei t

166

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
166
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 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 fulfilment 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 staff 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 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
  • 2. 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 qualification.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, firmware and application software. The project makesuse of RFID and Wifi technology, and basic research of RFID equipment was conducted. Itwas shown that an effective attendance register system can be implemented with the help ofnew 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 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 thefinal 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 ’Wifi’ draadlose kommunikasie. Die werking van’RFID’ is oppervlakkig ondersoek. Daar word gewys dat ’n effektiewe klasbywonings-register
  • 3. stelsel met behulp van nuwe en opkomende tegnologie ontwikkel kan word. ConnectOne se’iWifi’ 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 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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
  • 4. 2.2.4 Stellenbosch University Implementation . . . . . . . . . . . . . . . . . 82.3 Design Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4 Chapter 2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Detail Hardware Design and Synthesis 103.1 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.1.1 Student Identification Scanner . . . . . . . . . . . . . . . . . . . . . . 103.1.2 LCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.1.3 Keypad or Touchpad . . . . . . . . . . . . . . . . . . . . . . . . . . . 12vCONTENTS vi3.1.4 Interface PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2 Processing and Communications Unit . . . . . . . . . . . . . . . . . . . . . . 143.2.1 Wireless Communications Module . . . . . . . . . . . . . . . . . . . . 143.2.2 Antenna Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.2.3 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.2.4 Memory Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2.5 Real Time Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2.6 Bus Expander . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2.7 RS232 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.2.8 USB Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.2.9 Processing and Communications PCB . . . . . . . . . . . . . . . . . . 203.3 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.3.1 Power Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.3.2 Voltage Rails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.3.3 Battery Charger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.3.4 Power Supply Control . . . . . . . . . . . . . . . . . . . . . . . . . . 25
  • 5. 3.3.5 Battery Level Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . 263.3.6 Power Supply PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.4 Chapter 3 conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Detail Software Design and Synthesis 274.1 Database Table Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.1.1 Attendance Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.1.2 ClassInstance Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.1.3 Notes Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.1.4 classtype Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.2 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.3 LCD Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.4 iWifi configuration website . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.4.1 index.html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.4.2 status.html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.4.3 sync.html . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.5 Lecturer Administration GUI . . . . . . . . . . . . . . . . . . . . . . . . . . 304.6 Wifi to MyStudies interface Server . . . . . . . . . . . . . . . . . . . . . . . 304.7 Thin Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 Testing and Integration 325.1 Testing Hardware Components . . . . . . . . . . . . . . . . . . . . . . . . . . 325.1.1 Wifi Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325.1.2 RFID Scanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.1.3 Printed Circuit Boards . . . . . . . . . . . . . . . . . . . . . . . . . . 335.1.4 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345.1.5 LCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
  • 6. 5.1.6 Touchpad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355.1.7 Voltage Rails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35CONTENTS vii5.1.8 Battery Charger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365.1.9 Other Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375.2 Integration of Hardware Components . . . . . . . . . . . . . . . . . . . . . . 375.2.1 Processing and Communications Unit . . . . . . . . . . . . . . . . . . 375.2.2 User interface module . . . . . . . . . . . . . . . . . . . . . . . . . . 375.2.3 Power Supply module . . . . . . . . . . . . . . . . . . . . . . . . . . . 375.3 Testing Software Components . . . . . . . . . . . . . . . . . . . . . . . . . . 375.4 Integration of Software Components . . . . . . . . . . . . . . . . . . . . . . . 386 Measurements and Results 396.1 Hardware Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396.1.1 iWifi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396.1.2 RFID Scanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406.1.3 3.3V Voltage Rail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406.1.4 5V Voltage Rail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426.1.5 Battery Charger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426.2 Total Power Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426.3 Software Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 Conclusion and Recommendations 447.1 Achievements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447.2 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45Bibliography 46A Project Planning Schedule 47B Project Specification 48
  • 7. B.1 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48B.1.1 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48B.1.2 Software and Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . 48B.2 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49B.3 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49C Outcomes Compliance 51D Circuit Diagrams and PCB layouts 53E Photos and Screenshots 59F Source Code 62F.1 Secure Interface Webserver Prototype . . . . . . . . . . . . . . . . . . . . . . 62F.2 iWifi configuration page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63F.3 RFID and iWifi Communcations Handling Module . . . . . . . . . . . . . . . 63List of Figures2.1 Design decision flow chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Tree-level diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 Airgap Interface between card and scanner . . . . . . . . . . . . . . . . . . . . 83.1 Calibrated LCD resistor values. . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2 Li-Ion Output Voltage Depletion Chart[1] . . . . . . . . . . . . . . . . . . . . 226.1 Low-power operation regulated output with max and min input voltage. . . . . 416.2 Full-power operation regulated output with max and min input voltage. . . . . 41D.1 User Interface Module Schematic . . . . . . . . . . . . . . . . . . . . . . . . . 54D.2 User Interface Module PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55D.3 Processing and Communications Unit Schematic . . . . . . . . . . . . . . . . . 56D.4 Processing and Communications Unit PCB . . . . . . . . . . . . . . . . . . . . 57D.5 Power Supply Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58E.1 Photo of user interface ontop of processing and communications unit. . . . . . 59
  • 8. E.2 Screenshot of wifi configuration page. . . . . . . . . . . . . . . . . . . . . . . . 60E.3 Screenshot of administration GUI. . . . . . . . . . . . . . . . . . . . . . . . . . 60E.4 Screenshot of secure interface webserver. . . . . . . . . . . . . . . . . . . . . . 61viiiList of Tables3.1 Student Identification Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2 Wireless Communications Module Solutions . . . . . . . . . . . . . . . . . . . 153.3 Possible Microcontroller Solutions . . . . . . . . . . . . . . . . . . . . . . . . . 173.4 Rechargeable Battery Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.5 Estimated Current Consumption . . . . . . . . . . . . . . . . . . . . . . . . . 233.6 Available 3.3V Regulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.7 Available 5V Regulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246.1 Measurements taken at different input voltage levels for low-power operation. . 406.2 Measurements taken at different input voltage levels for full-power operation. . 41A.1 Project Planning Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47ixNomenclatureAcronymsWWW - World Wide WebWifi - 802.11b/g wireless network standardRFID - Radio-Frequency IdentificationUSB - Universal Serial BusLF - Low FrequencyUHF - Ultra High FrequencyISO - International Organization for StandardizationWORM - Write Once Read ManyLCD - Liquid Crystal Display
  • 9. 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 definition 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.
  • 10. There are many cases in which it would be beneficial 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 insufficient 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 DefinitionThis 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 benefit 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 effective 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
  • 11. recording devices and system parameters.1.3 Scope and Aims of ProjectAs part of the original project proposal, it was specified that the student identification 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 sufficient 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, Wifi enabled,student card scanning device, designing and writing the firmware 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 projectspecification 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 specifies 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
  • 12. project, as defined 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 figure 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 flow-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 influencing other sub-systems, and in this way valuable time is saved.4CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 5STARTCan System bebroken up into
  • 13. 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 flow chart2.1 System and Design OverviewBefore subsystems can be identified, the functional requirements for this project must beidentified first. The requirements have been derived from the original project proposal byH.R. Gerber and are available in appendix B. Analysing the problem as defined 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 problemdefined in 1.2. The three main parts of the system is the hardware, firmware and application
  • 14. software components. Hardware can be broken up into three main modules: A power supply,a processing and communications module and a user interface. The firmware 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 4.2.1.1 Technologies UtilisedRFIDAs per the project specification, an RFID scanner is used for student identification. A briefstudy of RFID is included in the next section.CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 6Figure 2.2: Tree-level diagram802.11b/g WifiThe mobile scanner device will use an 802.11b/g Wifi module to communicate with theStellenbosch University campus wide wireless network, ’Maties Wifi’.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
  • 15. 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 devicefirmware and configuration 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[2], German Association for Information Technology,Telecommunications and New Media.2.2.1 General concept
  • 16. RFID, or Radio Frequency Identification, 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[2]. Additionally, a secured systemmay make use of cryptographic functions for one-way or two-way identification.1www.python.org2http://twistedmatrix.com/CHAPTER 2. SYSTEM ANALYSIS AND DESIGN 82.2.2 AntennaAccording to BITKOM[2], 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 specific application. In shortread-distance applications like this, the tag is within the near-field 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[3].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 specific carrier frequency. This is representedin figure 2.3.
  • 17. • To enable a layer of communication, information must be modulated on the wave.• On the logical layer, the structure of commands and data are specified 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[4] 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 first 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
  • 18. 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 specific 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-offs.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 figure 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 specified in chapter 2 and is representedby figure 2.1. From the tree-level diagram in figure 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 Identification ScannerThe project specification requires RFID to be used for student identification, and the RFID
  • 19. scanner must be provided by the University’s access control department since it is preconfigured 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 identification on campus. From the startof 2007, all Stellenbosch University student cards are equipped with an RFID chip that can beread by holding it briefly against a configured 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 identification.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, Efficient,AvailabilityCard may begiven to friend
  • 20. for scanning.Biometrics Finger print or retina scanner. Absolute positive identificationVery expensive,SlowMagstripe The magnetic strip on all studentcards.Availability Slow, Wear andTear, Old technology, Cardmay be givento friend forscanningTable 3.1: Student Identification 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 specific 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 first connecting the correspondingresistors pins to variable resistors and tuning the resistor parameters until optimal contrast
  • 21. and brightness levels was found.Figure 3.1 represents the calibrated resistor configuration 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 Wifi 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 alsooffers 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 figure E.1.
  • 22. Capacitive SensorsLionPrecision[5] 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 defined
  • 23. 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 finding 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 Wifi. 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 Wifinetwork, ’MatiesWifi’. 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 Wifi 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 iWifi module from ConnectOne.It also happens to be least expensive of the Wifi modules (R470 at time of purchase), and isonly slightly more expensive than a Bluetooth or Zigbee solution.The iWifi 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[6]:Internet Protocols: ARP, ICMP, IP, UDP, TCP, DHCP, DNS, NTP, SMTP, POP3, MIME,
  • 24. 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 Wificommunication 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
  • 25. 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(Wifi 802.11b/g)Wifi enabled MCUwith 39 GPIO and512K Flash memory
  • 26. Universal hardware(laptops, PCs, APs),High datarate, Programmed over serial,Standard externalantenna connector,long rangeRelatively high powerconsumption, ExpensiveR790EzurioWISMC01(Wifi 802.11b/g)Wifi 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
  • 27. R1045ConnetBlueSPA311G(Wifi 802.11b/g)Wifi module onlywith AT commandset. Requires controlling MCU.Universal Hardware(laptops, PCs, APs),High datarate, ATover UART interface,External antenna connector, Long range,CompactVery expensive R1450ConnectOneMini SocketiWifi(Wifi 802.11b/g)Wifi module onlywith AT commandset and onboardweb server. Requires controllingMCU.Universal Hardware(laptops, PCs, APs),High datarate, ATover UART interface,
  • 28. External antenna connector, Long range,CompactRelatively high powerconsumption (but lessthan some other wifimodules)R470Table 3.2: Wireless Communications Module SolutionsCHAPTER 3. DETAIL HARDWARE DESIGN ANDSYNTHESIS 16iWifi 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 iWifi 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
  • 29. 2C bus, and flash memorywill be sufficient. 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, Moreflash memorySurfacemount LQFP64,Not immediately
  • 30. available, Nobuilt-in RS232MicrochipPIC18F255028 pin general purposeMCU.Built-in RS232 interfaceUnfamiliar platformTable 3.3: Possible Microcontroller SolutionsThere are no defining 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 offers a familiar embedded development platform and requires little power.Operating VoltageOne important design consideration regarding the microcontroller is its operating voltage,as this will affect interfacing with components that operate at voltage levels different 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
  • 31. The memory module must provide non-volatile data storage for when the scanning device isout of range or in case of power loss. Any flash memory module with at least 8 kilobytesof RAM will be sufficient 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 theWifi 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
  • 32. , and it was chosen for this project. Any I2C RTC would havebeen sufficient 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 notified 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.
  • 33. 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[7]. 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
  • 34. 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 differences. The first 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 Wifi 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
  • 35. 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 first 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 simplified 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 specification 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
  • 36. 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 sufficient 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 Chart[1]3.3.2 Voltage RailsInspection of the other leaf-nodes of the hardware design branch, as indicated in figure 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.
  • 37. 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), Wifi (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-efficient.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
  • 38. CurrentEfficiency InputVoltageTexas InstrumentsTPS622602.25Mhz high efficiency synchronous step-down converterwith low dropout. (Adjustableversion)600mA 88 to 94% 2V-6VTexas InstrumentsTPS62056High efficiency synchronous stepdown converter with low dropoutand low noise operation (Fixed3.3V version)800mA 90 to 9% 2.7V-10VLinearTechnologiesLTC1879High Efficiency 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 efficiency.
  • 39. • It is a fixed 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 fixed 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 MaximumOutputCurrentEfficiency MinimumInputVoltageTexas InstrumentsTPS61120High Efficiency Synchronousboost (step-up) converter. Adjustable version.600mA 94 to 95% 1.8VMaximICMAX682Compact charge-pump (step-up)regulator with minimal externalcomponents. Fixed 5V version.
  • 40. 250mA 70 to 71% 2.7VLinearTechnologiesLTC1306High Efficiency 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 efficiency and suf-ficient 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
  • 41. Linear Technologies9LTC 3567 is a high efficiency, 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 besufficient 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
  • 42. effective USB Li-Ion battery charger solution.MAX1811The MAX1811 allows configuration 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 firmware and by examining figure3.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
  • 43. 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 defined 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
  • 44. 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 effective components that may be combined into acomplete system solution. Testing and integration of individual hardware components arecovered in chapter 5. It was attempted to find the best possible solution to a specific designproblem in all cases.Chapter 4Detail Software Design and SynthesisChapter 4 covers design and development of software components of the project. Bothfirmware 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
  • 45. This table represents a logged attendance of a student during a specific instance of a class.The attendance table contains the following fields:• ID - Primary Key, Auto Increment.• UserCode - An indexed field linking to a MyStudies user in the user table.• classInstanceId - An indexed field linking to a specific instance of a class in the classinstance table.• Time - An optional field 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 fields:• ID - Primary Key, Auto Increment.• courseCode - An indexed field 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 field 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 specific class instance.• date - Day of class instance.• year - Year of class instance.4.1.3 Notes TableThis table holds notes added to specific class instances by lecturers. The notes table containsthe following fields:• ID - Primary Key, Auto Increment.• noteString - A string representation of the note.
  • 46. 4.1.4 classtype TableThis table holds strings for the different types of classes The classtype table contains thefollowing fields:• 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 effectively.The following graph represents the memory layout of the EEPROM:12345Segment 1Used for device configuration 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 addressoffset(1 byte) for the memory space of the specific day’s first 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 specific class instances for the week. The start addressesfor the class instances are stored in the startadroffset register for each day at a specific byte
  • 47. in memory. Every class instance requires the following data: The courseID(1 byte - an offsetin 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 aspecific class instance on a specific 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 iWifi configuration websiteThe iWifi embedded webserver will serve three pages:4.4.1 index.htmlThis page will present a login form and access to all configuration parameters on successfullogin. Figure E.2 in appendix E shows a screenshot of the configuration 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
  • 48. 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 configuration 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 Wifi to MyStudies interface ServerThe Wifi 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 Wifi 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 wifi device indicating a successful transaction.For retrieving data from the MyStudies server, the wifi 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 wifi device.The interface server must make use of SSL encryption to prevent packet sniffing of usernames,passwords and data.The source code for a secure interface server implemented in python twisted.web1is
  • 49. available in Appendix F. A screenshot of the server’s initialisation together with a promptfor the SSL PEM key can be seen in figure 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 first tested individually, and then integrated into its parent branchwhen all leaf-nodes of a specific 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 final field test of the device. The most importantindividual components were tested first.5.1 Testing Hardware Components5.1.1 Wifi ModuleAs this is one of the most critical (and expensive) components of this project, the wirelessmodule was tested first.Testing Method:Test1: Connect the ConnectOne iWifi module to a computer via a UART to USB/RS232circuit, which is connected to a computer’s USB port. Supply the iWifi module with
  • 50. 3.3V. Set the computer’s COM port to 38400 bps baud rate. Send ’AT+I’ + RETURNto 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 tothe ad-hoc wireless network. Ping the iWifi using the windows ’ping’ command. TheiWifi 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 correctconfiguration. 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
  • 51. 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 floppy 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 firmware 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:
  • 52. 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 Wifi 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 figure D.3 available in appendix D. Load firmware on the MCU that displays:the quick brown foxjumps over lazy dog.This text was designed to fill 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 difference between the two characters is in the least significantbit. It was deduced that the PCB track of the least significant 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 confirmed that the least significant bit track wasconnected to ground. It was discovered that the LCD’s cover caused the short circuit as itwas simultaneously touching the least significant bit track and the ground plane. The LCDcover was isolated from the tracks and the LCD test was repeated and passed.
  • 53. 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
  • 54. 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 verified that the PCB connections and components areexactly as specified 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 verified 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 different 5V regulator chip be used, and the Maxim-IC MAX 682was chosen from table 3.7 because it has a fixed 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
  • 55. 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 andverified. All other components passed testing.5.2 Integration of Hardware ComponentsThe hardware components of the individual branches were integrated into their individualsubsystems first and tested.5.2.1 Processing and Communications UnitThe Processing and Communications unit was completed first. The MCU, Wifi 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
  • 56. 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 iWifi 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 theeffectiveness 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 iWifiCurrent Consumption:• Power save mode: 7.6mA @ 3.3V• Transmit mode: 243mA @ 3.3VOperating Range:
  • 57. 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 wifi card)• MatiesWifi reception: EverywhereConclusion:Measurements indicate expected results as specified 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 willsignificantly increase expected battery life.6.1.3 3.3V Voltage RailThe 3.3V rail was first 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
  • 58. 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 different 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
  • 59. 4.1V 3.4V 286mA 269mA 240mVTable 6.2: Measurements taken at different 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% efficiency 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:
  • 60. 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 efficiency of the 3.3V regulator and 0.7 the estimated efficiencyof the 5V regulator, and Vbat = 3.6V .However, battery life can be greatly extended by putting the Wifi 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
  • 61. 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 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 field 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 refining 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 findingsand 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 istwice its cost, this device is perfect for adding Wifi capability to a mobile system. TheiWifi 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.
  • 62. • The MAX1811 USB Li-Ion charger IC from Maxim-IC. Minimal external componentsrequired for an effective 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 sufficient 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 effective wireless accesscontrol system.Bibliography[1] Inc., C.E.: Lithium ion battery discharge graph. Available at:http://www.buchmann.ca/, [2008, October 27], 2008.
  • 63. [2] BITKOM Radio Frequency Identification (RFID) Project Group:Rfid 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.[3] Reinhold, C. and Scholz, P.: Efficient antenna design of inductive coupled rfid-systemswith high power demand. Journal of Communications, vol. 2, no. 6, 2007.[4] Nohl, K.: Cryptanalysis of crypto-1. Available at:http://www.cs.virginia.edu/~kn5f/pdf/Mifare.Cryptanalysis.pdf, [2008, October 27], 2008.[5] LionPrecision: Capacitive sensors - an overview. Available at:http://www.lionprecision.com/capacitive-sensors, [2008, October 27], 2005.*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.[7] 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 different aspects of thisproject.Week StartDateSchedule1 21 July System analysis and planning2 28 July Find important component solutions: Wifi module, batterycharger, batteries, regulators, touchpad.
  • 64. 3 4 Aug Request quotation for Wifi 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 Wifi 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 final integration of all hardware components. Softwareintegration.14 20 Oct Measurements and report writing.Table A.1: Project Planning Schedule47Appendix BProject SpecificationThe project specification as derived from the original project proposal by H.R. Gerber.B.1 Functional Requirements
  • 65. 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 wifi 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 Wifinetwork parameters.• Provide an extended administration interface via an onboard webpage accessible viaWifi for setting extended parameters such as security, logging and log-in information.• Provide an appropriate authentication system to validate configuration via the keypador webpage interfaces.48APPENDIX B. PROJECT SPECIFICATION 49• Interface with MyStudies via SOAP• Log attendance records in permanent database.• Provide sufficient database structures for user/timetable and Wifi 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.
  • 66. • Provide a means for different lecturers to post information about the work that will beor has been covered in a specific 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 sufficient administration interface for admin of timetables and students• Provide a sufficient administration interface for admin of Wifi 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 configure.• The system must be secure. Data transmission and configuration 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 iWifi’s embedded webserver configuration webpage.• Student and lecturer configuration 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
  • 67. software.Appendix COutcomes ComplianceThe following list shows the ECSA level outcomes for this project, and a cross reference forwhere specific 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 definition 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 scientific and engineering knowledgeDemonstrate competence to apply knowledge of mathematics, basic science and engineeringsciences from first principles to solve engineering problems.Knowledge of the scientific phenomenon of ’capacitive sensing’ was applied as describedin section 3.1.3 on page 12. Mathematics was applied from first 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 figure 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 figure E.1 in appendix E is an example ofa creative solution to the problem of user input.51APPENDIX C. OUTCOMES COMPLIANCE 52
  • 68. 4. Investigations, experiments and data analysisDemonstrate competence to design and conduct investigations and experiments.In chapter 5, tests were designed for individual components and then execued. For example, thehardware tests formulated on pages 33, 34 and 35. Failed tests lead to structureddiagnostic investigations as formulated, for example, on pages 35 and 36. Other experimentsperformed include investigation of the effect of an aluminium shield on electromagnetic interference, asshown in section 5.2.2 on page 37.5. Engineering methods, skills and tools, includingInformation TechnologyDemonstrate competence to use appropriate engineering methods, skills and tools, includingthose based on information technology.Use of engineering measuring equipment such as multi-meters and oscilloscopes are demonstrated inChapter 5 and 6. Figures 6.1 and 6.2 on page 41 are examples of digital oscilloscopemeasurements. In terms of information technology, the internet was used extensively for research, andvarious information technology based communication resources were utilised suchas e-mail, Internet Relay Chat and instant messaging.6. Professional and technical communicationDemonstrate competence to communicate effectively, both orally and in writing, with engineeringaudiences and the community at large.This document itself is an example of effective written communication. The professionaltypesetting application, LaTeX, was used in the creation of this report. An oral presentationwill be delivered with the aid of slides and a demonstration of the mobile scanner device.9. Independent learning abilityDemonstrate competence to engage in independent learning through well-developed learningskills.The study of RFID technology in section 2.2 on page 7 is an example of independentlearning ability. Other examples of independant learning include:
  • 69. • Use of an SQL database.• Use of SOAP.• Knowledge of RFID technology.• Knowledge of Wifi 802.11b/g networks.• Knowledge of capacitive sensors.• Use of LaTeX.Appendix DCircuit Diagrams and PCB layouts53APPENDIX D. CIRCUIT DIAGRAMS AND PCB LAYOUTS 54Figure D.1: User Interface Module SchematicAPPENDIX D. CIRCUIT DIAGRAMS AND PCB LAYOUTS 55Figure D.2: User Interface Module PCBAPPENDIX D. CIRCUIT DIAGRAMS AND PCB LAYOUTS 56Figure D.3: Processing and Communications Unit SchematicAPPENDIX D. CIRCUIT DIAGRAMS AND PCBLAYOUTS 57Figure D.4: Processing and Communications Unit PCBAPPENDIX D. CIRCUIT DIAGRAMS AND PCBLAYOUTS 58Figure D.5: Power Supply SchematicAppendix EPhotos and ScreenshotsFigure E.1: Photo of user interface ontop of processing and communications unit.59APPENDIX E. PHOTOS AND SCREENSHOTS 60Figure E.2: Screenshot of wifi configuration page.Figure E.3: Screenshot of administration GUI.APPENDIX E. PHOTOS AND SCREENSHOTS 61Figure E.4: Screenshot of secure interface webserver.Appendix FSource CodeF.1 Secure Interface Webserver Prototype"""@author: Carel van Wyk@contact: cpjvanwyk@gmail.com
  • 70. @since: 14-10-2004@revisions:"""import __version__ #Package Versioning informationimport loggingfrom twisted.web import server, resourcefrom twisted.internet import reactor, sslimport 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 = Truedef render_GET(self, request):self.host = "127.0.0.1"self.port = 9080self.client = "127.0.0.1"###
  • 71. 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))62APPENDIX F. SOURCE CODE 63return False###return "<html>Hello, world!</html>"def render_POST(self,request):print request.received_headersprint request.content.readlines()print request.argsprint requestreturn "<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...")
  • 72. reactor.run()except Exception, why:logging.error("Unable to start server: %s" % (str(why),))F.2 iWifi configuration page<html><head><title>Device Configuration Page</title><link REL="stylesheet" TYPE="text/css" href="style.css"></head><body><div class="top"><img src="img/logo.jpg" alt="Logo"/><div class="title">Wifi Scanner Device Configuration</div></div><div class="borders"><div class="content"><div class="heading">Device settings:</div><table><tr><td>Device ID:</td><td><input type="text"/><input type="submit" value="update"></td></tr><tr><td>Admin Username:</td><td><input type="text"><input type="submit"value="update"></td></tr><tr><td>Admin Password:</td><td><input type="text"><input type="submit"value="update"></td></tr></table><br/><div class="heading">Network settings:</div>
  • 73. <table><tr><td>Device IP Address:</td><td><input type="text"/><input type="submit"value="update"></td></tr><tr><td>Server IP Address:</td><td><input type="text"><input type="submit"value="update"></td></tr></table><div class="heading">Time:</div><table><tr><td>Year:</td><td><input type="text"/><input type="submit" value="update"></td></tr><tr><td>Month:</td><td><input type="text"><input type="submit" value="update"></td></tr></table></div></div></body></html>F.3 RFID and iWifi Communcations HandlingModule#include "sfr_r827.h"#include "uart.h"#include "lcd.h"APPENDIX F. SOURCE CODE 64#include "rfid_scanner.h"char dataReceived;char data;/**Initializes the USB-RS232 serial interface.*/void uart_init(void){
  • 74. //**************************************// UART 0 Setting - iWifi//**************************************//Set TXD0 pin to output port direction, set RXD0 pin to input port direction//Poll for the status of Ri(Receive complete flag) in your UART 0 routine to check whether reception hascompletedsmd0_u0mr=1;smd1_u0mr=0;smd2_u0mr=1; //UART mode transfer data 8 bits long selected(u0mr bit0, 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 thete_u0c1=1;re_u0c1=1; //Reception enabled(u0c1 bit 2)u0rrm_u0c1=0;u0c0 = 0x00;s0tic=0x00; //Set UART0 transmit interrupt piority level 0(s0tic)s0ric=0x03; //Set UART0 receive interrupt piority level 2(s0ric)//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
  • 75. //Set uart1sel0 and uart1sel1 of pinsr1 register and u1pinsel, txd1sel and txd1en of pmr register tochange TXD1 and RXD1//Poll for the status of Ri(Receive complete flag) in your UART 1 routine to check whether reception hascompleted//Set up control pin (default low - disable transmit)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 thete_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;
  • 76. lcd_write_char(received);}void ch0_output_char(char msg)APPENDIX F. SOURCE CODE 65{while(ti_u0c1 == 0);u0tb = msg;}/**Writes a string the to the UART0 channel.*/void ch0_output_string (char * msg_string){char i;// This loop reads in the text string and puts it in the UART 0 transmit bufferfor (i=0; msg_string[i]; i++){while(ti_u0c1 == 0);u0tb = msg_string[i];}}/**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 readrfid_handle_received(received);}

×