Monitoring and Control of Multiple D.C Motors with Sensing of Temperature using Microcontroller Pic 16F877A

DOI : 10.17577/IJERTV5IS010571

Download Full-Text PDF Cite this Publication

Text Only Version

Monitoring and Control of Multiple D.C Motors with Sensing of Temperature using Microcontroller Pic 16F877A

Hafiz Waleed Qureshi Usman Razzaq

Department of Electrical Engineering 1,2 The islamia University of Bahawalpur, Pakistan

Muhammad Nadeem Muhammad Waseem

Department of Telecom Engineering 3 Department of Electrical Engineering 4 The islamia University of Bahawalpur, Pakistan

Abstract—Process industries in developing countries like Pakistan usually face the difficulty of manual operation resulting in inaccuracies and poor efficiencies. This paper emphasizes the automation of process industry while monitoring the variables at the same time. All the DC motors working at a place are being switched ON/OFF by a same electronic setup based on PIC 16F877A and switching device ULN2003 avoiding the difficulty of manly operations etc. Apart from this, temperature monitoring is also done by temperature sensor LM35 which is the main controlling variable in industrial environment. This software based research is done by the aiding tools PROTEOUS to show the results which can also be implemented on hardware models in any industry lacking automated mechanisms of controlling and monitoring.

