Prceeding f Ocean, Mechanical and Aerspace -Science and Engineering-, Vl.3 Nvember 7, 2016 Design, Mdelling and Applicatin f Micrcntrller (MCU) n Marine Tanks a) Malaysian Maritime Academy, Melaka, Malaysia Ramesh Babu Amathalai, a,* *Crrespnding authr: rameshb.amathalai@alam.edu.my Paper Histry Received: 25-September-2016 Received in revised frm: 30-Octber-2016 Accepted: 7-Nvember-2016 N PDLP PIC RISC UMS Nrmal Level Plastic Dual In line Package Peripheral Interface Cntrller Reduced Instructin Set Cmputing Unattended Machinery Space ABSTRACT Large cmmercial ships used fr transprtatin f liquid carg are prvided with many tanks fr strage f liquid carg during vyage. The carg lading and unlading prcess requires clse mnitring f the liquid level in these tanks t prevent verflw r spillage. In mst ships the liquid level sensing f these tanks is still perfrmed either manually r with the help very rudimentary analg devices which apart frm being less accurate are als unreliable giving false readings and ften cause f accidents frm carg spill. In this paper the authr prpses a simple lw-priced micrcntrller unit design fr tank liquid level mnitring and cntrl. The prpsed design has been simulated using the Prteus sftware and then later implemented and prttype tested in the hardware mdels. The prgram was cmpiled in PIC C Cmpilers, and prgrammed int the micrcntrller using a prgrammer fr PIC 8-bit micrcntrllers. The prpsed micrcntrller functined well during simulatin and prttype testing. KEY WORDS: PIC micrcntrller, Tank Cntrls, MCU MENCLATURE CPU F L LED LL MCU Central Prcessing Unit Full Level Lw Level Light Emitting Dide Lw Lw Level Micrcntrllers 1.0 INTRODUCTION Unattended Machinery Space, r UMS is a new cncept f perating ships machinery and auxiliary services thrugh the applicatin f digital sftware driven autmatin and mnitring system. The implementatin f UMS in ship peratin brings in many changes in the seaging engineer's cnventinal watch keeping duty and requires him t acquire additinal knwledge and skill in peratins management and ship safety. The UMS als brings nbard many sphisticated hardware and sftware with ptential t perfrm additinal functins, such as machinery cnditin mnitring, mdernized maintenance management and data lgging. Numerus parameters like pressure, psitin f vessel, temperatures, level, flw cntrl, trque cntrl, viscsity, speed, current, vltage, equipment psitin (pen / clsed) and machines status (n / ff) which are recrded manually in cnventinal ships are nw easily mnitred and aut lgged in UMS system [1]. 1.1 Develpments f micrcntrller based systems This sectin describes research wrk f sme authrs cnducted fr the cntrl and mnitring f prcess parameters f a few land based plants using micrcntrllers. The schematics arrangement f cntrl and mnitring the water level and temperature f sme industrial prcess has been discussed in reference [2]. The system mnitrs all parameters remtely and thereby the user culd save their scarce time as well as perating cst. In anther similar design using a micrcntrller based system embedded n ven has been prpsed in reference [3] t mnitr and autmatically cntrl the temperature f an ven autmatically. A similar paper [4] shws the imprvement f water level 207 Published by Internatinal Sciety f Ocean, Mechanical and Aerspace Scientists and Engineers
Prceeding f Ocean, Mechanical and Aerspace -Science and Engineering-, Vl.3 Nvember 7, 2016 bserving framewrk with an incrpratin f GSM mdule t cautin the individual in-cntrl thrugh Shrt Message Service (SMS). The water level is bserved and its infrmatin sent thrugh SMS t the prpsed expert mbile telephne after achieving the basic level. Anther similar paper presents the develpment f water level mnitring system with an integratin f GSM mdule t alert the persn-in-charge thrugh Shrt Message Service (SMS). The water level is mnitred and its data sent thrugh SMS t the intended technician mbile s phne upn reaching the critical level [5]. (5) Sensrs that is installed t the main tanks (6) Mtr that will be activated when needed, (7) Relay which will be used t cntrl the Mtr and the Buzzer. Figure 1 shws the schematic diagram f the system design. 1.2 Current System Existing Autmatin and Cntrls systems which regulate varius functins f the vessel peratin such as the pwer plant peratin, pwer administratin f the auxiliary engines, carg lading and unlading vyage rute mnitring, are f analg design with little r n flexibility t make adjustments fr any changes in ship s peratin. Because f this restrictin, mst f the tanks n the vessels are still being cntrlled and mnitred manually by using analgue switches. The majrity f tanks level cntrl are still nt fully autmated and being mnitred manually thrugh limit r flat switches t activate r deactivate the pumps r mtrs n bard. In this paper authr prpses a simple, lw cst, cnfigurable, easy t perate micrcntrller fr use nbard merchant ships t cntrl and mnitr liquid level in tanks. 2.0 METHODOLOGY In this design, level sensrs are attached t the main tank and a micrcntrller will cnstantly bserve the main tank liquid levels. Sensrs act as switches t cmplete the circuits, and eventually the MCU will then decide n the next curse f actin. Warnings will then be triggered by the MCU thrugh its prts and ultimately will activate the external peripherals that it is attached t. This warning culd be sme cmbinatins f LEDs and buzzers. LEDs which serve as display are installed n the panel bards. The verall cntrl system is realized by using less number f cmpnents and it gives great perfrmance with dense sized and lw price MCU. If the liquid level in the main tank gets lwer the mtr will autmatically activate and pumps the liquid frm the reservir tank. The mtr will be cntrlled by the MCU thrugh a relay [5]. 2.1 Cmpnent The prpsed cntrller system cmprises f fllwing main cmpnents. (1) PIC16F84A, this Micrcntrller cme with nly 18-pins. The Plastic Dual In line Package (PDLP) that wuld perfrm as the brain f the system, (2) 4N25 Optcupler t be used t safeguard the micrcntrller frm electricity ver supplies (3) light emitting dides (LEDs) t turn as visual respnse (4) Buzzer which functin as the hearing respnse aids, Figure 1: Simplified Schematic diagram 2.2 Operatins The peratin f the cntrller is described belw: When liquid reaches Full (F) level in the main tank, all LED F, N, L and LL will be ON, the Alarm will be triggered, and Alarm t be at halt. When the level is at Nrmal (N) psitin, LED N, L & LL will be light up, the Alarm and the Mtr will be OFF. When the liquid level is sensed by the sensr at the Lw level (L) psitin, nly LED L and LL will be ON, the mtr will be ON until the level f the main tank reaches Nrmal (N) psitin. When the liquid level reaches Lw Level (LL), nly LED LL will be ON, the Alarm will be triggered and the Mtr will keep n pumping. When the liquid level is lw in the reserve tank, the MCU will turn OFF pumping mtr. This is t prevent the damage t the mtr. Table 1, shws the simplified lgic f the whle peratins. Res Tank A0 Input Prts S1 S2 S3 Table 1: Truth Table S4 LL L Output Prts N F Alarm Mtr A1 A2 A3 A4 B0 B1 B2 B3 B4 B5 1 0 0 0 0 ON OFF OFF OFF ON ON 1 1 0 0 0 ON OFF OFF OFF ON ON 1 1 1 0 0 ON ON OFF OFF OFF ON 1 1 1 1 0 ON ON ON OFF OFF OFF 1 1 1 1 1 ON ON ON ON ON OFF 2.3 Micrcntrllers PIC16F84A [6], Figure 2, has been used fr this system. This MCU is the brain f the system and it has the ability t functin withut ther sphisticated mdules t be attached. PIC is a family f reduced instructin set cmputing (RISC) micrcntrllers manufactured by the Micrchip Technlgy which is resultant frm the PIC1650 that is frmerly develped 208 Published by Internatinal Sciety f Ocean, Mechanical and Aerspace Scientists and Engineers
Prceeding f Ocean, Mechanical and Aerspace -Science and Engineering-, Vl.3 Nvember 7, 2016 by General Instrument's Micrelectrnics Divisin. PIC is the integrated circuit which is frequently used t develp in cntrlling exterir devices and lightening the lad frm the main CPU in the system. Matched t a human being, the main CPU act as a brain and the PIC is same t ur autnmic nervus system. Hence, it is recmmended that 8-bit PIC16F84A micrcntrller which is sufficient enugh t act as the central cntrl f the system. START Sense Liquid Exist in Reserve tank Reserve tank Empty? Sense Liquid Exist in Main tank Display LED MCU decisin based n the input (5 Sensrs) Figure 2 : PIC16F84A Micrcntrller Pin assignment (PDLP) 2.4 Sftware The ''C cmpiler fr the PIC MCU,'' is utilized fr cmpsing [7], editing, cmpiling, and prgramming the cdes fr the micrcntrller. These cmpiler, which empwers the micrcntrller t be custmized in high level prgramming languages, tgether with PicKit2 prgrammer. The algrithm f the cdes will decide the state f the parts by actuating the micrcntrllers input - utput prts taking int accunt the particular tasks. The fundamental capability f the entire system is t allw a timed with micr-secnds interim, t acknwledge the sensr inputs, and t activate the utputs with enacting the Alarm r the Mtr. 2.5 Prgramming Descriptin The prgram used t regulate the entire prcess is embedded in PIC16F84A micrcntrller s C language. All the cdes have been cmpiled and tested using CCS cmpilers. 2.6 System Flw This system wrks in sensing the level f liquid frm the main tank, sensrs which are attached t the tank will then sense the current level f the tank, and send the signal t the Micrcntrller Unit. The MCU then will intelligently decide n the next curse f actin, either activating the Mtr autmatically r triggering the Alarm t allw the persn in charge n the vessel t take further actin (Figure 3). MOTOR ON Critical Cnditins? Main tank reached the limit? STOP Figure 3: Flwchart f the system ALARM ON MOTOR OFF 2.7 Circuit The circuit have fur main elements: the pwer surce sectin, micrcntrller segment, which cmprises the system input parts, and the utput parts. All these mdules are integrated t the MCU unit. Figure 4 : Input & Outputs 209 Published by Internatinal Sciety f Ocean, Mechanical and Aerspace Scientists and Engineers
Prceeding f Ocean, Mechanical and Aerspace -Science and Engineering-, Vl.3 Nvember 7, 2016 As in figure 4, all the 5 input sensrs are cnnected using the Prt A, and all the utput f the system are cnnected using the Prt B including the display units (LEDs). A) f the micrcntrller while the utputs f the system were cnnected RB0 thrugh RB3 fr the display units (LEDs), and RB4 is cnnected t the alarm (figure 5), and finally the RB5 is used t cnnect t the AC Mtr relay (figure 6). All the utput pins are cnnected thrugh (Prt B) f the cntrller.. 4.0 CONCLUSIONS & RECOMMENDATIONS Figure 5 : Alarm Circuit Once the liquid in main tank reaches Full (F), r it is at the Lw lw Level (LL), the alarm will autmatically trigger by the MCU, t indicate an immediate attentin is needed by the crew f the vessel. The MCU will be cnnected t the Alarm thrugh a relay as in figure 5. In this paper, the authr presents the peratin f custmary liquid level cntrller. Besides, it is demnstrated t utilize a savvy I/O srt MCU as the part t a circuit fr liquid level detectin and cntrls. This circuit checked and cntrlled the liquid level f a tanks, and utilized LED fr signals. Frm the equipment circuit, nly few external peripherals are used. In additin, the MCU culd be reprgrammed t suit the regular regulatin changes n bard. Every ne f these cmpnents are cntrlled and intelligently decided by the PIC16F84A MCU. Thus, this prpsed system will ensure the ccupatinal safety n bard by minimizing the needs fr the crew t frequently mving t view the status f each tanks by themselves and the prtectin f the equipment r machines as well. This system culd further be imprved in near future. Upcming system culd be fcused n enhancing the visual aids, by integrating Liquid Crystal Display (LCD) t the system, allwing the crew t knw exactly the level f the liquid in the tanks and even allwing the crews t be alerted wirelessly thrugh a wireless mdule cnnected t the MCU, and mre similar applicatin cases culd be further explred. ACKWLEDGEMENTS The authr is grateful t Malaysia Maritime Academy @ Akademi Laut Malaysia (ALAM) fr supprting this article. Figure 6 : Filling Pump Circuit The filling pump r Mtr, will start autmatically when the liquid in main tank level yet t reach t sensr (S4), and eventually stpped autmatically when the sensrs in main tanks reaches t the desired level (Figure 6). 3.0 CIRCUIT DESIGN AND SIMULATION. The circuit was then replicated in the sftware Prteus v7.6. In this sftware, the entire cmpnents f the circuit which is essential were carefully chsen frm the sftware library and the cnnectins were dne by lines. The prgram was later cmpiled using CCS C cmpiler. The utput, hex file f the prgram is laded int PIC micrcntrller using the PicKit2. Finally, the simulatin is tested fr all the cnditins. The circuit used fr simulatin is given (figure 4). The cnnectin t the micrcntrller is separated int 3 parts f circuits. The inputs frm the sensrs were cnnected t RA0 till RA4 pins (using Prt REFERENCE 1. Grdn Maurice, Mdern Marine Engineer s Manual, 3rd Editin, Mar. Technl. SNAME News, vl. 40, n. 1, p. 9, 2003. 2. U. Abdullah and A. Ali, GSM Based Water level and Temperature Mnitring System, Int. J. Recent Dev. Eng. Technl., vl. 3, n. 2, pp. 1 7, 2014. 3. F. E. Idachaba, Design f Intel 8751 Micrcntrllerbased System fr Mnitring and Cntrl f a Thermal Prcess, IETE J. Res., vl. 56, n. 4, pp. 189 193, 2010. 4. A. Jhari, M. Helmy, A. Wahab, N. Suryani, A. Latif, M. E. Ayb, M. I. Ayb, and M. A. Ayb, Tank Water Level Mnitring System using GSM Netwrk, Int. J. Cmput. Sci. Inf. Technl., vl. 2, n. 3, pp. 1114 1120, 2011. 5. A. S. Lu, A Circuit fr Water Level Detectin and Cntrl, pp. 1 11. 6. Micrcntrller Chip Technlgy, PIC16F84A Datasheet, PIC16F84A Datasheet, 2016. [Online]. 210 Published by Internatinal Sciety f Ocean, Mechanical and Aerspace Scientists and Engineers
Prceeding f Ocean, Mechanical and Aerspace -Science and Engineering-, Vl.3 Nvember 7, 2016 Available: http://www.micrchip.cm/wwwprducts/en/pic16f84 A. [Accessed: 09-Jun-2016]. 7. C, Inc - Custm Cmputer Services Inc. [Online]. Available: http://www.ccsinf.cm/cntent.php?page=cmpilers. [Accessed: 01-Oct-2016]. 211 Published by Internatinal Sciety f Ocean, Mechanical and Aerspace Scientists and Engineers