DC Motor Speed Control Using SMS Application

This paper presents an easy method to control the speed of DC motor by sending SMS message from mobile phone. This system is designed to bring convenience to the user to control the motor speed from anywhere by using SMS application. Siemens TC35 GSM module has been used as a SMS receiver and is connected with MCU PIC16F877A to process the SMS. MCU is connected to dual H-bridge Motor Driver L293D IC in order to control the speed of the motor where PWM method is used. The hardware is developed and practically the process is successfully achieved.


Introduction
Motors are normally used for industrial control, automation and home electrical appliance.It spans everything from residential washing machines, fans, hand-held power tools, automotive window lift, traction control system, industrial drives and many more.Motor application is not completed without a control system.The inventions of microprocessor and microcontroller make the control system become easier.This control system is basically controlling the switch, speed, and direction of motor.Control signal is generated by a switch that is connected directly to the control circuit.In order to control and monitor the motor, user need to be at the place where the switch is located.In this system, mobile phone is used as a control switch.By sending text message using short message service (SMS) which is a part of the Global System for Mobile Communications (GSM), control signal is sent wirelessly to the control circuit.By implementing GSM module on the control circuit of motor, it can enable the user to send text message that contain command from any mobile phone to that GSM module.The GSM module will receive the text command and send it to the microcontroller to be processed and converted into desired control signal.Controlling motor using SMS is really convenient and give mobility as the user is able to control and monitor the motor from anywhere as long as the places have coverage.Moreover, sending text message is considered very low cost and most of people have their own mobile phones and it already becomes one of the basic needs in life.

Related Work
With the popularity of GSM network, GSM terminal equipment is not only used in traditional voice communications, but also be applied in control area more and more widely.It shows some typical GSM-based applications and Siemens's cellular engine TC35 are introduced.SMS-based remote control systems are discussed thoroughly in [1], as well as the hardware and software.The developed system makes use of advanced MCU and GSM technique but the cost is low.It can be used in remote access-control and security with a good value of applications.
One of GSM-based applications is to control the climate perimeter of a greenhouse [2].The main purpose of the system conception is to control of the climatic parameters that influence the production in greenhouse, such as temperature, relative humidity of air and soil moisture.In their system, with a simple message, all farmers can control their greenhouses from a distance.They can monitor the status of their greenhouse climate at any time for temperature and humidity reading and can control actuators to adjust certain parameters such as fan, heater and vent.
GSM SMS remote appliance control system based on Field-Programmable Gate Array (FPGA) has been developed by [3].It mainly designs a remote appliance control system using the GSM SMS to finally achieve the dual-mode control of phone and SMS control, which makes the remote appliance control system more perfect.As the control core, FPGA enables the system to be nimble to dispose and have an extended function.The main work completed in [3] include hardware module design (GSM SMS module, RS232 interface module, and the temperature monitor module), FPGA logic design, and system board-level verification.The testing result indicates that the designed long-distance electrical control system meets the designing goal and has application potential software for the local acquisition, monitoring with PC and storage of all data through the card PCL-812PG.
A system to control and monitor electric circuitry through SMS using a microcontroller has also been developed by [4].This system used PIC 16F877A microcontroller remotely which perform all functions of the system.Standard Attention Commands are used to control the operation on SMS in the mobile phone.SMS is produced using the concept of Protocol Data Unit.[4] suggests that the system can be used for many applications such as remote sensing of meteorological information and vehicle security system with location finder.
A system based on GSM network was introduced where the power earth lines status can be reliably monitor [5].Using SMS resource of grip GSM, monitor network is achieved of data remote transmission.That system is composed of monitor center with intelligent power earth lines instruments.Data transmission theory and SMS of GSM being analysis, the design of intelligent earth line monitor instrument was discussed in detail.The instrument consists of hardware design and software design.Hardware design is composed of microcontroller 89-C2051 system, GSM data transmission mode, earth line status monitor circuit, read card unit of IC (identification card) and memory card.By using serial communication control G100A SMS mode, data wireless transmission can be performed.Software design includes communication protocol and the design of transmission and receiving program.The result and application shows that the design of the system can meet the user requirements.[5] claim that the system will be widely applied in many fields and has a huge economic value.
A cost effective but yet flexible, adaptable, and secure home automation has been developed by [6].The design and prototype implementation of a basic home automation system is based on SMS technology.The proposed system consists of two main components: First is the GSM modem which is the communication interface between the home automation system and the user.GSM modem uses SMS technology to exchange data, and signaling between users and home automation system; The second module is the microcontroller which is the core of the home automation system, and acts as the bridge between the GSM network (the user) and sensors and actuators of home automation system.Sensors and actuators are directly connected to hardware microcontroller through appropriate interface.The system that developed supports a wide range of home automation devices; power management components, security, multimedia applications, and telecommunication devices.The system security is based on user authentication of each SMS being exchange, as each SMS contains user name and password.[6] claim that user can easily configure home automation system setting through RS232 protocol using a user friendly interface.
Remote monitoring system based on SMS of GSM is presented by [7].Based on the total design of the system, the hardware and software of the system have been designed.GSM network is a medium for transmitting the remote signal.It includes two parts which are the monitoring center and the remote monitoring station.The monitoring center consists of a computer and a TC35 communication module of GSM.The computer and TC35 are connected by RS232.The remote monitoring station includes a TC35 communication module of GSM, a MSP430F149 MCU, a display unit, various sensors, data gathering and processing unit.The software of the monitoring center and the remote monitoring station are designed by using VB.The result of [7] demonstration shows that the system can monitor and control the remote communication between the monitoring center and the remote monitoring station, while the remote monitoring function is realized.
An automobile remote alarm system based on GSM communication network is introduced by [8].The TC35 GSM module and microcontroller are combined with the system vibration sensor and speed sensor which are used to achieve short message service (SMS) alarm and dual theft-proof of automobile.The shortcoming of traditional systems including low security and small alarming range is overcome and the cost of system is cut down.