Index Terms—PIC 16F877A, LM35, ULN2003, Switching, Logic Toggle.


    In the recent century, electrical motors became the core part of every industrial sector. Globally, every year more than 5 billion motors are building and put in use but among all D.C motors are most common because of their high starting torque features. To groom our industries, the enhancement of D.C motor is being done as such motors are of prime importance at industrial levels rather that at domestic applications [1].Some Developing countries are still using the manual methods to control such kind of motors which is surely an error generating and old technology too. To work in a better way it is surely important to use automatic mechanisms for controlling the motors thereby avoiding the public hazards and getting the exact controls of requisite device. Apart from controlling of motors, in past decades majority of countries use manual monitoring of temperature systems which becomes the cause of hazards for working labors. Industries working with different kinds of liquid for processing should employ the automatic mechanisms for the monitoring and controlling of their temperatures within a narrow limit.

    This paper suggests two systems; one of this is automatic switching of DC motors and other is monitoring of temperature of fluids or any material. Manually and automatic switching of DC motors is being done by relay driver circuit ULN2003 and Microcontroller PIC 16F877A. When it is desirable to switch off only a single motor while operating other motor at particular load without any kind of disturbance, it can be done by employing only a single circuitry of DC supply [2]. For a particular operation if all the industrial motors are to be run at same time, the PIC will send instructions to ULN2003 to accomplish this operation. Automating whole the motor controlling will allow the industries to switch off any of the motor from panel by only assembly of microcontroller and ULN2003. Temperature is the most basic parameter of any industry which is continually varying, so the main purpose is also to control and monitor the temperature by such instruments which work for switching ON/OFF the heat/cool mechanisms in no time. To accomplish this temperature monitoring and controlling PIC 16F877A in coordination with temperature sensor LM35 is being used. All the required values of temperature are being displayed at LCD in a control room by single user sitting on PC [3]. If the temperature is crossing the initial threshold, control mechanisms work to maintain it in narrow limits.

    1. PIC 16F877A Microcontroller

      PIC microcontroller is a microchip consisting of 40 pins. It comes in different packages but in this research PDIP package is used. Clock frequency given to its clock pin is 20 MHZ and operated input voltage is 5V DC. It consists of 5 I/O ports A, B, C, D and E. Port A is interfaced with the temperature sensor LM35 while the Pins of port B is interfaced with the ULN2003, Port D is further connected with LCD L016L [4]. As different microcontrollers have many applications but PIC 16F877A is used where the measurements of different parameters and controlling of any devices is necessary. Switching of DC motors can be easily controlled by command given by PIC to devices [5].

      Fig. 1: Pin Diagram of PIC 16F877A Microcontroller

    2. LM35 Temperature Sensor

    LM35 is a precise integrated temperature sensor. Basically, it consists of three pins output voltage pin Vout, source voltage pin and ground pin [6]. Output voltage Vout of this sensor varies in proportion with the temperature which is always measured in Centigrade [7]. As the LM35 sensor is calibrated in Centigrade rather than Kelvin so there is no need to perform calculations of given output to get the Centigrade scaling. Its operating voltages vary from 4V to 30V. It is available in different packages but LM35 T0-92- 100 transistor package is used in this research [8].


    In our research we are making the simulation design of automatic switching ON/OFF of DC motors and monitoring and control of temperature. To accomplish this we are going to use PROTEOUS professional v7.4 SP3 software. First, we design the schematics of DC motor switching leading to temperature monitoring and control and after this we made the simulation design of both switching of motors and temperature monitoring/control using single PIC16F87A microcontroller.


    Fig. 2: Complete System Block Diagram


    DC motors can be switched ON/OFF manually and automatically by using any control loop system. This paper proposes an idea to operate DC motors with our requirements by using PIC 16F877A with ULN2003 as shown in Fig.3 & Fig.4.

    Fig. 3: Block diagram of automatic ON/OFF DC motor

    Fig. 4: Block diagram of automatic ON/OFF DC motor

    1. Automatic switching of two DC Motors using ULN 2003 and one Relay

      Microchip ULN 2003 is the relay driver circuit consisting of seven NPN transistors in combination with diodes connected in fly-back order [9]. This arrangement provides the high current gain and high voltage such that each pair of transistor and diode provides current and voltage of 0.5A and 0.05 V respectively and also used for switching the inductive loads such as DC motors [10]. When the motor circuitry is completed by putting the relay in closed order, it will operate the motor depending upon the positions of manual operated switches. Depending upon the instruction by PIC microcontroller to the ULN2003 the logic toggle will either be HIGH (1) or LOW (0). If logic is 1 then relay circuit will operate and both motors will start to run and one of these motors can be turn off by operating their appropriate switch however logic remains HIGH as shown in Fig.5, if logic given to ULN2003 is LOW (0) then both motors will turn off despite of their corresponding switches are still closed as shown in Fig.6, If its mandatory to run the motor2 at half speed of its rated value then by closing the S3 switch motor will start to run at half speed and direction of motor2 will be reversed[11]. Current and voltage specification of both motors can be observed by voltmeter and ammeter.

      Fig. 5: Schematic diagram of ON/OFF DC MOTOR when logic toggle is HIGH/ (1)

      Fig. 6: Schematic diagram of ON/OFF DC MOTOR when logic toggle is LOW/ (0)

    2. Automatic switching of two DC motors using ULN 2003 and Two Relays

    When two DC motors are connected separately with two relays and common power source then they can operate individually by using two logic toggles and two relays. If machine operator wants to turn ON motor 1 then PIC will send the instructions to logic toggle 1 and relay attached to circuit of motor1 will close and particular motor will start to run at its rated speed. Motor2 will never start running

    until logic toggle 2 turn to be HIGH (1) and so relay circuit of motor 2 remains open and motor2 will remain stationary. When it is desired to turn ON the motor 2 then PIC 16F877A will give the instructions of HIGH/ (1) to logic toggle 2 and relay will automatically close for the circuit of motor2 and it will start running until manually switch of S2 opened or automatically PIC gives the zero command to ULN2003 [12]

    Fig. 7: Schematic diagram of ON/OFF DC MOTOR when both logic toggles are HIGH/ (1)

    Fig. 8: Schematic diagram of ON/OFF DC MOTOR when logic toggle (1) is LOW/ (0) other is HIGH/ (1)

    Fig. 9: Schematic diagram of ON/OFF DC MOTOR when logic toggle (1) is HIGH/ (1) other is LOW/ (0)

    Fig. 10: Schematic diagram of ON/OFF DC MOTOR when both logic toggles are LOW/ (0)

    Table 1: ON/OFF Two DC Motors using Two Logic Toggles

    Logic Toggle (1)

    Logic Toggle (2)

    Motor (1)




















    To sense the temperature of material or any liquid LM35 temperature sensor is used which can sense the temperature from -55oC to 150oC. LM35 sensor basically consists of three pins output voltage pin, source voltage pin and ground pin. Vout of LM35 is interfaced with PIC 16F877A by PORT A which is bidirectional port. Power supply is

    connected to the master clear pin of PIC 16F877A. A combination of transistor, diode and relay is used to automatically switch ON/OFF the heat/cool mechanism when temperature of material exceeds by threshold limit. LCD L016L is interfaced with Microcontroller with PORT D which is bidirectional I/O parallel slave port. When temperature of material is increasing or decreasing it can be easily monitored by the operator in control room at single location.

    Fig. 11: Block Diagram of Temperature Sensing and Monitoring System

    Fig. 12: Schematic diagram of Temperature sensing and monitoring system


    PIC microcontroller is interfaced with temperature sensing system and DC motors ON/OFF mechanism. Temperature sensor LM35 measures the temperature and depicts all the results on liquid crystal display by the instructions given to PIC microcontroller [13].Single microcontroller is used to accomplish the two tasks that is monitoring of temperature while at the same time switching of motors is being done as shown in Fig.13. When it is desirable to turn ON the motor 1, microcontroller sends the logic command HIGH (1) to logic toggle 1 which is LOW (0) otherwise. Similarly motor2 could be ON/OFF by giving the instructions HIGH or LOW respectively to logic toggle2 and vice-versa.

    Fig. 13: Schematic Diagram of combine Temperature Monitoring and automatic DC motors ON/OFF System


