You are on page 1of 24

TABLE OF CONTENTS

CHAPTER ONE: INTRODUCTION 1.1 Introduction 1.2 Methodology 1.3 Scope of Work 1.4 Aims of the GSM STEPPER MOTOR CONTROL 1.5 Objectives of the GSM STEPPER MOTOR CONTROL CHAPTER TWO: THEORETICAL BACKGROUND AND LITERATURE REVIEW 2.0 Theoretical Background 2.1 GSM Architecture 2.2 Technical Details 2.3 GSM Frequencies 2.4 Network Structure 2.5 Subscriber Identity Module (SIM) 2.6 Literature Review 2.7 GSM Security 2.8 Circuit Diagram of the GSM STEPPER MOTOR CONTROL and Power Supply CHAPTER THREE: DESIGN AND CONSTRUCTION 3.1 GSM Modem 3.1.1 Accessing GSM MODEM using Microsoft HyperTerminal 3.2 Testing of GSM Modem 3.3 List of Important AT Commands 3.4 Microcontroller MODEM Interfacing 3.4.1. DTE and DCE 3.4.2. RS-232 3.4.3. RTS/CTS Handshaking
1

CHAPTER FOUR: REFRENCES

STEPPER MOTOR CONTROL

CHAPTER ONE
1.1 Introduction GSM and GPRS based Designs have developed another innovative and Public utility product for mass communication [1]. This is a Stepper Motor Control Device which control the Stepper Motor through messages received as SMS or GPRS Packets and also send acknowledgement of task. Such Devices can be used at different areas of the human being life. Such offices, houses, factories etc. Sent command from Mobiles or PCs to these devices for move the motor left, right, stop. These devices are designed to remotely control the Stepper Motor from anywhere and anytime. Wireless communication has announced its arrival on big stage and the world is going mobile [2]. We want to control everything and without moving an inch. This remote control Stepper Motor Control device is possible through Embedded Systems. The use of Embedded System in Communication has given rise to many interesting applications that ensures comfort and safety to human life [3]. The main aim of the project will be to design a SMS electronic Stepper Motor Control toolkit which can replace the traditional Stepper Motor Control Devices. The toolkit receives the SMS, validates the sending Mobile Identification Number (MIN) and perform the desired operation after necessary code conversion. The system is made efficient by SIMs so that the SMS can be received by number of devices boards in a locality using techniques of time division multiple access. The main components of the toolkit include microcontroller, GSM modem. These components are integrated with the device board and thus incorporate the wireless features. The GSM modem receives the SMS. The AT commands are serially transferred to the modem. In return the modem transmits the stored message through the wireless link. The microcontroller validates the SMS and then perform specific task on the device. The microcontroller used in this case is ATMEL7. AT89S52 .Motorola W220 is used as the GSM modem. In this prototype model, LCD display is used for simulation purpose. The results presented in the thesis support the proper functionalities and working of the system. The timing diagram suggests the response of the modem to various AT (attention) commands.

1.2 Methodology
The method used to carry out this project is the principle of serial communication in collaboration with embedded systems. This is a very good project for Industries. This project has a Stepper Motor Control, which will be used as the electronic device, and also a GSM modem, which is the latest technology used for communication between the mobile and the embedded devices. System will work like when the user wants to on/off the device; he has to send the message in his mobile defining the messages and then the password of the system to the number of the subscriber identity module (SIM) which is inserted in the display system MODEM. Then, the MODEM connected to the display system will receive the SMS, the microcontroller inside the system is programmed in such a way that when the modem receives any message the microcontroller will read the message from serial headphone and verify for the password, if the password is correct then it will start performing desire task.

1.3 Scope of Work


I will use liquid crystal display for displaying the message; I will also use GSM modem (Motorola W220) as an interface between mobile and microcontroller. I will send message from any phone irrespective of the GSM network to the modem connected to the programmable device using a password. The message will get by the GSM Modem of the device and do specific task.

1.4 Aims of the Electronic Stepper Motor Control