DC Motor Speed Control
Generally the rotational speed of DC motor is proportional to the applied voltage, and the torque is proportional to the current.Speed control can be achieved by variable voltage source, resistors or electronic controls.The direction of a wound field DC motor can be changed by reversing either the field or armature connections but not both.This is commonly done with a special set of contactors (direction contactors).
Effective voltage can be varied by inserting a series resistor or by an electronically-controlled switching device made of thyristors, transistors, or, historically, mercury arc rectifiers.In a circuit known as a chopper, the average voltage applied to the motor is varied by switching the supply voltage very rapidly.As the "on" to "off" ratio is varied to alter the average applied voltage, the speed of the motor varies.

AT Command
AT commands are instructions used to control a modem.AT is the abbreviation of attention.Every command line starts with "AT" or "at" is the prefix that informs the modem about the start of a command line.That's why modem commands are called AT commands.The exact usage of the term AT command set slightly varies between manufacturers, often subject to marketing blurbs.In general, it can be assumed that a modem with an AT command set uses commands mostly starting with AT, uses the original Hayes way of separating data and commands, and supports the original Hayes commands and register settings as a subset.Figure 1 and Figure 2 show the simulation of sending and receiving SMS. Line 1: AT is send to GSM Module to test connection.GSM will reply OK (Line 2) if connection is successful. Line 3: AT + CMGF = 1 is send to set the GSM in SMS text mode.GSM will reply OK if it support SMS text mode. Line 5: AT + CSCA = +60,193,900,000 is command to set the network provider service center number.
GSM will reply OK (Line 6) to indicate that the service center number is stored. Line 7: AT + CMGS = +60,195,309,718 is command to set the recipient number.GSM will reply > and we can start typing message with ending by pressing CTRL + Z (➜) from keyboard.GSM will reply OK (Line 8) to indicate message is sent. Line 1: AT is send to GSM Module to test connection.GSM will reply OK (Line 2) if connection is successful. Line 3: AT + CMGF = 1 is send to set the GSM in SMS text mode.GSM will reply OK if it support SMS text mode. Line 5: AT + CMGF = 1 is a command to check the SMS in SIM at Location 1. GSM will reply with the message and OK (Line 7).