Manual operation of industrial appliances always results in disturbing the accuracy of the system. To adopt the flawless system with good efficiency and better working, automated devices need to be worked in a standard manner. This paper mainly highlights the kind of automatic mechanisms comprising of switching of DC motors working in industrial environments. All the DC motors working can be switched ON/OFF by only interfacing of microcontroller PIC 16F877A with all the motors via ULN 2003 a well-known switching device. Programmable controller works on the commands loaded controls the operation of motors working. Apart from only switching, same system is allowed to sense the temperature of any kind of liquid working in chemical environment. Temperature is sensed by the LM35 sensor which is then monitored on the LCD. The whole of the system works to bring about the two objectives viz switching and temperature monitoring.


  1. Paul, A. R., & George, P. M. Brushless DC motor control using digital PWM technique. Proceedings of 2011 International Conference on Signal Processing, Communication, Computing and Network Technologies (ICSCCN 2011) ,pp. 733-738.

  2. Jilani, A., Murawwat, S., & Jilani, S. O. Controlling speed of dc motor with fuzzy controller in comparison with ANFIS controller. Intelligent Control and Automation, 2015, pp. 64-74.

  3. Thaw, E. E., & Htun, M. M. Design and implementation of motor speed control and temperature sensing unit using PIC controller. International Journal of Scientific Research Engineering & Technology (IJSRET), Vol.3, Issue 2, ISSN 2278-0882, 2014, pp.167-170.

  4. Karuppiah, T., Sivasankaran, V., Periasamy, D. A., &Muruganand,

    D. S. Embedded system based industrial power plant boiler automation using GSM technology International Journal of Advance Research in Computer and Communication Engineering, Vol.2, Issue.8,2013, pp. 3321-3325.

  5. Singh, H. P. Microcontroller based stepper motor derive for an elevator system. International Journal for Research in Technological Studies, Vol. 1, Issue 8, 2014, pp. 36-39.

  6. Wellem, T., & Setiawan, B.A microcontroller-based room temperature monitoring system. International Journal of Computer Applications (0975-8887), Vol. 53-No.1, September 2012, pp. 7-10.

  7. Balraj, A., Patvardhan, A., Renuka, D. V., Aiswarya, R., & Prasen, V.Embedded temperature monitoring and control unit. International Conference on Recent Trends in Information, Telecommunication and Computing, IEEE, 2010,pp.293-297.

  8. Oo, W. T., & Tun, H. M. Design and construction of condition reporting system based on GSM technology for power station. International Journal of Scientific and Research publications, Vol. 4

    , Issue 6, ISSN 2250-3153, 2014,pp. 1-7.

  9. Mynuddin, M., Hossain, M. A., &Chowdury, A. R.Process control using microcontroller. International Journal of Modern Embedded System (IJMES) Vol. 2, Issue no.5, ISSN, 2320-9003, 2014, pp.26- 30.

  10. Soe, T. T., Lwin, K. S., Naing, Z. M., & Khaing, A. S. Design and development of microcontroller based air conditioning system. International Journal of Scientific Engineering and Technology Research (IJSETR), Vol.3, Issue-10, 2014, pp. 2000-2004.

  11. Shrivastava, S., Rawat, J., & Agarwal, A. Controlling DC motor using microcontroller (PIC16F72) with PWM. International Journal of Engineering Research, Vol. 1, Issue.2, 2012, pp. 45-47.

  12. Dawood, S. M., & Thejeel, R. H. Pic 16F877A microcontroller based multiple DC motors controller. Asian Transactions on Engineering (ATE, ISSN: 2221-4267), Vol. 3, Issue.2, 2013 pp.7-17.

  13. Amoo, A. L., Guda, H. A., & Soh, T. L. Design and implementation of a room temperature control system: Microcontroller based. IEEE, 2014.

Leave a Reply