Uses: This is great and innovative and useful project, you can use this project to control stepper motor at your home, offices, schools, colleges etc.

1.5 Objectives of the Electronic Stepper Motor Control


 Programming of the mobile phone with AT (Attention) command sequence  Interfacing the programming chip with the personal computer  Interfacing the programmable chip with the Stepper Motor.  Interfacing of the mobile phone with the programmable chip  Sending messages from the remote phone to control device.

CHAPTER TWO THEORETICAL BACKGROUND AND LITERATURE REVIEW


2.0 Theoretical Background GSM (Global System for Mobile communications: originally from GROUPE Special Mobile) is the most popular standard for mobile phones in the world. Its promoter, the GSM Association, estimates that 80% of the global mobile market uses the standard. GSM is used by over 3 billion people across more than 212 countries and territories [4]. Its ubiquity makes international roaming very common between mobile phone operators enabling subscribers to use their phones in many parts of the world. GSM differs from its predecessors in that both signaling and speech channels are digital, and thus is considered a second generation (2G) mobile phone system [5]. This has also meant that data communication was easy to build into the system.

2.1 GSM Architecture GSM is a complex system and difficult to understand. The Mobile Station (MS) refers to the mobile equipment [6]. The Base Station Subsystem controls the radio link with the Mobile Station. The Network Subsystem performs main functions such as switching of calls between mobile users, mobility management operations, and proper operation and setup of a network [7]. These functions are controlled by the Mobile Services Switching Center (MSC).

2.2 Technical Details

GSM is a cellular network, which means that mobile phones connect to it by searching for cells in the immediate vicinity. 2.3 GSM Frequencies GSM networks operate in a number of different frequency ranges (separated into GSM frequency ranges for 2G and UMTS frequency bands for 3G). Most 2G GSM networks operate in the 900 MHz or 1800 MHz bands. Some countries in the Americas (including Canada and the United States) use the 850 MHz and 1900 MHz bands because the 900 and 1800 MHz frequency
6

bands were already allocated. Most 3G GSM networks in Europe operate in the 2100 MHz frequency band [9].

2.4 Network Structure

The network behind the GSM seen by the customer is large and complicated in order to provide all of the services which are required.  The Base Station Subsystem (the base stations and their controllers).  The Network and Switching Subsystem (the part of the network most similar to a fixed network). This is sometimes also just called the core network.  The GPRS Core Network (the optional part which allows packet based Internet connections).  All of the elements in the system combine to produce many GSM services such as voice calls and SMS.

2.5 Subscriber Identity Module (SIM) One of the key features of GSM is the Subscriber Identity Module, commonly known as a SIM card. The SIM is a detachable smart card containing the user's subscription information and phone book. This allows the user to retain his or her information after switching handsets [10]. Alternatively, the user can also change operators while retaining the handset simply by changing the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only a SIM issued by them; this practice is known as SIM locking, and is illegal in some countries [11].

2.6 Literature Review


This project is an implementation to the idea of the wireless communication between a mobile phone and a microcontroller. Currently the main work that has been done on this proposed system is through serial port to the computer but not wireless. If they want to control the Stepper Motor, they have to go to the remote area and change the rotation and one /off the Stepper Motor. But in this new design, the systems need not be reprogrammed to control Stepper Motor
7

hanging the programming of microcontroller. The user will send SMS from his phone and he will be able to control the Stepper Motor.

2.7 GSM Security GSM was designed with a moderate level of security. The system was designed to authenticate the subscriber using a pre-shared key and challenge-response. Communications between the subscriber and the base station can be encrypted.

Fig. 2.2 Block Diagram

As we see in the above figure, there are at least three interfacing circuits, MAX-232 with Microcontroller, LCD display with microcontroller, and MAX-232 with GSM MODEM.

2.8 Circuit Diagram of the GSM Electronic Stepper Motor Control

