Page 1
OVERVIEW


                                      Today, manual flush
        In manual flush               systems have been
systems, the user presses a              replaced with a
button, which opens a flush        sensor-operated system
    valve allowing mains-         that automatically flushes
  pressure water to flow into      the fixture when the user
 the bowl, or sometimes the               departs. The
user presses directly a flush        microcontroller-based
  lever (a handle connected         automatic flush system
to a flushometer). The valve        presented here uses an
     contains a pneumatic        infrared sensor to detect a
   mechanism that closes it          user approaching the
      after a preset time.      fixture, then it waits until the
                                          user departs.




                                                               Page 2
CONTd.

                                   A solenoid is used to
                                   actuate the flush from
           Installation of        a 6V power supply with
                                   battery backup inside
                this                 the unit that also
          microcontroller           powers the sensor
                                     circuit. This flush
         based automatic               system is fully
          flush system is             controlled by a
           shown in Fig.              microcontroller.




                  It also flushes before
                  the person departs if
                  the person is present
                     for more than the
                     preset time (more
                      than 5 minutes).

                                                            Page 3
Page 4
contd.
                    The IR transmitter LED
                      and the IR receiver
                  modules are mounted side
                  by side such that when the
                     user approaches the
                         mechanism,




                                        the IR receiver
    A solenoid operated
                                      module receives the
    water valve is used in
                                     IR signal reflected off
        the system.
                                          the person.




                                                               Page 5
Circuit description:




                                              The AT89C2051 is
                                                      an 8-bit
                                             microcontroller with
                       It is built around
                                              2 kB of flash based
 Below shows the        Atmel 89C2051
                                                     program
   circuit of the     microcontroller that
                                              memory,128 bytes
microcontroller-bas        controls the
                                                    of RAM, 15
  ed flush control          process of
                                                   input/output
      system.            automatically
                                                lines, two 16-bit
                      flushing the toilet.
                                             timers/counters, on-
                                               chip oscillator and
                                                  clock circuitry.



                                                         Page 6
Page 7
circuit of the microcontroller-based flush control system.
Page 8
CONTD.




     A 6MHz crystal is used for
  providing clock. Port pins P1.0
                                        All the input/output (I/O) pins are
through P1.4 of the microcontroller
                                       reset to ‘1’ as soon as RST (pin 9)
    are connected to buffers N1
                                        goes high on pressing switch S3.
through N5 of CD4050 via 10-kilo-
ohm pull-up resistors, respectively.




                                                                   Page 9
Contd.             Holding the RST pin high for two
                  machine cycles while the oscillator
                     is running resets the device.
                    Power-on reset is achieved by
                    capacitor C2 and resistor R9.




Resistor R10 limits the current       Pin 12 (P1.0) of microcontroller IC2
 through the LEDs. Port pins               provides the 38kHz clock
P1.1, P1.2, P1.3 and P1.4 are         frequency, which is buffered by N1
     used for indication of            to drive the two parallel IR-LEDs.
   standby, alert, active and         These IR-LEDs act as the infrared
      flush, respectively.                     signal transmitter.
                                                                 Page 10
Contd.                         Port pin P1.4 also
                                drives relay RL1
                            through transistor T1.
                              Diode D5 acts as a
                             free-wheeling diode.




    INT0 (pin 6) of the
                                                         The solenoid coil
     microcontroller is
                                                         operated off 6V is
  pulled up with resistor
                                                         connected to the
  R3 and connected to
                                                       contacts of relay RL1.
  pin 3 of TSOP1738 IR
     receiver module.




                              External interrupt 0
                               (INT0) is used to
                            receive the reflected IR
                                     signal.
                                                                            Page 11
Contd.                    Pin 2 of TSOP1738 is
                         pulled high with resistor
                             R2, while pin 1 is
                                grounded.




                                                 In the IR receiver module
                                                TSOP1738, the PIN diode
  The demodulated output
                                                  and the preamplifier are
  from the receiver module
                                                  assembled on the lead
 can be directly decoded by
                                                   frame, and the epoxy
     the microcontroller.
                                                package is designed as an
                                                          IR filter.


                                                                       Page 12
Contd.


   An actual-size,
single-side PCB for
the microcontroller-
  based automatic
  flush system is
shown in Fig. below
with its component
       layout.




                       Page 13
Pcb & its component layout   Page 14
The software:



   The software for flush       First, instruct the compiler to
 system is written in ‘Basic’       use 89C2051.dat for
  language and compiled         microcontroller AT89C2051
using Bascom-8051 version.         by statement ‘$regfile.’
• Which we have used
  here, is a demo version of
  Bascom-8051.




                                                       Page 15
Contd.
                                Then declare the
         After this, instruct
                                  variables as
          the compiler to
                                 bits, bytes and
            override the
                                 words. Initialize
         crystal frequency
                                port-1 to ‘0’ and
         options setting by
                                   port 3 to ‘1.’
             statement
                                 (Port-3 acts as
            ‘$crystal.’ T
                                 the input port.)



          Now write the
             subroutine
            ‘Fn38K6’ to            Enable the
         generate 38kHz          interrupt after
           frequency for          initialization.
         transmission of
          the IR signal.

                                                     Page 16
