Professional Documents
Culture Documents
May-06-13
Design Document
Client:
ECpE Department
Advisor:
Prof. Ahmed Kamal
Team:
Arturo Palau (EE)
Chau Nguyen (EE)
Issa Drame (EE)
Adam Mohling (CprE)
REPORT DISCLAIMER NOTICE
DISCLAIMER: This document was developed as a part of the requirements of an
electrical and computer engineering course at Iowa State University, Ames, Iowa.
This document does not constitute a professional engineering design or a
professional land surveying document. Although the information is intended to be
accurate, the associated students, faculty, and Iowa State University make no
claims, promises, or guarantees about the accuracy, completeness, quality, or
adequacy of the information. The user of this document shall ensure that any
such use does not violate any laws with regard to professional licensing and
certification requirements. This use includes any work resulting from this studentprepared document that is required to be under the responsible charge of a
licensed engineer or surveyor. This document is copyrighted by the students who
produced this document and the associated faculty advisors. No part may be
reproduced without the written permission of the senior design course
coordinator.
Submission Date
November 3, 2005
Table of Contents
1.
INTRODUCTORY MATERIALS......................................................................................... 1
May-06-13
Senior Design
Page i
2/9/2016
CLOSURE MATERIALS................................................................................................... 46
4.1
4.2
4.3
4.4
May-06-13
Senior Design
Page ii
2/9/2016
List of Figures
Figure 1 Overall System Flow Diagram..............................................................................................2
Figure 2 GM28 Cellular Module..........................................................................................................10
Figure 3 STK300 Starter Kit.................................................................................................................18
Figure 4 Bracket Coding Standard....................................................................................................22
Figure 5 Thermostat Control Schematic...........................................................................................31
Figure 6 - Thermostat Application Module Schematic Diagram...................................................32
Figure 7 Fan Control Schematic..........................................................................................................35
Figure 8 Fan Status Signal Circuit Schematic................................................................................36
Figure 9 Light Schematic.....................................................................................................................37
Figure 10 Original Project Schedule.................................................................................................42
Figure 11 Current Project Schedule..................................................................................................42
Figure 12 Original Project Reporting Schedule.............................................................................43
Figure 13 Current Project Reporting Schedule..............................................................................44
Figure 14 Project Development Schedule.......................................................................................45
May-06-13
Senior Design
Page iii
2/9/2016
List of Tables
Table 1 STK200 Starter Kit..................................................................................................... 13
Table 2 STK300 Starter Kit..................................................................................................... 15
Table 3 Freescale MC68HC11E9 Starter Kit...........................................................................16
Table 4 Philips 51 Plus Starter Kit..........................................................................................17
Table 5 - Personnel Effort in Hours........................................................................................... 39
Table 6 - Financial Requirements..............................................................................................41
May-06-13
Senior Design
Page iv
2/9/2016
List of Definitions
DTMF (Dual-Tone Multi-Frequency) used for telephone signaling over the line
in the voice frequency band to the call switching center.
GSM (Global System for Mobile Communications) a cellular communication
network standard.
GPRS (General Packet Radio Service) a mobile data service offered to GSM
mobile users.
JVM (Java Virtual Machine) a necessary tool that will allow execution of javabased applications on a system.
M2M (Machine to Machine) concept of communications between a device
containing some amount of data and another device that requires the use of that
data.
MSDNAA (Microsoft Developers Network Academic Alliance) a source of
software that is free to all Iowa State University students that are enrolled in the
Department of Electrical and Computer Engineering.
SMS (Short Message Service) a service available on most digital mobile
phones that permit the sending of short messages (also known as text
messaging service).
SPDT (Single Pole, Double Throw) a relay with two contacts and one switch.
This switch selects one contact by default. When energized, the switch will select
the opposite contact.
SPST (Single Pole, Single Throw) a relay with one contact and one switch. This
switch has an open circuit default position. When energized, the will assume a
closed-circuit position.
May-06-13
Senior Design
Page v
2/9/2016
1. Introductory Materials
This section is intended to give an overview of the project. Some of the questions
answered in this section include what the project is about, what problems it will
address, what solutions it will implement to resolve those problems, and who the
intended users are.
Page 1
2/9/2016
May-06-13
Senior Design
Page 2
2/9/2016
1.2. Acknowledgements
Special thanks are extended to Professor Ahmed Kamal for his support and
mentorship towards the development and success of this project.
May-06-13
Senior Design
Page 3
2/9/2016
May-06-13
Senior Design
The user and control unit will establish communication via GSM
The cell phone and service provider chosen will support text
messaging service
The user is familiar with text messaging on their cell phone
The cell phone will support storing text message templates
within the cell phones memory
All service charges from service provider apply
The controlled appliances will have to have an electrical
interface in order to be controlled by microcontroller
The audience reading this document will have a familiarity with
engineering terms
All measurements for temperature will be on Fahrenheit scale
Page 4
2/9/2016
The only person who can communicate with the control module
is the person who will be successfully authenticated
The controlled devices will have I/O ports that will make
communication with the receiver possible
May-06-13
Senior Design
Page 5
2/9/2016
2.
The approach that will be taken by the team and the step-by-step process of the
design of the end-product are described in this section. Some of the major
portions of this project and course include the various requirements defined by
the team for this projects successful completion and the detailed explanation of
the different project execution phases.
May-06-13
Senior Design
Page 6
2/9/2016
The control unit will have the ability to connect to the cellular
network automatically.
The control unit will be able to receive text messages and will be
able to parse and interpret (ASCII) text messages for password
identification and instructions to be sent to the microcontroller.
The control unit will control the electrical appliances and detect the
status of the appliances to be relayed back to the microcontroller.
May-06-13
Senior Design
Page 7
2/9/2016
May-06-13
Senior Design
Page 8
2/9/2016
May-06-13
Senior Design
Page 9
2/9/2016
May-06-13
Senior Design
Page 10
2/9/2016
May-06-13
Senior Design
Page 11
2/9/2016
2.1.4.3.
Considered Microcontrollers
May-06-13
Senior Design
Page 12
2/9/2016
ATmega48
ATmega8
ATmega88
ATmega8515
ATmega8538
ATmega16
ATmega161
ATmega162
ATmega163
ATmega168
ATmega32
ATmega323
Board Features
Cable/Connection
Power Consumption
I/O
May-06-13
Senior Design
Page 13
2/9/2016
Pros:
The advantage of using the STK200 starter kit is that the kit is
compatible with a variety of 8-bit, 16-bit, and 32-bit Atmel AVR
microprocessors. The kit also makes it easily interchangeable between
devices with 1x8, 2x20, 1x28, 2x40 pins digital sockets. Port B-E
headers of the development board contain Vcc and Ground pins which
can be utilized to drive external circuitries and contain 8 I/O pins each.
Programming should be very unproblematic because the Application
Builder software included with the kit will allow the user to efficiently
setup code for ports, timers, UART, ADC, SPI, watchdog and
interrupts. AVR Studio 4 is a full editor, assembler and simulator of all
AVR devices and AvrEdit and AVRGCC allow the utilization of C
programming language in the development process. Other highlights of
the kit include communication via RS232, brownout circuitries,
sufficient I/O ports, and expandability with external RAM, Flash, and
EEPROM sockets.
Cons:
The main disadvantage is that the AT90S8515-8PC microcontroller
included with the kit is an 8-bit microcontroller with 8K bytes in-system
programmable flash memory, which might be insufficient memory
allocation for project feasibility. Another disadvantage is that the clock
speed runs by default at 8MHz, given a 2.7V power supply and is
advertised to run at 16MHz at 5V, but that fact is not guaranteed by
Atmel.
May-06-13
Senior Design
Page 14
2/9/2016
Pros:
The development board for this kit contains the same features and
functionalities as the STK200 development board, but has been
modified so it is compatible with AVR Mega microcontrollers. The main
advantage of this implementation is that larger projects are now
feasible with the incorporation of AVR Mega microcontrollers. Included
with the kit is ATmega128L-8AI microcontroller containing 128K bytes
of in-system programmable Flash, 4K bytes of in-system
programmable EEPROM and 4K bytes of SRAM. This is sufficient
memory allocation for project feasibility. Since the microcontroller chips
are surface mounted on a daughter board, problems with surface
mounting the device can be avoided. Other advantages and highlights
with STK300 are similar to advantages and highlights with STK200.
May-06-13
Senior Design
Page 15
2/9/2016
Application Builder is also included with the kit. Also included in the kit
is AVR ISP software that supports programming via PCs parallel port.
Programming through PCs serial port is still possible with this kit. AVR
and IAR Studio are available to be downloaded from Atmel websites.
AVR Studio allows easy development and debugging with its built in
assembler and simulator.
Cons:
The main disadvantage of this kit is the microcontroller is not as easily
interchangeable as SKT200 because the new device has to be
soldered on the daughter boards first. Another disadvantage is that the
STK200 supports more microcontrollers than the STK300.
Table 3 Freescale MC68HC11E9 Starter Kit
Freescale (Motorola) MC68HC11E9 Starter Kit
Compatible Microcontroller
MC68HC11E9 (12K Flash/EPROM; 512 RAM; 512 EEPROM; 38 I/O)
Board Features
Cable/Connection
PC COM port
Power Consumption
7-18VDC
I/O
NONE
Highlights
3"x1.5" Solderless Breadboard
Prototype Area
8MHz crystal
LCD's connectors
Keypad connectors
U5: 32Kbytes RAM installed
U7: 8Kbytes EEPROM installed
U6: expandable slot for RAM, EPROM, and EEPROM
Buffalo Monitor utility for debug and test program
Accompanied Development Software
Minimum hardware and
software requirements
DOS or Win 3.1
Software
AXIDE
free Assembler, C compiler and example source code
Price
$99
Pros:
The main advantage of Freescale (Motorola) MC68HC11E9 Starter Kit
Is that it has a solderless breadboard area and prototype area that can
be easily utilized for prototyping circuits as well as driving different
circuit components. The MC68HC11E9 microcontrollers with the
installed 32K bytes external RAM and 8K bytes external EEPROM will
provide sufficient memory allocation for project feasibility. Program will
be stored in 32K bytes RAM to be tested and debugged by Buffalo
Monitor utility. Other advantages include program in assembler and C,
sufficient I/O ports, and expandable slots.
May-06-13
Senior Design
Page 16
2/9/2016
Cons:
The main disadvantage of Freescale (Motorola) MC68HC11E9 Starter
Kit is that the development board does not contain any I/O port
headers. This can be an issue to the project feasibility because one of
the microcontroller functions is to drive and monitor electrical
appliances. An I/O port header may be implemented on the prototype
and solderless breadboard area, but this is an unnecessary use of
resources compared to the other starter kits. Another disadvantage
with this starter kit is that it does not allow interchangeability among
different microcontroller since the MC68HC11E9 microcontroller is
surface mounted onto the development board. The last disadvantages
for this starter kit is its price is considerably higher then the previous
starter kits.
Table 4 Philips 51 Plus Starter Kit
8051 Starter Kit Philips XA/RD/66x
Compatible Microcontroller
P89C51RB2(H)
P89C660
XA-G49** (64K bytes Flash; 2K RAM)
P89C51RC2(H)
P89C662
P89C51RD2(H)
P89C664
P89C668
Board Features
Cable/Connection
Serial
Power Consumption
9-15V AC or DC
I/O
32 I/O ports
Highlights
40-pin DIP
44-pin PLCC
sockets
External RAM
circuitry
LCD connection
switches and
10-way Bar LED
Accompanied Development Software
Minimum hardware and
software requirements
Win 95
Software
Application Builder
WINISP and Flash Magic Programming Tools
C-compiler Demos (4K max) and Simulator
Price
$94.80
Pros:
The main advantage of this kit is that the XA-G49 microcontroller chip
that is included with match project feasibility. This will mean more
functionality and expandability for the project. Other highlights of the kit
include sufficient I/O ports for project feasibility and external RAM
circuitry.
Cons:
May-06-13
Senior Design
Page 17
2/9/2016
The main concern with this kit is it the XA-G49 does not contain any
EEPROM memory and could be problematic if the project functionality
requires the use of EEPROM. The other concern is the C-compiler
included in the kit is only a demo version, with coding limited to 4K
bytes. This will limit the utilization of C programming language and the
efficiency of the coding process.
Microcontroller selected: STK300 Starter Kit
After reviewing all of the microcontroller starter kits under
consideration, the team selected STK300 Starter Kit to be the optimal
choice.
May-06-13
Senior Design
Page 18
2/9/2016
May-06-13
Senior Design
Page 19
2/9/2016
May-06-13
Senior Design
Page 20
2/9/2016
May-06-13
Senior Design
Page 21
2/9/2016
Variable Declaration
Since the decision of programming in the C language was chosen, all
variables must be declared at the beginning of any and all functions.
The variables shall be grouped together with similar variable types. For
example, all integers shall be grouped together separate from all char,
char*, etc.
Line Length
The number of characters per line shall be limited to 80 characters per
line. The reason for this is for proper printing of all source code.
Function Declarations and Operations
The convention this team will use will be to not include any spacing
between comparison operators or function elements. An example of
this is shown in figure 4.
May-06-13
Senior Design
Page 22
2/9/2016
2.1.5.Testing
Testing is separated into two major types: Unit and integration. Unit
testing is used to determine that a single component is functioning
correctly while integration testing is used to determine that a newlyadded component is functioning correctly within the context of the rest of
the program.
The following unit testing requirements will be indicators that the system
can successfully be implemented:
GSM Network Communication
The GSM receiver will be tested for successful communication with
network. This will test include automation and consistency of the
connection and will be conducted by a team member in the following
way:
May-06-13
Senior Design
Page 23
2/9/2016
Success/Failure criteria:
The testing will be considered
successful if the measured output voltage is properly scaled to the
microcontrollers required input value. The test will be considered
a failure otherwise.
Page 24
2/9/2016
The circuits power supply will be removed from the circuit and
connected to a dummy load.
May-06-13
Senior Design
Page 25
2/9/2016
Verification that the status message was received by the user cell
phone will be performed.
of
the
2.1.6.Project Continuation
May-06-13
Senior Design
Page 26
2/9/2016
2.2.Detailed Design
This section discusses the features and the design of the end product in
depth. The discussion is based on the following sections:
May-06-13
Senior Design
Page 27
2/9/2016
INITIALIZATION:
The initialization portion will require the following libraries in the project
directory:
deftypes.h Loads type definitions for String
RS232.h Loads RS232 serial drivers
SerComm.h Loads Serial Communication types
ATCommand.h Loads AT Commands for use
Include the entire EWMSDK library in the project:
AT Commands
PDU (Protocol Data Unit) Formatting
Serial Communication & RS232
AT_InitializeData
This is necessary when dealing with embedded systems in order
to initialize memory upon startup. This function is used before initializing
channels or registering events.
AT_CheckEvents / or Call AT_SetTimer (in Windows)
This will periodically search for events and will call
AT_CheckEvents
MS_EstablishChannel
This function call will open the serial channel that will be used to
communicate with the GSM chip. When communication with the GSM
chip is complete, MS_ReleaseChannel will be called in order to keep the
channel available for other applications.
CFG_SetCommandEcho (value parameter = 0)
EWMSDK will not work if ATE is set to 1.
VM_SetATResponseFormat (value parameter = 1)
This will enable verbose mode. The library requires ATV to be set to
value 1 (ATV1) which is the usual state of modems. Dont work in ATV0
mode.
CFG_SetReportEquipmentError (value parameter = 1)
This will allow the library to offer specific error code results returned
by the module. There are 3 modes available: 0 and 2 will not interpret
error codes, 1 will return error codes that can be referenced by the GSM
modules Integrator manual.
May-06-13
Senior Design
Page 28
2/9/2016
May-06-13
Senior Design
Page 29
2/9/2016
May-06-13
Senior Design
Page 30
2/9/2016
May-06-13
Senior Design
Page 31
2/9/2016
May-06-13
Senior Design
Page 32
2/9/2016
The thermostat also has three switches (S1, S2, S3) these are
used to program different modes of operation or to change
temperature set point. The controller is connected to an LCD that
will either display the room temperature and the desired
temperature and whether the fan is turned on or off. The EEPROM
is used to store the temperature read by the temperature sensor.
The operation of this thermostat is as follows:
1. The temperature sensor checks the room temperature every
x seconds and sends the information to the microcontroller.
2. The microcontroller uses this information by comparing the
room temperature to the desired temperature. There are two
possible scenarios that will result heat or cool the room.
If the room temperature is under the desired temperature,
the light bulb will turn on. This will heat up the
temperature sensor until the temperatures are the same.
If the room temperature is above the desired temperature
the fan will turn on. This will cool the temperature sensor
until the desired and room temperatures are equal.
Interface between Microcontroller and Thermostat
The microcontroller will use 3 pins from port A as outputs that will
be connected to an XOR gate. The inputs to the XOR gate are one
from the microcontroller and one from the pushbutton or the switch.
These were selected so that the system can choose which signal
are going to be use: either the one from the button or the one from
the microcontroller. The XOR gate gives a 1 output only when the
two inputs are different. Using this setup, only one will be controlling
the input for the thermostat. The multiplexer from the thermostat,
which sends the temperature, will be connected to both the
microcontroller of the thermostat and the remote controlling
systems microcontroller. The thermometer will be sending the room
temperature and the remote controlling system will both get it and
use it to send to the user and other applications. This will also be
connected to the output of the thermostat microcontroller that goes
to the LCD so the desired temperature can be read and then
determine how much the user wants to change the temperature
(see the schematic in Figure 5).
May-06-13
Senior Design
Page 33
2/9/2016
May-06-13
Senior Design
Page 34
2/9/2016
Speed control:
The fans manufactured speed control circuitry consists of a 4
position switchof which 3 positions correspond to fan speeds
and the 4th corresponds to the off positionand of three different
size windings sharing a metal core with the rotor. The windings all
share a common 120VAC voltage source and the switch selects
either winding, allowing it to conduct to ground. The implemented
speed control mimics this control system by connecting Single Pole
Single Throw relays R0-R2 in parallel with each switchs winding
connection and the manual/remote select switch. R0-R2 are
controlled by signals from bits 0-2 of port A of the STK300. For
each switch the default/de-energized position is open circuit, and
the energized position is closed circuit. Effectively the asserted bit
selects the speed of the fan.
May-06-13
Senior Design
Page 35
2/9/2016
May-06-13
Senior Design
Page 36
2/9/2016
Light Control:
The implemented control of a lamp essentially follows a similar design as
the control of the fan. There is a Single Pole Double Throw relay
controlling the selection of remote/manual operation and there is a
Single Pole Single Throw relay in parallel with the light switch mimicking
its function. The remote/manual selection relay is controlled by port B bit
1 of the STK300 and the on/off control relay is controlled by bit 0 of the
same port.
May-06-13
Senior Design
Page 37
2/9/2016
3.
This section includes an estimate of the resources required for the project.
Resources defined include the number of hours each team member will spend on
different project areas, any equipment that will be necessary for the project, and
the total dollar amount that the team will need for successful project completion.
May-06-13
Senior Design
Page 38
2/9/2016
15
25
25
10
42
184
Chau Nguyen
10
20
35
20
10
35
170
Issa Drame
12
20
30
15
10
45
172
Arturo Palau
10
25
30
70
Other
Resources
20
44
80
98
60
30
152
604
Total
Project Reporting
DemonstrationEnd-Product
12
End-Product Testing
DesignEnd-Product
Adam Mohling
Problem Definition
DocumentationEnd-Product
ImplementationEnd-Product
Total
13
25
25
10
56
190
Chau Nguyen
18
35
20
10
50
178
Issa Drame
28
30
15
10
55
184
Arturo Palau
11
52
74
Other
Resources
23
70
20
98
60
30
213
634
Total
Page 39
2/9/2016
May-06-13
Senior Design
Page 40
2/9/2016
Without
Labor
Item
Original Projection
Parts and Materials
Computer Hardware &
$0.00
Software
Final Project Enclosure
$3.00
M2M GSM Controller
$140.00
Misc. Electronic Components
$8.00
Poster
$50.00
Subtotal
$201.00
Labor (at $10.30/hr)
Adam Mohling
Chau Nguyen
Issa Drame
Arturo Palau
Subtotal
$0.00
Total
Projected Total Cost
Parts and Materials
Misc. Electronic Components
$8.00
GM28 GSM Cellular module
$231.00
GM28 Power Supply
$33.00
GM28 Antenna
$22.00
Microcontroller Starter Kit
$85.00
Poster
$50.00
Subtotal
$429.00
Labor (at $10.30/hr)
Adam Mohling
Chau Nguyen
Issa Drame
Arturo Palau
Subtotal
Total
May-06-13
Senior Design
Page 41
With Labor
$0.00
$1895.20
$1751.00
$1771.60
$721.00
$6138.80
$6339.80
$1957.00
$1833.40
$1895.20
$762.20
$6447.80
$6876.80
2/9/2016
3.2. Schedules
To date, the team has managed to stay remarkably on schedule. The only
major difference between the previous and current Gantt chart is that the
teams project poster has been moved to the 2 nd semester of the course.
The only difference between the original project schedule and the current
project schedule is that the poster has been moved to the next semester. This
is also reflected in the detailed project reporting schedule
May-06-13
Senior Design
Page 42
2/9/2016
May-06-13
Senior Design
Page 43
2/9/2016
** Notice the project poster is the only change from the previous to the
current schedule.
May-06-13
Senior Design
Page 44
2/9/2016
Since the team has not reached the development stage, there are no
comparisons to be made to the teams projected development schedule. The
team is still planning on beginning development of the project during January
of 2006.
May-06-13
Senior Design
Page 45
2/9/2016
4. Closure Materials
This section provides contact information for all significant parties involved in the
project. Also included are a closing summary intended to give the reader a final
perspective on the whole project and a list of references the team will be using
during the course of the project.
Chau Nguyen EE
137 S. Franklin Ave.
Ames, IA 50014
(319)321-8619
chayman@iastate.edu
Issa Drame EE
4335 Frederickson Court
Ames, IA 50010
(515)572-7820
issad@iastate.edu
May-06-13
Senior Design
Page 46
2/9/2016
4.3 Reference:
Senior Design Course Notes Iowa State University
Available at http://seniord.ee.iastate.edu/notes/
4.4 Appendix
May-06-13
Senior Design
Page 47
2/9/2016
Appendix A
GM28 GSM Module Images
May-06-13
Senior Design
Page 48
2/9/2016
Appendix B
STK300 Microcontroller Developers Kit Images
May-06-13
Senior Design
Page 49
2/9/2016
Appendix C
120V AC--5VDC Fan Status Signal Circuit Simulation Results
May-06-13
Senior Design
Page 50
2/9/2016