POWER SUPPLY:
Power supply is a reference to a source of electrical power. A device or system that supplies electrical or other types of energy to an output load or group of loads is called a power supply unit or PSU. The term is most commonly applied to electrical energy supplies, less often to mechanical ones, and rarely to others. Here in our application we need a 5v DC power supply for all electronics involved in the project. This requires step down transformer, rectifier, voltage regulator, and filter circuit for generation of 5v DC power. Here a brief description of all the components is given as follows:

TRANSFORMER:
A transformer is a device that transfers electrical energy from one circuit to another through inductively coupled conductors the transformer's coils or "windings". Except for air-core transformers, the conductors are commonly wound around a single iron-rich core, or around separate but magnetically coupled cores. A varying current in the first or "primary" winding creates a varying magnetic field in the core (or cores) of the transformer. This varying magnetic field induces a varying electromotive force (EMF) or "voltage" in the "secondary" winding. This effect is called mutual induction.

If a load is connected to the secondary circuit, electric charge will flow in the secondary winding of the transformer and transfer energy from the primary circuit to the load connected in the secondary circuit. The secondary induced voltage VS, of an ideal transformer, is scaled from the primary VP by a factor equal to the ratio of the number of turns of wire in their respective windings: By

10

appropriate selection of the numbers of turns, a transformer thus allows an alternating voltage to be stepped up by making NS more than NP or stepped down, by making it. BASIC PARTS OF A TRANSFORMER In its most basic form a transformer consists of:  A primary coil or winding.  A secondary coil or winding.  A core that supports the coils or windings. Refer to the transformer circuit in figure as you read the following explanation: The primary winding is connected to a 60-hertz ac voltage source. The magnetic field (flux) builds up (expands) and collapses (contracts) about the primary winding. The expanding and contracting magnetic field around the primary winding cuts the secondary winding and induces an alternating voltage into the winding. This voltage causes alternating current to flow through the load. The voltage may be stepped up or down depending on the design of the primary and secondary windings.

REGULATOR IC (78XX)
It is a three pin IC used as a voltage regulator. It converts unregulated DC current into regulated DC current.

Normally we get fixed output by connecting the voltage regulator at the output of the filtered DC (see in above diagram). It can also be used in circuits to get a low DC voltage from a high DC voltage (for example we use 7805 to get 5V from 12V). There are two types of voltage regulators
11

1.fixed voltage regulators (78xx, 79xx) 2. variable voltage regulators (LM317) In fixed voltage regulators there is another classification 1. +ve voltage regulators 2. -ve voltage regulators POSITIVE VOLTAGE REGULATORS This include 78xx voltage regulators. The most commonly used ones are 7805 and 7812. 7805 gives fixed 5V DC voltage if input voltage is in (7.5V, 20V).

The CAPACITOR FILTER The simple capacitor filter is the most basic type of power supply filter. The application of the simple capacitor filter is very limited. It is sometimes used on extremely high-voltage, low current power supplies for cathode ray and similar electron tubes, which require very little load current from the supply. The capacitor filter is also used where the power-supply ripple frequency is not critical; this frequency can be relatively high. The capacitor (C1) shown in figure 4-15 is a simple filter connected across the output of the rectifier in parallel with the load.

Full-wave rectifier with a capacitor filter When this filter is used, the RC charge time of the filter capacitor (C1) must be short and the RC discharge time must be long to eliminate ripple action. In other words, the capacitor must charge up fast, preferably with no discharge at all. Better filtering also results when the input frequency is high; therefore, the full-wave rectifier output is easier to filter than that of the half-wave rectifier because of its higher frequency. For you to have a better understanding of the effect that filtering has on Eavg, a comparison of a rectifier circuit with a filter and one without a filter is illustrated in views A and B of figure 4-16. The output waveforms in figure 4-16 represent the unfiltered and filtered outputs of the halfwave rectifier circuit. Current pulses flow through the load resistance (RL) each time a diode conducts. The dashed line indicates the average value of output voltage. For the half-wave rectifier, Eavg is less than half (or approximately 0.318) of the peak output voltage. This value is still much less than that of the applied voltage. With no capacitor connected across the output of the rectifier
12