Contd.




  Standby LED          When ‘INT0’ goes
                                            When the person
   glows when             low, i.e., the
                                             moves away (no
external interrupt      transmission is
                                            interrupt) within 5
     ‘INT0’ is         interrupted, alert
                                               minutes, the
high, i.e., there is   LED glows. After
                                            system flushes for
no interruption of     5 seconds, active
                                               10 seconds.
IR transmission.         LED lights up.




                                                        Page 17
http://www.mcselec.c
            om/index.php?option
            =com_content&task=
            view&id=190&Itemid
            =57




reference



                         Page 18
Page 19

Afc ppt

  • 1.
  • 2.
    OVERVIEW Today, manual flush In manual flush systems have been systems, the user presses a replaced with a button, which opens a flush sensor-operated system valve allowing mains- that automatically flushes pressure water to flow into the fixture when the user the bowl, or sometimes the departs. The user presses directly a flush microcontroller-based lever (a handle connected automatic flush system to a flushometer). The valve presented here uses an contains a pneumatic infrared sensor to detect a mechanism that closes it user approaching the after a preset time. fixture, then it waits until the user departs. Page 2
  • 3.
    CONTd. A solenoid is used to actuate the flush from Installation of a 6V power supply with battery backup inside this the unit that also microcontroller powers the sensor circuit. This flush based automatic system is fully flush system is controlled by a shown in Fig. microcontroller. It also flushes before the person departs if the person is present for more than the preset time (more than 5 minutes). Page 3
  • 4.
  • 5.
    contd. The IR transmitter LED and the IR receiver modules are mounted side by side such that when the user approaches the mechanism, the IR receiver A solenoid operated module receives the water valve is used in IR signal reflected off the system. the person. Page 5
  • 6.
    Circuit description: The AT89C2051 is an 8-bit microcontroller with It is built around 2 kB of flash based Below shows the Atmel 89C2051 program circuit of the microcontroller that memory,128 bytes microcontroller-bas controls the of RAM, 15 ed flush control process of input/output system. automatically lines, two 16-bit flushing the toilet. timers/counters, on- chip oscillator and clock circuitry. Page 6
  • 7.
    Page 7 circuit ofthe microcontroller-based flush control system.
  • 8.
  • 9.
    CONTD. A 6MHz crystal is used for providing clock. Port pins P1.0 All the input/output (I/O) pins are through P1.4 of the microcontroller reset to ‘1’ as soon as RST (pin 9) are connected to buffers N1 goes high on pressing switch S3. through N5 of CD4050 via 10-kilo- ohm pull-up resistors, respectively. Page 9
  • 10.
    Contd. Holding the RST pin high for two machine cycles while the oscillator is running resets the device. Power-on reset is achieved by capacitor C2 and resistor R9. Resistor R10 limits the current Pin 12 (P1.0) of microcontroller IC2 through the LEDs. Port pins provides the 38kHz clock P1.1, P1.2, P1.3 and P1.4 are frequency, which is buffered by N1 used for indication of to drive the two parallel IR-LEDs. standby, alert, active and These IR-LEDs act as the infrared flush, respectively. signal transmitter. Page 10
  • 11.
    Contd. Port pin P1.4 also drives relay RL1 through transistor T1. Diode D5 acts as a free-wheeling diode. INT0 (pin 6) of the The solenoid coil microcontroller is operated off 6V is pulled up with resistor connected to the R3 and connected to contacts of relay RL1. pin 3 of TSOP1738 IR receiver module. External interrupt 0 (INT0) is used to receive the reflected IR signal. Page 11
  • 12.
    Contd. Pin 2 of TSOP1738 is pulled high with resistor R2, while pin 1 is grounded. In the IR receiver module TSOP1738, the PIN diode The demodulated output and the preamplifier are from the receiver module assembled on the lead can be directly decoded by frame, and the epoxy the microcontroller. package is designed as an IR filter. Page 12
  • 13.
    Contd. An actual-size, single-side PCB for the microcontroller- based automatic flush system is shown in Fig. below with its component layout. Page 13
  • 14.
    Pcb & itscomponent layout Page 14
  • 15.
    The software: The software for flush First, instruct the compiler to system is written in ‘Basic’ use 89C2051.dat for language and compiled microcontroller AT89C2051 using Bascom-8051 version. by statement ‘$regfile.’ • Which we have used here, is a demo version of Bascom-8051. Page 15
  • 16.
    Contd. Then declare the After this, instruct variables as the compiler to bits, bytes and override the words. Initialize crystal frequency port-1 to ‘0’ and options setting by port 3 to ‘1.’ statement (Port-3 acts as ‘$crystal.’ T the input port.) Now write the subroutine ‘Fn38K6’ to Enable the generate 38kHz interrupt after frequency for initialization. transmission of the IR signal. Page 16
  • 17.
    Contd. StandbyLED When ‘INT0’ goes When the person glows when low, i.e., the moves away (no external interrupt transmission is interrupt) within 5 ‘INT0’ is interrupted, alert minutes, the high, i.e., there is LED glows. After system flushes for no interruption of 5 seconds, active 10 seconds. IR transmission. LED lights up. Page 17
  • 18.
    http://www.mcselec.c om/index.php?option =com_content&task= view&id=190&Itemid =57 reference Page 18
  • 19.