System Design Explanation
In this paper, user will send an SMS of desired motor speed in rotations per minute RPM format to the GSM Module.The GSM module will receive the SMS.MCU PIC16F877A will request the data from the GSM Module and process the speed.The speed send by user will be process and convert to suitable duty cycle for PWM pulse so that the output voltage of 12 V power supply can produce the desired motor speed.When switch is turned on the DC motor will run on 50% of duty cycle.The MCU is programmed to continue send an AT command to the GSM Module to check for message in the SIM every 5 second in the Location 1.If message is received, the program will go to the next step.The next step is MCU will receive the SMS, extract the speed and change it to a suitable duty cycle for the PWM.After that PWM pulse that produced will control the motor drive L293D to produce suitable voltage to be supplied to the motor so that desired speed is achieved.After completing this step, the MCU will send an AT command to delete the message in the Location 1 of the GSM Module and loop back to the first step.Figure 3 shows the flow chart of the program.

Siemens TC35 GSM Module
By using TC35 GSM module, as the SMS receiver, AT command is used to control the function of this GSM module.Logic Converter LC04A is used to connect TC35 with MCU.

MCU PIC16F877A
The GSM module will be interfaced using PIC16F877A.This MCU will process the SMS received from the GSM module and convert it to suitable duty cycle for PWM pulse to control the speed of the DC motor.

Motor Driver
Dual H-bridge Motor Driver L293D IC will be used as a motor driver to control the DC motor speed and direction.Simulation is done to test the receiving of SMS command and converting it to control signal where in this simulation the GSM module will receive SMS command from user to control an LED.User will send either ON or OFF.LED will switch on when user send SMS with content ON to the GSM and will turn off when users send SMS with content OFF.The MCU first initialize the GSM.After that MCU will start to send AT command to check SMS on the GSM module every 5 seconds.Figure 4 and Figure 5 illustrate the process of MCU signal to the motor.

Simulation Result
From Figure 4 and Figure 5 the function of the code is tested.Desired RPM value is sent to the GSM and processed by the MCU.By typing (-) in SMS the motor reverse its direction, and forward and reverse mode can be seen by altering IN1 and IN2 (pin 2 and 7).

Experiment on Duty Cycle and RPM Value Relationship
The relationship between duty cycle and RPM is experimented on SK40C development board.Table 1 shows the result of the experiment.The significant of this experiment is to check the value of duty cycle for particular RPM.The duty cycle will be used in the code in order to send the correct signal to the motor to run on desired speed.
The duty cycle are described in 10-bit in the microcontroller.In the coding it is written in decimal which is 0 to 1023.50 percent duty cycle will be equal to 512 in the code and 100 percent duty cycle will be equal to 1023.
The speed that can be requested by user to the system is based on the speed that has been pre-set.In this paper the speed is set from 1200 RPM until 2340 RPM.Code of Figure 6 shows how the RPM is set.RPM sent by user will be compared with the pre-set RPM and the duty cycle for that particular speed which is taken from the experiment is set to get the suitable PWM output.Figure 6 shows the schematic diagram and the complete hardware circuit of the system.

Figure 4 .
Figure 4. RPM send to GSM in forward mode.

Figure 5 .
Figure 5. RPM send to GSM in reverse mode.
Simulation is done by Proteus to test the functionality of the GSM module.The circuit is designed on Proteus for simulation GSM module was connected to laptop using RS232 serial to USB cable.Proteus has component called COM Port Physical Interface Model (COMPIM) where user can simulate the COM port.It enables the "physical" serial port of laptop to be available for simulation within Proteus.With this component it can connect any of the "virtual" components found in Proteus with laptop Serial port.In other word this model connects with physical world (GSM Module) with the Proteus-Virtual-World.