circuit, the waveform in view A has a large pulsating component (ripple) compared with the average or dc component. When a capacitor is connected across the output (view B), the average value of output voltage (Eavg) is increased due to the filtering action of capacitor C1.

UNFILTERED

Half-wave rectifier with and without filtering

FILTERE

The value of the capacitor is fairly large (several microfarads), thus it presents a relatively low reactance to the pulsating current and it stores a substantial charge. The rate of charge for the capacitor is limited only by the resistance of the conducting diode, which is relatively low. Therefore, the RC charge time of the circuit is relatively short. As a
13

result, when the pulsating voltage is first applied to the circuit, the capacitor charges rapidly and almost reaches the peak value of the rectified voltage within the first few cycles. The capacitor attempts to charge to the peak value of the rectified voltage anytime a diode is conducting, and tends to retain its charge when the rectifier output falls to zero. (The capacitor cannot discharge immediately.) The capacitor slowly discharges through the load resistance (RL) during the time the rectifier is non-conducting. The rate of discharge of the capacitor is determined by the value of capacitance and the value of the load resistance. If the capacitance and load-resistance values are large, the RC discharge time for the circuit is relatively long. A comparison of the waveforms shown in figure 4-16 (view A and view B) illustrates that the addition of C1 to the circuit results in an increase in the average of the output voltage (Eavg) and a reduction in the amplitude of the ripple component (Er) which is normally present across the load resistance. Now, let's consider a complete cycle of operation using a half-wave rectifier, a capacitive filter (C1), and a load resistor (RL). As shown in view A of figure 4-17, the capacitive filter (C1) is assumed to be large enough to ensure a small reactance to the pulsating rectified current. The resistance of RL is assumed to be much greater than the reactance of C1 at the input frequency. When the circuit is energized, the diode conducts on the positive half cycle and current flows through the circuit, allowing C1 to charge. C1 will charge to approximately the peak value of the input voltage. (The charge is less than the peak value because of the voltage drop across the diode (D1)). In view A of the figure, the heavy solid line on the waveform indicates the charge on C1. As illustrated in view B, the diode cannot conduct on the negative half cycle because the anode of D1 is negative with respect to the cathode. During this interval, C1 discharges through the load resistor (RL). The discharge of C1 produces the downward slope as indicated by the solid line on the waveform in view B. In contrast to the abrupt fall of the applied ac voltage from peak value to zero, the voltage across C1 (and thus across RL) during the discharge period gradually decreases until the time of the next half cycle of rectifier operation. Keep in mind that for good filtering, the filter capacitor should charge up as fast as possible and discharge as little as possible.

14

Figure 4-17A. - Capacitor filter circuit (positive and negative half cycles). POSITIVE HALFCYCLE

Figure 4-17B. - Capacitor filter circuit (positive and negative half cycles). NEGATIVE HALFCYCLE

Since practical values of C1 and RL ensure a more or less gradual decrease of the discharge voltage, a substantial charge remains on the capacitor at the time of the next half cycle of operation. As a result, no current can flow through the diode until the rising ac input voltage at the anode of the diode exceeds the voltage on the charge remaining on C1. The charge on C1 is the cathode potential of the diode. When the potential on the anode exceeds the potential on the cathode (the charge on C1), the diode again conducts and C1 begins to charge to approximately the peak value of the applied voltage.

15

After the capacitor has charged to its peak value, the diode will cut off and the capacitor will start to discharge. Since the fall of the ac input voltage on the anode is considerably more rapid than the decrease on the capacitor voltage, the cathode quickly become more positive than the anode, and the diode ceases to conduct. Operation of the simple capacitor filter using a full-wave rectifier is basically the same as that discussed for the half-wave rectifier. Referring to figure 4-18, you should notice that because one of the diodes is always conducting on. either alternation, the filter capacitor charges and discharges during each half cycle. (Note that each diode conducts only for that portion of time when the peak secondary voltage is greater than the charge across the capacitor.)

