TELKOM NIKA Indonesia n  Journal of  Electrical En gineering   Vol.12, No.1, Jan uary 20 14 , pp. 371 ~ 3 7 8   DOI: http://dx.doi.org/10.11591/telkomni ka.v12i1.4140            371     Re cei v ed  Jun e  25, 2013; Revi sed Aug u st  25, 2013; Accepted Sept em ber 19, 20 13   Design of a Subsequent Water Detection System  Controlled by the Microcontroller      Chu Yan*, T a ng Ka ng, Feng Xiaoming, Cai Xin y u a n, Chen Pe ngju  T he Institute of Electronic a n d  Control En gin eeri ng Ch an g’a n  Univ ersit y Xi ’an, Ch ina    *Corres p o ndi n g  author, e-ma i l y a nchu @chd .edu.cn, hp blu e s@vip. qq.co m       A b st r a ct   This article inst ructs the subse quent water detection  system   design and implem entation  of sanitary   w a re. T h is system use d  C8 051f0 40 Micro c ontrol l er  as the main co ntrol modu le a n d  communic a ti o n   mo du le w h ic control l ed  t he  oper ation  of th e entir e syste m touch  scre en as  a  positi on  mac h i n e and  ma de  use  of  meta prob in techni qu e a n d  w e igh i ng  se n s or tech nol ogy  to re ali z e   dat a test, col l ecti on ,   displ a y, storag e an d exp o rt. At last the experim ental r e s u lts showed that  this system   m e ets the ex pect ed  requ ire m e n t an d can  meas ure  the subse que nt w a ter more  accurate ly.    Ke y w ords : Au tomatic c ontrol ,  Subseq uent  w a ter, Meta l probi ng tech niq ue, T ouch scr een, C8 05 1f04 0   Microcontr o ll er         Copy right  ©  2014 In stitu t e o f  Ad van ced  En g i n eerin g and  Scien ce. All  rig h t s reser ve d .       1. Introduc tion  As pe ople’ s li ving stan da rd  improve d , sa nitary ware  is take n serio u sly, and th e q uality of  the produ cts is g e tting m o re  and  more peo ple’ s at tention. As  a n  impo rtant  cla s s of sani tary  quality indi ca tors,  rin s e f unctio n  resp onse it s flu s hing  cap a cit y  and effe ctiveness di re ctly.  Therefore, it has be com e  very  important to detect the subseq uent wate r a c curately in the  pro c e ss  of the manufa c ture and d o ing rese arch o n  sanitary cera m i cs [1]. He re,  the sub s e que nt  water refers t o  the  wate r f o llowed afte whe n  the  sim u lation o b je cts p a ss th rou gh the  outlet  of  the toilet. It keep s the sewage pip e line  achi eving se lf-cle anin g  by flushi ng the  si mulation o b je cts  into the stan dpipe via the  socket pip e  and t he conn ecting pi pe, and u s ing th e displa ce me nt  water to  seal  water at the  same time wit hout the make-up  wate r.   In orde r to d e tect whethe r the sa nitary  ware  is i n  a c cordan ce  wit h  indu strial  st anda rds   (refe r to E N 9 77-2 012 ) m o re a ccu rately,  more  pr acti ca lly and mo re  simply, this p aper devel op ed  an sub s equ e n t water  det ection  syste m  usin g on  sanita ry ware, which took th e con t rol  techn o logy b a se d on  C8 051F0 40 mi crocontroller  a s  the  co re,  and b a sed o n  an inte grat ed  measurement  includin g  me tal detection tech nolo g y,  sensor technol ogy. It’s an effective syste m   on dete c ting  yield of the subsequ ent water [2].      2. The Basic  Idea of Sy stem Design   If we put four simulatio n  o b ject s in the  toilet, the system sho u ld b e  able to a ccurately  detect wheth e r the obj ect s  are wa sh e d  away o r  n o t, and se nd  a sign al to the main con t rol  system  wh en  flushin g  the  toilet. When t he obj ect s  a r e wa sh ed a w ay totally, the system  sh ou ld   be ca pabl e of colle cting th e finalvalue o f  the sub s e q u ent wate r, an d displ a y it on the termin al . In   con s id eratio n  of the s re q u irem ents, th e overall fr a m ewo r k of th e de sig n  in  th is p ape r i s   sh own  in Figure 1.  The si mulatio n  obje c ts d e tection m odul e is mai n ly co mposed of ferroma gneti c  coils, an d   it sampl e s th e mag netic fi eld chan ge whe n  the  si mulation  obje c ts  (withi n a  metal rin g p a ss  throug h the   coil. Th wei ghing  mod u l e  is mainly f o rme d  by  weig hing  se n s or,  whi c h  can   accurately de tect the cha n ges of water  yield [3]. The master  cont rol module ta king C8 051F 0 4 0   as the core,  is use d  for signal a nd  data pro c e ssing. The co mmuni cation  module an d  the   intera ctive in terface, m a in ly to complet e  t he data p r ocessin g  an d display, are made  up  of  C80 51F0 40  and a touch scree n . As shown in Figu re 2, whe n  the system det ects a  simula tion  obje c t, the co unter pl us  1, and it can b e  judge a s  th e last  simulat i on washed a w ay when th cou n ter is 4. At this time, t he  weig hing   module   read s the  wate r lev e l, and  dete r mines wheth e r it  Evaluation Warning : The document was created with Spire.PDF for Python.
                         ISSN: 2302 -4046          TELKOM NIKA  Vol. 12, No . 1, Janua ry 2014:  371 – 3 7 8   372 is stabl e. If stability, then  it read s the sub s e que nt water valu and di splay the re sult on  the  terminal.           Figure 1. The  overall frame w ork of the system           Figure 2. System Dete ct Proce ss      3. Sy stem Modules Desi gn  3.1. The Desi gn of Simulation Objec t Detec t ion M odule   3.1.1 The Ch oice of Simulation Objec t Based  on  th e 6 lite r s of  water toilet  system evalu a t ion metho d s in a c cordan ce  with  DIN  stand ard,  we  sele ct a sta ndard te st  sp ecime n  a s  the stimula n t-A r tificial casi ng s (T ubula r)  with   metal Inducti ve loop, filled with water a nd cove red  with bate. Then tie it into  three sectio ns  with  a length  of 1 60mm a nd a   diamete r  of 2 5 mm. Each test u s e s  4 te st sp eci m en s to simul a te shit  excrete d  by a  person  ea ch  time. This  sp ecime n  with  a  good  simul a tion feature no t only can truly  Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046       De sign of a Subsequ ent Water Dete ctio n System  Co ntrolled b y  th e Microcontro ller (Chu Yan )   373 evaluate the  flushing  sm oothne ss of a toilet  su pportin g  sy stems, but al so can  be u s ed   repe atedly [4].   The  si ze  and  sh ape  of  stand ard   spe c imen  a r e  sh own  in  Figu re 3.Th e n u m ber 1-10  each in turn repre s e n ts 3 7   ml wate r, artificial  ca sing s, the tied ho rizontal  plan e, linen thread, t h e   hori z ontal pl a ne witho u t tied, "O"-ring s, metal  ring s (b lows), "O"-rin g s, and the li nen thre ad.         Figure 3. Standard sp eci m en si ze an d shape       3.1.2. Dete cti on Coil Wou nd  Simulation o b ject s dete c tion mod u le  mainly co nsi s ts of ferro m agneti c  coi l s whi c inclu de  an  excitation  coil  a nd two d e tect ion  coil s. Wh en the  mimeti c p a sse s  th ro ugh th e inte ri or  of coil with flush  water, th e metal ring  in the  mimetic ca uses  slig ht magnetic f i eld variation s Then with a sign al  am plifier,  the mime tic  dete c tion  module   can captu r th e sign al  reflecti ng  cha nge s in the magn etic field [5]. Geometry of t he  coil is sho w n  in Figure 4. In this sectio nal  view, the gra y  part is the wou nd, and t he white p a rt is a hollo w cy linder.           Figure 4.Geo m etry of the coil  Evaluation Warning : The document was created with Spire.PDF for Python.
                         ISSN: 2302 -4046          TELKOM NIKA  Vol. 12, No . 1, Janua ry 2014:  371 – 3 7 8   374 The se nsi ng  coil in Figu re  4 is made of  enamel ed c o pper s with a  diamete r  of 0.5 mm.It  is Singl e laye winde d o n   a cylin dri c al  Plexiglas,  with 50  turns of  excitation  co il, and  26 tu rns  each of two  detection  coils. In these pro c e s se s, the key is  to ensu r e th e uniformity  and   s y mmetry relative  to  the exc i tation c o il  of  t he two  detectio n   coil s a s  fa r a s   possibl e[6].The  detectin g  circuit diagra m  is sho w n in Fig u re 5.           Figure 5. Det e cting  circuit diagram        3.2. The Des i gn of Weigh i ng Module   The  sub s eq u ent wate r i s   measured by  weig hing  se nso r , whi c converts the p r essu re  sign al gen era t ed by the su bse que nt wat e r into  a volta ge sig nal. Th en by amplifi c ation a nd A D C   pro c e ssi ng, t he value  of f o llow-up  water  can  be  re ad o u t. To  meet the  de sign  pe rform ance  requi rem ents,  accu ra cy of  the sen s o r   plays a   de ci sive role,  so  this d e si gn  sele cts the h i gh- pre c isi on stra in gauge  sen s or [7]. The sensor wor ks  as follows: it take s a full-bridge equ al arm  bridg e  a s  th e  ba sic ci rcuit, with th sen s itive  compo nents (a  resi stive foil  strai n  ga uge ) a s   the   bridg e  a r m which i s   stuck  on the metal  cantileve ela s tic surfa c e. Whe n   an external  fo rce  pl ays  on the elasti c body , chip resi stor subje c ted to  tensil e or com p re ssive strai n , and its re sista n ce   cha nge s,  wh ich  re sults i n  an  out-of-balan ce  on   the bri dge,  gene rating  a  co rrespon di ng   differential si gnal amplification circuit   for  su bseq uent  m easurement and  pro c e ssi ng  [ 8 ].  Weig hing mo dule ci rcuit diagra m  sh own  in Figure 6.   R1 51 K R2 1K R3 10 K R4 2K C1 1 10 n C1 2 10 n C1 3 10 00p C1 4 47 0p 接端 线 Q1 Q2 N2 2 2 2 L1 10 0uH C1 5 12 0p R6 10 K R7 10 K R8 10 K D1 41 48 D2 41 4 8 -- 2 + 3 V+ 4 V- 5 OU T 6 U1 LM 3 1 8 RV 1 10 K RV 2 1K R9 1K R5 1 功率 放大 +1 5 V 功率 放大 正弦 发电 -1 5 V 比路 电压 较电 波路 滤电 Q2 2S C 5 200 二放 大路 级电 一放 大路 级电 跟随 电压 峰波 值检 +1 5 V 去耦 C1 6 10 0pf XQ I N -- 2 + 3 V+ 7 V- 4 OU T 6 U2 OP 0 7 +1 5 V -1 5 V C1 0 0. 1u f XQ OU T C9 0. 1 u f D3 IN 6 0 C8 0. 1u f C7 0. 1u f C6 0. 1u f C1 7 0. 01 u f GN D - 15V +1 5 V -- 2 + 3 V+ 7 V- 4 OU T 6 U3 OP 0 7 +1 5 V -1 5 V C1 8 10 uf C5 0. 1u f R1 1 10 k C4 0. 1 u f C3 0. 1u f C2 0. 1u f C1 0. 1u f -- 2 + 3 V+ 7 V- 4 1 8 OU T 6 NC 5 U4 A D 6 20A N 1 2 3 JP 1 DY DZ 1 2 3 4 5 JP 2 XH DZ GN D R1 0 10 k JC X H KG X H XQ O U T R1 2 10 k XQ I N +1 5 V - 15V GN D -1 5 V +1 5 V -- 2 + 3 V+ 8 V- 4 OU T 1 U5 T L 082 R1 3 1k JC X H R1 4 62 k +1 5 V KG X H -1 5 V +1 5 V R1 8 15 k C1 9 0. 1u f R1 5 33 0k R1 6 33 0k RV 3 10 k C2 0 0. 1u f C2 1 15 00p f R1 7 4. 02 k -- 2 + 3 V+ 8 V- 4 OU T 1 U6 TL 0 8 2 -- 4 + 5 V+ 3 V- 12 O 2 U7 LM 3 3 9 C2 2 4. 7u f -1 5 V +1 5 V Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046       De sign of a Subsequ ent Water Dete ctio n System  Co ntrolled b y  th e Microcontro ller (Chu Yan )   375     Figure 6. Wei ghing mo dule  circuit diag ra     3.3. The Main Control Module and Communicati on Module   The fu nction   of the m a in  control  mod u le  is to  receive  and  p r ocess sig nal comi ng from  simulatio n  o b ject s d e tection mod u le , weig hing  se nsors a nd p o sition  machine.  Th e   comm uni cati on mod u le i s  u s ed to  conne ct the h u man - ma chin e interfa c with main  co ntrol  module. And  the two modu les u s e the C8051F 040 mi cro c o n troll e as the core d e vice [9].  The  C8 051f0 40 i s  a  fully i n tegrate d  mi xed-si gnal  System-on-Chi p  MCU,  with 6 4  digital   I/O pins  and  an integ r ated  CAN2.0B co ntrolle r. Its a d vantage s a r e listed  a s  fo llows:   with   high-sp eed  8051 mi crocontrolle r core and pi peli ned  a r chitect u re, mo st of the instruct ion   executio n time is one o r  two sy stem cl ock cycl es.   With 4K in ternal RAM a nd 64K FLAS H, it  can m eet the requi rem e nts for mem o ry sp ace s   i n  most de si gns  without  external me mory  device s a nd thus simplify system   de sig n   config ure a va riety of  port s su ch  as SPI, SM B u and UART.   su ppo rting  MODB US protocol, you  can  be ea sily  con n e c ted wi th  touch scre en  [10].  C80 51f04 0 can b e   code by assem b ly  l angu age  and  C l angu age,  the  system i s   cod e d   by the C lang uage, pa rt of the cod e  is a s  follows:     if(x[7]==0x01 )    // Single detection i s  com p leted   {             x [ 7 ] = 0 x 0 0 ;            ADC0 C N = 0 x 00;  water_la st1=(x[17]*256+x[ 16]);   if(wate r _la s t1 <water_l ast0 water_la st1=0;  else   {         water _ la st1= water _ la st1- water _ la st0;  temp1=wate r_last1* 2.74;           water_la st1=t e mp1/1;   w a t e r _ l a s t 1 = w a t e r _ l a s t 1 ;           -- 2 + 3 V+ 7 V- 4 1 8 OU T 6 NC 5 U1 A D 6 20A N R1 10 k +1 5 V - 15V -- 2 + 3 V+ 8 V- 4 OU T 1 U2 T L 082 R2 1k R3 50 k -1 5 V +1 5 V +1 5 V +1 5 V -- 2 + 3 V+ 7 V- 4 1 8 OU T 6 NC 5 U3 A D 6 20A N R4 10 k +1 5 V - 15V -- 2 + 3 V+ 8 V- 4 OU T 1 U4 T L 082 R5 1k R6 50 k -1 5 V +1 5 V +1 5 V +1 5 V -- 2 + 3 V+ 7 V- 4 1 8 OU T 6 NC 5 U5 AD 6 2 0 A N R7 10 k +1 5 V -1 5 V -- 2 + 3 V+ 8 V- 4 OU T 1 U6 TL 0 8 2 R8 1k R9 50 k - 15V +1 5 V -- 2 + 3 V+ 7 V- 4 OU T 6 U7 OP 0 7 R1 0 10 k R1 1 10 k R1 2 10 k R1 4 10 k R1 3 10 k +1 5 V -1 5 V CZ X H 1 - CZ X H 1 - CZ X H 3 - CZ X H 3 + CZ X H 1 + CZ X H 2 + CZ X H 2 + CZ X H 1 + CZ X H 3 + CZ X H 3 - CZ X H 2 - CZ X H 1 - C Z XH OUT +1 5 V -1 5 V GN D 1 2 3 4 5 6 7 8 J2 JX D Z GN D 一放 一放 一放 二放 二放 二放 加法运算放大 C Z XH OU T 1 2 3 4 5 6 J1 CO N 6 GN D +1 5 V Evaluation Warning : The document was created with Spire.PDF for Python.
                         ISSN: 2302 -4046          TELKOM NIKA  Vol. 12, No . 1, Janua ry 2014:  371 – 3 7 8   376 x[14]=wate r _l ast1;           x[15]=wate r _l ast1 >>8;          x[2]=0x00;  x[19]=0x01;          x [ 5 ] + + ;                water_ave = (water_ave* (x[5 ]-1)+water_l ast1)/x[5];  x[12]=wate r _ a ve;  x[13]=wate r _ a ve>>8;                  E X 0 = 0 ;              if(x[5]= = 1 water_ave1 =water_ave;    else   water_ave0 =water_ave1;   water_ave1 =water_ave;   c = 1 ;                3.4. Interactiv e  Interface  Different  with  a previo us P C  a s  the p o si tion machine,  this sy stem  adopt s a n e w type of  touch  scre en  as the po siti on ma chine . T he sy st em can ma ke the  equipm ent m o re flexible a n d   redu ce  the i n vestment, b u t also the  op eration i s   simpl e r a nd  more  conve n ient. T he tou c h  scre en  use s  Delta’s  DOP---B 07S 411, and it is  con n e c ted  wit h  the micro c o n trolle r thro u gh the MO DB US  proto c ol  [11]. The  tou c scre en  is u s ed  for th e o p e r a t ion of the  e n t ire  system,  d a ta di splay  a n d   data  stora ge,  at the  sam e  time, it ca export  the  d a ta thro ugh  the  U di sk.  T he inte rface  as   sho w n in Fig u re 7, you ca n touch vari o u s optio ns to  compl e te the corre s p ondin g  function.           Figure 7.Tou c h screen o p e rato r interfa c e       4. The Res u lts and  Discu ssion   Firstly, the  water tan k   sho u ld be  level,  and the  vario u s p a rt s of t he wi rin g  an d pipin g   sho u ld b e  co nne cted. Th e n  turn  on th e  power  su ppl y, and e s tabl ish a  ne w p r oject. Next we   sho u ld put d o wn the a nal ogue a nd po ur a ce rtain  weig ht of water into the pi pe before cli c king  the s t art button. Until the  water  c a lm,  we s h ould  c lick t he finish butt on. La stly, re cord the  data  on   the touch  screen. Re peat  20 times trial.  Test data a s  sho w n in Ta b l e 1.      Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046       De sign of a Subsequ ent Water Dete ctio n System  Co ntrolled b y  th e Microcontro ller (Chu Yan )   377 Table 1. Te st results  Detection times  Actual w e ight () K g  Detection  w e ight () Kg  rel a ti v e   error () 1 0.5  0.52  4%   2 0.5  0.46  -8%   3 0.5  0.51  2%   4 0.5  0.48  -4%   5 0.5  0.47  -6%   6 0.5  0.51  2%   7 0.5  0.48  -4%   8 0.5  0.49  -2%   9 0.5  0.48  -4%   10 0.5  0.48  -4%   11 0.5  0.46  -8%   12 0.5  0.46  -8%   13 0.5  0.51  2%   14 0.5  0.51  2%   15 0.5  0.51  2%   16 0.5  0.46  -8%   17 0.5  0.53  6%   18 0.5  0.48  -4%   19 0.5  0.53  6%   20 0.5  0.51  5%       From th e m easure m ent  results, the   rela tive e r ror of 20 tim e s me asurem ents  are  betwe en -10 % ---10%, the  accuracy  re ach ed to 9 0 %  which mee t  the expecte d req u iremen t. Of  course, the measurement result s still exist some  errors. And considering  these errors, there are  the following  two points:  The an alytical form ula theoretically  o b tained is g o t  from the ideal  situation. Su ch as th sen s ing  coil  axis symmetry,  this  con d ition  can’t b e  a c hi eved in p r a c ti ce.  In experi m ent, the indu ction  signal  e x tracted from  the weig hing  system  will be mixed a l o t of  interferen ce signal, whi c will inevitably have a ce rtai n influen ce o n  the measurement re sult s.        5. Conclusio n   In gene ral, i n  this  pape r,  the sanitary  wa re sub s e quent wate r detectio n   sy stem  ca n   measure the  measure d  target mo re  accura tely u nder E N 97 7-2012  stand ard. There  ha s a  signifi cant  co ntribution to  the gua rante e  of co ns um er ri ghts  and  intere sts, al so to mai n ta in  industry norm sta ndards. But there  are still  some  problems  in the detection accuracy,  such as  anti-interference ability.  T he  research  of key  technology pr oblem will i n crease the added  value  of sub s eq uen t water dete c t i on system  a nd the market  competitiven ess.      Referen ces   [1]    Z hao J i a n g w e i , Lia n g  Bai q i n g. Ch ines e s a nitar y  c e ramic s  e x p o rt b a rrie r s an al ysis.  Ceramics . 2 011 ;   (5): 9-11.   [2]    He M engk e,  Xi ao  Sh engr a n , Zhou  H a o m in. Su bs eq u ent W a ter T e sting  in T o il et Ca pab ilit y T e st  S y stem Bas e d  on Co nfig urati on Soft w a r e  Ki ngVi e w  6.5 1 Industri a l C ontr o l Co mputer . 200 7;  20( 5):   36-3 8 [3]    F eng Me ngl i, Cai Y upi ng,  Song  Ch unr ong. T he De velo pment a n d  Com paris on  of Severa l   Electroma gneti c  Non destructi ve Detect ed T e chn o lo gi es.  Journ a of Sich uan Ord n a n ce.  201 2; 3 3 (2) :   107- 110.   [4]    W ang Bo, W e n W e imi ng. " S ix liters  of  w a t e s y stem, "  toil et  w a ter  mode lin g stru cture an d th e   relati onsh i p b e tw e e n  researc h Ceramics.  19 98; (1): 45-47.   [5]    Don g  Ke, Qian  Yuxi a, Yuan  Z hang yi. Ma gn etoel ec tric Spe ed Sens or to Detect Ultra-L o w   F r eq ue nc Vibrati ons.  T E LKOMNIKA Indon esia n Jour nal  of Electric al  Engin eeri ng.  2 013; 11( 5): 250 2-25 07.   [6]    Meng Ji an. Stu d y   on K e y T e chni que  of Elect r omag netic D e tection for M e ta l. T i anjin: T i anji n  Univ ersit y   Electrical A u to mation En gi ne erin g. 200 8.  [7]    W ang Xian ’a n ,   W ang Xian yu.   Desi gn  of  a Ki nd  of Po cket Electro n i c  Bal ance.  Li ght Ind u str y   Machinery. 20 0 7 ; 25(2): 11 0-1 12.   Evaluation Warning : The document was created with Spire.PDF for Python.
                         ISSN: 2302 -4046          TELKOM NIKA  Vol. 12, No . 1, Janua ry 2014:  371 – 3 7 8   378 [8]    Lu Li ng, Yua n  Baosha n, Li Yede. T he design of  el ectro n ic cashi e r scale b a sed o n  C80 51F 35 0   computer.  Sha ndo ng U n ivers i ty of T e chnolo g y (Natura l  Sci ence).  20 09; 2 3 (3): 81-8 4 [9]    W ang Lu ya n,  Shen Z h ang gu o, Chen  Lo ng. T he  Performan c e Anal ys is for  Embedd ed S ystems usin g   statistics methods.  T E LKOMNIKA Indones i an Jour nal  of Electrical  E ngi neer ing . 20 13;  11(7): 409 9- 410 3.  [10]    Che n  Ru itao,  Gu Hua don g,  Z hen C hen qi.   T ouch-screen  Contro l S y ste m  of ns Ho: Y A G Laser Bas ed  on C8 05 1F 040 Microcomput er Information.   201 2; 28(9): 12 3-12 5.  [11]    Yuan  Li, O u Ya ng Mi ngs an, Ji ang  Yin g . D e si gn  of  Min e  F e ed Inv e rter Mo nitori ng S y ste m  Base o n   Delta T ouch.  Coal Mi ne Mach i nery.  201 3; 34( 4): 266-2 68.     Evaluation Warning : The document was created with Spire.PDF for Python.