Figure 4-18. - Full-wave rectifier (with capacitor filter).

Another thing to keep in mind is that the ripple component (E r) of the output voltage is an ac voltage and the average output voltage (Eavg) is the dc component of the output. Since the filter capacitor offers relatively low impedance to ac, the majority of the ac component flows through the filter capacitor. The ac component is therefore bypassed (shunted) around the load resistance, and the entire dc component (or Eavg) flows through the load resistance. This statement can be clarified by using the formula for XC in a half-wave and full-wave rectifier. First, you must establish some values for the circuit.

16

CIRCUIT DIAGRAM OF POWER SUPPLY

17

CHAPTER THREE 3.1 GSM Modem


A GSM modem is a wireless modem that works with a GSM wireless network. A wireless modem behaves like a dial-up modem. The main difference between them is that a dial-up modem sends and receives data through a fixed telephone line while a wireless modem sends and receives data through radio waves. Like a GSM mobile phone, a GSM modem requires a SIM card from a wireless carrier in order to operate [11].

3.1.1 Accessing GSM MODEM using Microsoft HyperTerminal


Microsoft HyperTerminal is a small program that comes with Microsoft Windows. We use it to send AT commands to the GSM modem. It can be found at Start -> Programs -> Accessories -> Communications -> HyperTerminal. Before programming our SMS application, it is required to check if the GSM modem and SIM card are working properly first [12]. The MS HyperTerminal is a handy tool when it comes to testing the GSM device. It is a good idea to test the GSM devices beforehand. When a problem occurs, sometimes it is difficult to tell what causes the problem. The cause can be the program, the GSM device or the SIM card. If GSM device and SIM card with MS HyperTerminal are operating properly, then it is very likely that the problem is caused by the program or other hardware [12]. For Linux users, Mincom can be used instead of HyperTerminal.

3.2 List of Important AT Commands


After successfully testing the MODEM for its correct operational state, I then set the MODEM parameters like Baud rate, Echo off etc to enable easier access via a microcontroller which I used in this project. The following are the ATCOMMAND used for programming the GSM modem

Example: Changing and saving parameters


AT+IPR=9600[Enter] Transfer rate to 9600bps AT&W [Enter] save parameters AT+CMGF means convert the message to machine instruction format AT+CPMS means selection of SMS memory
18

AT+CMGR means read message from a given memory location AT+CMGD means delete message from a given memory location.

3.3 Microcontroller Modem Interfacing 3.3.1. DTE and DCE


The terms DTE and DCE are very common in the data communications market. DTE is short for Data Terminal Equipment and DCE stands for Data Communications Equipment. As the full DTE name indicates this is a piece of device that ends a communication line, whereas the DCE provides a path for communication. Let's say I have a computer on which wants to communicate with the Internet through a modem and a dial-up connection. To get to the Internet I tell my modem to dial the number of my provider. After my modem has dialed the number, the modem of the provider will answer my call and I will hear a lot of noise. Then it becomes quiet and I see my login prompt or my dialing program tells me the connection is established. Now I have a connection with the server from my provider and I can surf the Internet [13].

19

3.3.2. RS-232
In telecommunications, RS-232 is a standard for serial binary data signals connecting between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment)[14]. It is commonly used in computer serial ports. In RS-232, data is sent as a time-series of bits. Both synchronous and asynchronous transmissions are supported by the standard. In addition to the data circuits, the standard defines a number of control circuits used to manage the connection between the DTE and DCE [14]. Each data or control circuit only operates in one direction that is, signaling from a DTE to the attached DCE or the reverse. Since transmit data and receive data are separate circuits, the interface can operate in a full duplex manner, supporting concurrent data flow in both directions [15]. The standard does not define character framing within the data stream, or character encoding.

Fig.3.1 Female 9 pin plug

3.3.3. RTS/CTS Handshaking


The standard RS-232 use of the RTS and CTS lines is asymmetrical. The DTE asserts RTS to indicate a desire to transmit and the DCE asserts CTS in response to grant permission. This allows for half-duplex modems that disable their transmitters when not required, and must transmit a synchronization preamble to the receiver when they are re enabled [16]. There is no way for the DTE to indicate that it is unable to accept data from the DCE. A non-standard symmetrical alternative is widely used: CTS indicates permission from the DCE for the DTE to transmit, and RTS indicates permission from the DTE for the DCE to transmit [17]. The "request to transmit" is implicit and continuous. The standard defines RTS/CTS as the signaling protocol for flow control for data transmitted from DTE to DCE. The standard has no provision for flow control in the other direction. In practice, most hardware seems to have repurposed the RTS
20

signal for this function [18]. A minimal 3-wire RS-232 connection consisting only of transmits data, receives data and ground, and is commonly used when the full facilities of RS-232 are not required. When only flow control is required, the RTS and CTS lines are added in a 5-wire version.

3.3.4. Specifying Baud Rate, Parity & Stop bits


Serial communication using RS-232 requires four parameters: the baud rate of the transmission, the number of data bits encoding a character, the sense of the optional parity bit, and the number of stop bits. Each transmitted character is packaged in a character frame that consists of a single start bit followed by the data bits, the optional parity bit, and the stop bit or bits. A typical character frame encoding the letter "m" is shown here.

3.4 Microcontroller LCD Interfacing

Above is the quite simple schematic. The LCD panels Enable and Register Select is connected to the Control Port. The Control Port is an open collector / open drain output. Therefore by incorporating the two 10K external pull up resistors, the circuit is more portable for a wider range of computers, some of which may have no internal pull up resistors. I make no effort to place the Data bus into reverse direction. Therefore I had wire the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on the data lines. As a result I cannot read back the LCDs internal Busy Flag which tells us if the LCD has accepted and finished processing the

21

last instruction [20]. This problem is overcome by inserting known delays into my program. The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here. I used a power supply of 5volt. The user may select whether the LCD is to operate with a 4-bit data bus or an 8- bit data bus. If a 4-bit data bus is used, the LCD will require a total of 7 data lines. If an 8-bit data bus is used, the LCD will require a total of 11 data lines [20]. LCD with 8 bit data bus is used for this design. The three control lines are EN, RS, and RW. EN line must be raised/lowered before/after each instruction sent to the LCD regardless of whether that instruction is read or write text or instruction. In short, I manipulate EN when communicating with the LCD.

22

Component List

23

CHAPTER FOUR REFERENCES


1. The 8051Microcontroller by Kenneth J. Ayala 2. 3. 4. 5. The 8051 Microcontroller and Embedded Systems by Muhammad Ali Mazidi. Principles and Applications of GSM by Vijay Garg. Artificial Intelligence Elain Rich & Kevin Knight, Tata Mc Graw Hill, 2nd Edition. Artificial Intelligence A Modern approach Slaurt Russel and Peter Norving, Pearson Education, 2nd Edition. 6. Introduction to Robotics P.J.Mc Kerrow, Addisson Wesley, USA, 1991 Bernard Sklar, Digital Communications: Fundamentals and Applications, Prentice Hall, 2001. 7. A. Clark and R. Harun, Assessment of kalman-_lter channel estimators for an HF radio link," IEE Proceedings, vol. 133, pp. 513{521, Oct 1986. 8. ETS 300 502. European Digital Cellular Telecommunication System (Phase 2); Teleservices Supported by a GSM Public Land Mobile Network (PLMN). European Telecommunications Standards Institute. September 1994. 9. Matthew C. Valenti and Jian Sun, Chapter 12: Turbo Codes, Handbook of RF and Wireless. 10. http://www.mobilegpsonline.com/downloads/GM28-29%20Datasheet%20R1G.pdf 11. http://www.mobilegpsonline.com/GSMJC01Spec.pdf 12. http://www.visualgsm.com/wire_sms_index.htm 13. http://en.wikipedia.org/wiki/Gsm

24

You might also like