Remote Control Dimmer

  • Upload
    tier-lp

  • View
    226

  • Download
    7

Embed Size (px)

Citation preview

  • 7/30/2019 Remote Control Dimmer

    1/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 1

    CHAPTER-1

    INTRODUCTION

    1.1 INTRODUCTION:

    Computational tools and computational machines were always the attraction of the

    technology implementation in the field of automation for industries and domestic products.

    The limitations of digital electronics in the implementation of algorithms have almost

    vanished, due to the availability of microprocessors and microcontrollers. Today

    microcontrollers have become an integral part of all the automation and semi-automation.

    The main objective of our project is to study about the ATMEG8 microcontroller and

    also its applications, AVR STUDIO software and EMBEDDED C language. The circuit of the

    project is designed in such a way to have a interface with the microcontroller and RF module.

    The signals from the input are transmitted through the ENCODER to the transmitting RF

    module and the signals are received in the receiving section through the reception module.

    Here DIP plays a major role in the encoding and in the decoding process. Here the circuit is

    provided with 12V and it is regulated to 5V with help of the 7805 voltage regulator, then the

    voltage given to the ENCODER and then to the transmitting module and thereby transmitted

    in the form of RF signals to the receiver section. Here the AT MEGA8 is used to set the

    brightness of the light and it is controlled by the L293D IC and RF module.

    The circuit is advantageous since it consumes a low power and also delivers a low

    power at the output and used in many automation for domestic purposes.

    1.2 OBJECTIVE:

    The main objective of the project is to learn about the basic micro controllers, use of

    encoders, decoders, voltage regulators. The basic principle involved in it is to know about theinterface of the micro controller with the RF MODULE which is used to prepare a automated

    device. The objective of the device is to act as a REMOTE CONTROL DIMMER with the

    help of the code which is to be debugged in the AVR studio

  • 7/30/2019 Remote Control Dimmer

    2/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 2

    CHAPTER-2

    INTRODUCTION TO MICRO CONTROLLERS

    2.1 EMBEDDED SYSTEM:

    An embedded system is a special-purpose system in which the computer is

    completely encapsulated by or dedicated to the device or system it controls. Unlike a general-

    purpose computer, such as a personal computer, an embedded system performs one or a few

    predefined tasks, usually with very specific requirements. Since the system is dedicated to

    specific tasks, design engineers can optimize it, reducing the size and cost of the product.

    Embedded systems are often mass-produced, benefiting from economies of scale.

    Personal digital assistants (PDAs) or handheld computers are generally considered

    embedded devices because of the nature of their hardware design, even though they are more

    expandable in software terms. This line of definition continues to blur as devices expand.

    With the introduction of the OQO Model 2 with the Windows XP operating system and ports

    such as a USB port both features usually belong to "general purpose computers", the

    line of nomenclature blurs even more.

    Physically, embedded systems ranges from portable devices such as digital watchesand MP3 players, to large stationary installations like traffic lights, factory controllers, or the

    systems controlling nuclear power plants.

    In terms of complexity embedded systems can range from very simple with a single

    microcontroller chip, to very complex with multiple units, peripherals and networks mounted

    inside a large chassis or enclosure.

    2.2 MICROCONTROLLER:

    A microcontroller (sometimes abbreviated C, or MCU) is a small computer on a

    single integrated circuit containing a processor core, memory, and

    programmable input/output peripherals. Program memory in the form of NOR flash or OTP

    ROM is also often included on chip, as well as a typically small amount of RAM.

  • 7/30/2019 Remote Control Dimmer

    3/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 3

    Microcontrollers are designed for embedded applications, in contrast to

    the microprocessors used in personal computers or other general purpose applications.

    Microcontrollers are used in automatically controlled products and devices, such as

    automobile engine control systems, implantable medical devices, remote controls, officemachines, appliances, power tools, toys and other embedded systems. By reducing the size

    and cost compared to a design that uses a separate microprocessor, memory, and input/output

    devices, microcontrollers make it economical to digitally control even more devices and

    processes. Mixed signal microcontrollers are common, integrating analog components needed

    to control non-digital electronic systems.

    Some microcontrollers may use four-bit words and operate at clock rate frequencies as

    low as 4 kHz, for low power consumption (milli watts or microwatts). They will generallyhave the ability to retain functionality while waiting for an event such as a button press or

    other interrupt; power consumption while sleeping (CPU clock and most peripherals off) may

    be just nano watts, making many of them well suited for long lasting battery applications.

    Other microcontrollers may serve performance-critical roles, where they may need to act more

    like a digital signal processor (DSP), with higher clock speeds and power consumption.

    2.3 Interrupts:

    Microcontrollers must provide real time (predictable, though not necessarily fast)

    response to events in the embedded system they are controlling. When certain events occur,

    an interrupt system can signal the processor to suspend processing the current instruction

    sequence and to begin an interrupt service routine (ISR, or "interrupt handler"). The ISR will

    perform any processing required based on the source of the interrupt before returning to the

    original instruction sequence. Possible interrupt sources are device dependent, and often

    include events such as an internal timer overflow, completing an analog to digital conversion,

    a logic level change on an input such as from a button being pressed, and data received on a

    communication link. Where power consumption is important as in battery operated devices,

    interrupts may also wake a microcontroller from a low power sleep state where the processor

    is halted until required to do something by a peripheral event.

  • 7/30/2019 Remote Control Dimmer

    4/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 4

    2.4 ARCHITECTURE:

    Fig.2.1.Block Diagram of ATmega8

  • 7/30/2019 Remote Control Dimmer

    5/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 5

    2.4.1 DEVICE ARCHITECTURE :

    Flash, EEPROM, and SRAM are all integrated onto a single chip, removing the need

    for external memory in most applications. Some devices have a parallel external bus option to

    allow adding additional data memory or memory-mapped devices. Almost all devices (exceptthe smallest Tiny AVR chips) have serial interfaces, which can be used to connect larger serial

    EEPROMs or flash chips.

    2.5 BUS INTERFACE:

    The I2C bus is a simple, two-wire connection that can link multiple devices together

    and allow them to exchange data. In its simplest form there is one master device that

    communicates to multiple slave devices. All devices are connected in parallel to the two wires

    of the I2C bus. The two wires are known as SCL and SDA. SCL is the clock line and is

    controlled by the master device. SDA is the bi-directional data line. To transfer data, the

    master sends out a slave address combined with a one bit read/write flag. If a write is desired,

    the master will continue to send data to the addressed slave. If a read is requested, the slave

    will respond with data. To coordinate transactions, the SCL and SDA lines are manipulated by

    the master and the slave to signal several conditions. These include START, STOP, ACK

    (acknowledge) and NAK (no acknowledge). The details of these conditions are handled by the

    drivers. The true geeks among you can learn all the details in the links provided at the end ofthese Instruct able

    .The electrical requirements are pretty simple. The master and the slaves must use the

    same level for Vcc, the grounds must be connected, and the SCL and SDA lines must be

    pulled up to Vcc. The value of the pull-up resistors is precisely determined by a calculation

    based on the total capacitance on the bus, but practically can be pretty much any value

    between 1.8K and 10K. I start with 5.1K and use lower values until it works. This usually isn't

    an issue unless you have a lot of devices or long lengths of wire between devices.

    The nominal data rate on the I2C bus is 100Kbits/second. Rates of 400Kbits/second,

    1Mbits/second, and beyond are possible as well, but aren't supported by the drivers in this

    Instructable. All I2C devices will work at 100Kbits/second.

  • 7/30/2019 Remote Control Dimmer

    6/65

    R

    E.C.E Dept., ALIET.

    2.6 FEATURES:

    High-performance, Lo

    Advanced RISC Archi

    - 130 Powerful Instr

    - 32 x 8 General Pur

    - Up to 6 MIPS Thro

    - Fully Static Operati

    - On-chip 2-cycle M

    Nonvolatile Program a

    - 8k Bytes of In-Syst

    - Optional Boot Cod

    - 512K Bytes EEPR

    - Programming Lock

    - 1K Byte Internal S

    Peripheral Features

    - On-chip Analog Co

    - Programmable Wat

    MOTE CONTROL DIMMER

    Fig:2.2 Bus interface

    w-power AVR 8-bit Microcontroller

    tecture

    ctions - Most Single Clock Cycle Execution

    ose Working Registers

    ughput at 16MHz

    on

    ltiple.

    nd Data Memories

    m Self-Programmable Flash

    Section with Independent Lock Bits

    M

    for Software Security

    AM.

    mparator

    chdog Timer with Separate On-chip Oscillator

    Page 6

  • 7/30/2019 Remote Control Dimmer

    7/65

    R

    E.C.E Dept., ALIET.

    - Master/Slave SPI S

    - Two 8-bit Timer/C

    - One 16-bit Timer/

    - Real Time Counter

    - Three PWM Chann

    - 8-channel ADC in

    - 6-channel ADC in

    - Byte-oriented Two-

    - Programmable Seri

    Special Microcontroll

    - Power-on Reset an

    - Internal Calibrated

    - External and Intern

    - Five Sleep Modes:

    I/O and Packages

    - 23 Programmable I

    - 28-lead PDIP, 32-l

    MOTE CONTROL DIMMER

    erial Interface

    unters with Separate Prescalar, Compare

    ounter with Separate Prescaler, Compare and C

    with Separate Oscillator

    els

    QFP and MLF package

    DIP package

    wire Serial Interface

    al USART

    r Features

    Programmable Brown-out Detection

    RC Oscillator

    al Interrupt Sources

    Idle, ADC Noise Reduction, Power-save, Powe

    Fig.2.3. View Of ATmega8

    O Lines

    ad TQFP, 32-pad MLF

    Page 7

    apture mode

    -down .

  • 7/30/2019 Remote Control Dimmer

    8/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 8

    2.7 MEMORY:

    Typically microcontroller programs must fit in the available on-chip program memory,

    since it would be costly to provide a system with external, expandable, memory. Compilers

    and assemblers are used to convert high-level language and assembler language codes into acompact machine code for storage in the microcontroller's memory. Depending on the device,

    the program memory may be permanent, read-only memory that can only be programmed at

    the factory, or program memory may be field-alterable flash or erasable read-only memory.

    Manufacturers have often produced special versions of their microcontrollers in order

    to help the hardware and software development of the target system. Originally these

    included EPROM versions that have a "window" on the top of the device through which

    program memory can be erased by ultraviolet light, ready for reprogramming after aprogramming ("burn") and test cycle. Since 1998, EPROM versions are rare and have been

    replaced by EEPROM and flash, which are easier to use (can be erased electronically) and

    cheaper to manufacture.

    2.7.1 Program memory:

    Program instructions are stored in non-volatile flash memory. Although the MCUs are

    8-bit, each instruction takes one or two 16-bit words.

    The size of the program memory is usually indicated in the naming of the device itself

    (e.g., the ATmega64x line has 64 kb of flash while the ATmega32x line has 32 kb).

    There is no provision for off-chip program memory; all code executed by the AVR

    core must reside in the on-chip flash. However, this limitation does not apply to the AT94

    FPSLIC AVR/FPGA chips.

    2.7.2 Internal data memory:

    The data address space consists of the register file, I/O registers, and SRAM.

  • 7/30/2019 Remote Control Dimmer

    9/65

  • 7/30/2019 Remote Control Dimmer

    10/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 10

    Table No.2.1 Pin Description

    PORT PIN ALTERNATE FUNCTIONS

    P1.5 MOSI(Used for In-system programming)

    P1.6 MISO(Used for In-system programming)

    P1.7 SCK(Used for In-system programming)

    2.8.3 Port 2:

    Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can

    sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal

    pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low willsource current (IIL) because of the internal pull-ups. Port 2 also receives the high-order address bits

    and some control signals during Flash programming and verification.

    2.8.4 Port 3:

    Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can

    sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal

    pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will

    source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash

    programming and verification. Port 3 also serves the functions of various special features of the

    AT89S51, as shown in the following table.

  • 7/30/2019 Remote Control Dimmer

    11/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 11

    Table.No.2.2 Pin Description

    2.8.5 RST:

    Reset input. A high on this pin for two machine cycles while the oscillator is running resets

    the device. This pin drives High for 98 oscillator periods after the Watchdog times out. The

    DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of

    bit DISRTO, the RESET HIGH out feature is enabled.

    2.8.6 ALE/PROG:

    Address Latch Enable (ALE) is an output pulse for latching the low byte of the address

    during accesses to external memory. This pin is also the program pulse input (PROG) during Flash

    programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency

    and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is

    skipped during each access to external data memory. If desired, ALE operation can be disabled by

    setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC

    instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the

    microcontroller is in external execution mode.

  • 7/30/2019 Remote Control Dimmer

    12/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 12

    2.8.7 PSEN:

    Program Store Enable (PSEN) is the read strobe to external program memory. When the

    AT89S51 is executing code from external program memory, PSEN is activated twice each machine

    cycle, except that two PSEN activations are skipped during each access to external data memory.

    2.8.8 EA/VPP:

    External Access Enable. EA must be strapped to GND in order to enable the device to fetch

    code from external program memory locations starting at 0000H up to FFFFH. Note, however, that

    if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC

    for internal program executions. This pin also receives the 12-volt programming enable voltage

    (VPP) during Flash programming.

    2.8.9 XTAL1:

    Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

    2.8.10 XTAL2:

    Output from the inverting oscillator amplifier.

    2.9 INSTRUCTION SET: The AVR Instruction Set is more orthogonal than those of most eight-bit microcontrollers, in

    particular the 8051 clones and PIC microcontrollers with which AVR competes today. However, it is

    not completely regular:

    Pointer registers X, Y, and Z have addressing capabilities that are different from

    each other.

    Register locations R0 to R15 have different addressing capabilities than register

    locations R16 to R31.

    I/O ports 0 to 31 have different addressing capabilities than I/O ports 32 to 63.

    CLR affects flags, while SER does not, even though they are complementary

    instructions. CLR set all bits to zero and SER sets them to one. (Note that CLR is

  • 7/30/2019 Remote Control Dimmer

    13/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 13

    pseudo-op for EOR R, R; and SER is short for LDI R,$FF. Math operations such as

    EOR modify flags while moves/loads/stores/branches such as LDI do not.)

    Accessing read-only data stored in the program memory (flash) requires special LPM

    instructions; the flash bus is otherwise reserved for instruction memory.

    Additionally, some chip-specific differences affect code generation. Code pointers

    (including return addresses on the stack) are two bytes long on chips with up to 128 Kbytes of

    flash memory, but three bytes long on larger chips; not all chips have hardware multipliers;

    chips with over 8 Kbytes of flash have branch and call instructions with longer ranges; and so

    forth.

    The mostly regular instruction set makes programming it using C (or even Ada)

    compilers fairly straightforward. GCC has included AVR support for quite some time, andthat support is widely used. In fact, Atmel solicited input from major developers of compilers

    for small microcontrollers, to determine the instruction set features that were most useful in a

    compiler for high-level languages.

    2.10 PROGRAM EXECUTION:

    Atmel's AVRs have a two stage, single level pipeline design. This means the next

    machine instruction is fetched as the current one is executing. Most instructions take just one

    or two clock cycles, making AVRs relatively fast among the eight-bit microcontrollers.

    The AVR processors were designed with the efficient execution of compiled C code in

    mind and have several built-in pointers for the task.

    AVRs have a large following due to the free and inexpensive development tools

    available, including reasonably priced development boards and free development software.

    The AVRs are sold under various names that share the same basic core but with different

    peripheral and memory combinations. Compatibility between chips in each family is fairly

    good, although I/O controller features may vary.

  • 7/30/2019 Remote Control Dimmer

    14/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 14

    CHAPTER-3

    ON BOARD PERIFERALS

    3.1 6F22 9V BATTERY:

    Fig.3.1. 9v Battery

    A nine-volt battery, the most common of which (and the one referred to here unless

    otherwise stated) is designated a PP3 battery, is shaped as a rounded rectangular prism. 9-volt

    batteries are commonly used in pocket transistor radios, smoke detectors, carbon monoxide

    alarms, guitar effect units, and radio-controlled vehicle controllers. They are also used as

    backup power to keep the time in digital clocks and alarm clocks. Nine-volt alkaline batteries

    are constructed of six individual 1.5V LR61 cells enclosed in a wrapper. These cells are

    slightly smaller than standard LR8D425 AAAA cells and can be used in their place for some

    devices, even though they are 3.5 mm shorter.

    As of 2007, 9-volt batteries accounted for 4% of alkaline primary battery sales in the

    US. In Switzerland as of 2008, 9-volt batteries totalled 2% of primary battery sales and 2% of

    secondary battery sales.

  • 7/30/2019 Remote Control Dimmer

    15/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 15

    3.1.1 CONNECTORS:

    The connector (snap) consists of two connectors: one smaller circular (male) and one

    larger, typically either hexagonal or octagonal (female). The connectors on the battery are the

    same as on the connector itself; the smaller one connects to the larger one and vice versa. The

    same connector is used on most other battery types in the Power Pack (PP) series. The battery

    has both terminals on one end. Battery polarization is obvious since mechanical connection is

    only possible in one configuration.

    A problem with this style of connector is that it is very easy to connect two batteries

    together in a short circuit, which quickly discharges both batteries, generating heat and

    possibly a fire. The clips on the nine-volt battery can be used to connect several nine-volt

    batteries in series to create higher voltage.

    3.1.2 Technical specifications:

    Inside an alkaline or carbon-zinc 9-volt battery there are six cells, either cylindrical

    alkaline or flat carbon-zinc type, connected in series. Some brands use welded tabs internally

    to attach to the cells, others press foil strips against the ends of the cells.

    Rechargeable NiCd and NiMH batteries have between six and eight 1.2 volt cells.

    Lithium versions use three 3.2 V cells - there is a rechargeable lithium polymer version. There

    is also a Hybrid NiMH version that has a very low self-discharge rate (85% of capacity after

    one year of storage).Formerly, mercury batteries were made in this size. They had higher

    capacity than carbon-zinc types, a nominal voltage of 8.4 volts, and very stable voltage output.

    Once used in photographic and measuring instruments or long-life applications, they are now

    unavailable due to environmental restrictions.

    3.1.3 Self discharge:

    An alkaline battery that is unused or used with extremely low power consumption

    devices (transistor leak current, etc.) can be expected to last approximately for 6 years,

    essentially the shelf-life of a new battery.

  • 7/30/2019 Remote Control Dimmer

    16/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 16

    3.1.4 Lithium 9V/PP3:

    Lithium 9-volt batteries are consumer-replaceable, high energy density batteries

    designed to last up to 5 times longer than alkaline 9-volt batteries and up to 10 times longer

    than carbon-zinc 9-volt batteries in many applications. In addition, lithium PP3 batteries have

    a long shelf life of up to 10 years. Common applications for lithium 9-volt batteries are smoke

    and CO (Carbon Monoxide) alarms.

    3.2 VOLTAGE REGULATORS:

    A voltage regulator is designed to automatically maintain a constant voltage level. A

    voltage regulator may be a simple "feed-forward" design or may include negative

    feedback control loops. It may use an electro mechanical mechanism, or electronic

    components. Depending on the design, it may be used to regulate one or more AC or DC

    voltages.

    Electronic voltage regulators are found in devices such as computer power

    supplies where they stabilize the DC voltages used by the processor and other elements. In

    automobile alternators and central power station generator plants, voltage regulators control

    the output of the plant. In an electric power distribution system, voltage regulators may be

    installed at a substation or along distribution lines so that all customers receive steady voltage

    independent of how much power is drawn from the line.

    7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed

    linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would

    not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a

    constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide.

    7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at

    input and output pins depending upon the respective voltage levels. Voltage regulator is a

    single chip/package (IC), the 7805 is a positive voltage DC regulator that has only 3 terminals.

    They are: Input voltage, Ground, Output Voltage.

  • 7/30/2019 Remote Control Dimmer

    17/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 17

    Fig.3.2. Voltage Regulator

    3.2.1 GENERAL FEATURES:

    Output Current up to 1A

    Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V

    Thermal Overload Protection

    Short Circuit Protection

    Output Transistor Safe Operating Area Protection

    3.2.2 LM 78XX SERIES VOLTAGE REGULATOR:

    The LM 78XXX series of the three terminal regulations is available with several fixed

    output voltages making them useful in a wide range of applications. One of these is local on

    card regulation. The voltages available allow these regulators to be used in logic systems,

    instrumentation and other solid state electronic equipment. Although designed primarily as

    fixed voltage regulators, these devices can be used with external components to obtain

    adjustable voltages and currents. The LM78XX series is available in aluminum to 3 packages

    which will allow over 1.5A load current if adequate heat sinking is provided. Current limiting

    is included to limit the peak output current to a safe value. The LM 78XX is available in the

    metal 3 leads to 5 and the plastic to 92. For this type, with adequate heat sinking. The

    regulator can deliver 100mA output current.

  • 7/30/2019 Remote Control Dimmer

    18/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 18

    The advantage of this type of regulator is, it is easy to use and minimize the number of

    external components.

    The following are the features voltage regulators:

    a) Output current in excess of 1.5A for 78 and 78L series

    b) Internal thermal overload protection

    c) No external components required

    d) Output transistor sage area protection

    e) Internal short circuit current limit.

    f) Available in aluminum 3 package.

    3.2.3 POSITIVE VOLTAGE REGULATOR:

    The positive voltage regulator has different features like

    Output current up to 1.5A

    No external components

    Internal thermal overload protection

    High power dissipation capability

    Internal short-circuit current limiting

    Output transistor safe area compensation

    Direct replacements for Fairchild microA7800 series

  • 7/30/2019 Remote Control Dimmer

    19/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 19

    Table.No.3.1: Electrical absolute ratings

    3.3 HT12E Encoder

    The HT12E Encoder ICs are series of CMOS LSIs for Remote Control system

    applications. They are capable of Encoding 12 bit of information which consists of N addressbits and 12-N data bits. Each address/data input is externally trinary programmable if bonded

    out.

    Features Encoder

    18 PIN DIP

    Operating Voltage : 2.4V ~ 12V

    Low Power and High Noise Immunity

    CMOS Technology

    Low Standby Current and Minimum Transmission Word

    Built-in Oscillator needs only 5% Resistor

    Easy Interface with and RF or an Infrared transmission medium

    Minimal External Components

    Nominal

    Output Voltage

    Regulator

    5V uA7805C

    6V uA7806C

    8V uA7808C

    8.5V uA7885C

    10V uA7810C

    12V uA7812C

    15V uA7815C

  • 7/30/2019 Remote Control Dimmer

    20/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 20

    Block Diagram

    HT12E:

    Fig.3.3.Block Diagram Of Encoder

    Fig.3.4. Pin Diagram Of Encoder

  • 7/30/2019 Remote Control Dimmer

    21/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 21

    Table.no.3.2 Pin Description

  • 7/30/2019 Remote Control Dimmer

    22/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 22

    3.4 HT12D Decoder

    The HT12D Decoder ICs are series of CMOS LSIs for remote control system

    applications. This ICs are paired with each other. For proper operation a pair of

    encoder/decoder with the same number of address and data format should be selected. TheDecoder receive the serial address and data from its corresponding encoder, transmitted by a

    carrier using an RF transmission medium and gives output to the output pins after processing

    the data.

    Features - Decoder

    18 PIN DIP

    Operating Voltage : 2.4V ~ 12.0V

    Low Power and High Noise Immunity

    CMOS Technology

    Low Stand by Current

    Ternary address setting

    Capable of Decoding 12 bits of Information

    8 ~ 12 Address Pins and 0 ~ 4 Data Pins

    Received Data are checked 2 times, Built in Oscillator needs only 5% resistor

    VT goes high during a valid transmission

    Easy Interface with an RF of IR transmission medium

    Minimal External Components

  • 7/30/2019 Remote Control Dimmer

    23/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 23

    Block Diagram:

    HT12D

    Fig.3.5. Block Diagram Of Decoder

    Fig.3.6.Pin Diagram of HT12D

  • 7/30/2019 Remote Control Dimmer

    24/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 24

    Table.No.3.3 Pin Description

    Applications

    Burglar Alarm, Smoke Alarm, Fire Alarm, Car Alarm, Security System

    Garage Door and Car Door Controllers

    Cordless telephone

    Other Remote Control System

  • 7/30/2019 Remote Control Dimmer

    25/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 25

    3.5 IC L293D

    The L293 and L293D are quad push-pull drivers capable of delivering output currents

    to 1A or 600mA per channel respectively. Each channel is controlled by a TTL-compatible

    logic input and each pair of drivers a full bridge) is equipped with an inhibit input which turns

    off all four transistors. A separate supply input is provided for the logic so that it maybe run

    off a lower voltage to reduce dissipation.

    Additionally the L293D includes the output clamping diodes within the IC for

    complete interfacing with inductive loads.

    Both devices are available in 16-pin Batwing DIP packages. They are also available in

    Power S0IC and Hermetic DIL packages.

    Fig:3.7 IC L293D

    Features

    Output Current 1A Per Channel (600mAfor L293D)

    Peak Output Current 2A Per Channel(1.2A for L293D)

    Inhibit Facility

    High Noise Immunity

    Separate Logic Supply

    Over-Temperature Protection

  • 7/30/2019 Remote Control Dimmer

    26/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 26

    Block Diagram:

    L293D

    Fig.3.8.Block Diagram Of L293D

    Fig.3.9.Pin Diagram Of L293D

  • 7/30/2019 Remote Control Dimmer

    27/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 27

    3.6 RF Module:

    RF Modules are used wireless transfer data. This makes them most suitable for remote

    control applications, as in where you need to control some machines or robots without getting

    in touch with them (may be due to various reasons like safety, etc). Now depending upon the

    type of application, the RF module is chosen. For short range wireless control applications, an

    ASK RF Transmitter-Receiver Module of frequency 315 MHz or 433 MHz is most suitable.

    Fig.3.10. Block Diagram Of RF Section

    General RF communication block diagram is shown above. Since most of the

    encoders/decoders/microcontrollers are TTL compatible, most of the inputs by the user will be

    given in TTL logic level. Thus, this TTL input is to be converted into serial data input using

    an encoder or a microcontroller. This serial data can be directly read using the RF Transmitter,

    which then performs ASK (in some cases FSK) modulation on it and transmit the data through

    the antenna.

  • 7/30/2019 Remote Control Dimmer

    28/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 28

    3.6.1 RF TRANSMITING MODULE:

    Fig.3.11.Block Diagram Of Transmitting Section

    The transmitter/receiver (Tx/Rx) pair operates at a frequency of 434 MHz. An RF

    transmitter receives serial data and transmits it wirelessly through RF through its antenna

    connected at pin4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data

    is received by an RF receiver operating at the same frequency as that of the transmitter

    Fig: 3.12 Pin Diagram Of Transmitting Section

  • 7/30/2019 Remote Control Dimmer

    29/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 29

    Table:3.3 Pin Description

    3.6.2 RF RECEIVING MODULE

    Fig.3.13.Block Diagram Of Receiving Section

    In the receiver side, the RF Receiver receives the modulated signal through the

    antenna, performs all kinds of processing, filtering, demodulation, etc and gives out a serial

    data. This serial data is then converted to a TTL level logic data, which is the same data that

    the user has input

    Pin NoFunction Name

    1 Ground (0V) Ground

    2 Serial data input pin Data

    3 Supply voltage; 5V Vcc

    4 Antenna output pin ANT

  • 7/30/2019 Remote Control Dimmer

    30/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 30

    Fig.3.13.1. Pin Diagram Of RF Receiving Module

  • 7/30/2019 Remote Control Dimmer

    31/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 31

    Table:3.4 Pin Description

    Pin No Function Name

    1 Ground (0V) Ground

    2 Serial data output pin Data

    3 Linear output pin; not connected NC

    4 Supply voltage; 5V Vcc

    5 Supply voltage; 5V Vcc

    6 Ground (0V) Ground

    7 Ground (0V) Ground

    8 Antenna input pin ANT

    Overview

    The STR-433 is ideal for short-range remote control applications where cost is a

    primary concern. The receiver module requires no external RF components except for the

    antenna. It generates virtually no emissions, making FCC and ETSI approvals easy. The

    super-regenerative design exhibits exceptional sensitivity at a very low cost. The

    manufacturing-friendly SIP style package and low-cost make the STR-433 suitable for high

    volume applications

    Features

    Low Cost

    5V operation

    3.5mA current drain

    No External Parts are required

    Receiver Frequency: 433.92 MHZ

    Typical sensitivity: -105dBm

    IF Frequency: 1MHz

  • 7/30/2019 Remote Control Dimmer

    32/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 32

    Applications

    Car security system

    Sensor reporting

    Automation system

    Remote Keyless Entry (RKE)

    Remote Lighting Controls

    On-Site Paging

    Asset Tracking

    Wireless Alarm and Security Systems

    Long Range RFI

    Automated Resource Management

    Specification:

    Operating Voltage 4.5 to .5.0

    Operating Current - 3.5 to 4.5

    Reception Bandwidth- 1.0

    Center Frequency - 433.92

    Sensitivity -105

    Operating Temperature -10 to +60 C

    Operation

    Super-Regenerative AM Detection

    The STR-433 uses a super-regenerative AM detector to demodulate the incoming AM

    carrier. A super regenerative detector is a gain stage with positive feedback greater than unity

    so that it oscillates. An RC-time constant is included in the gain stage so that when the gain

    stage oscillates, the gain will be lowered over time proportional to the RC time constant until

    the oscillation eventually dies. When the oscillation dies, the current draw of the gain stage

  • 7/30/2019 Remote Control Dimmer

    33/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 33

    decreases, charging the RC circuit, increasing the gain, and ultimately the oscillation starts

    again. In this way, the oscillation of the gain stage is turned on and off at a rate set by the RC

    time constant. This rate is chosen to be super-audible but much lower than the main oscillation

    rate. Detection is accomplished by measuring the emitter current of the gain stage. Any RF

    input signal at the frequency of the main oscillation will aid the main oscillation in restarting.

    If the amplitude of the RF input increases, the main oscillation will stay on for a longer period

    of time, and the emitter current will be higher. Therefore, we can detect the original base-band

    signal by simply low-pass filtering the emitter current.

    The average emitter current is not very linear as a function of the RF input level. It

    exhibits a 1/ln response because of the exponentially rising nature of oscillator start-up. The

    steep slope of a logarithm near zero results in high sensitivity to small input signals.

    Data Slicer

    The data slicer converts the base-band analog signal from the super-regenerative

    detector to aTTL compatible output. Because the data slicer is AC coupled to the audio output,

    there is a minimum data rate. AC coupling also limits the minimum and maximum pulse

    width. Typically, data is encoded on the transmit side using pulse-width modulation (PWM)

    or non-return-to-zero (NRZ).

    The most common source for NRZ data is from a UART embedded in a micro-

    controller. Applications that use NRZ data encoding typically involve microcontrollers. The

    most common source for PWM data is from a remote control IC such as the HC-12E from

    Holtek or ST14 CODEC from Sunrom Technologies. Data is sent as a constant rate square-

    wave. The duty cycle of that square wave will generally be either 33% (a zero) or 66% (a

    one). The data slicer on the STR-433 is optimized for use with PWM encoded data, though it

    will work with NRZ data if certain encoding rules are followed.

    Power Supply

    The STR-433 is designed to operate from a 5V power supply. It is crucial that this

    power supply be very quiet. The power supply should be bypassed using a 0.1uF low-ESR

    ceramic capacitor and a 4.7uF tantalum capacitor. These capacitors should be placed as close

  • 7/30/2019 Remote Control Dimmer

    34/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 34

    to the power pins as possible. The STR-433 is designed for continuous duty operation. From

    the time power is applied, it can take up to750mSec for the data output to become valid.

    Antenna Input

    It will support most antenna types, including printed antennas integrated directly onto

    the PCB and simple single core wire of about 17cm. The performance of the different

    antennas varies. Any time a trace is longer than 1/8th the wavelength of the frequency it is

    carrying, it should be a 50 ohm microstrip

    3.7 DIODE 1N4007

    Fig:3.14 Diode

    Features

    Diffused Junction

    High Current Capability and Low Forward Voltage Drop

    Surge Overload Rating to 30A Peak

    Low Reverse Leakage

    Case: DO-41

    Case Material: Molded Plastic. UL Flammability Classification

    Moisture Sensitivity: Level 1 per J-STD-020

    Terminals: Finish - Bright Tin. Plated Leads

    Polarity: Cathode Band

    Mounting Position: Any

    Marking: Type Number

    Weight: 0.30 grams (approximate)

  • 7/30/2019 Remote Control Dimmer

    35/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 35

    3.8 Dual Inline Package:

    Fig:3.15 Dual Inline Package

    3.8.1 DESCRIPTION:

    The MM74HC595 high-speed shift register utilizes advanced silicon-gate CMOS

    technology. This device possesses the high noise immunity and low power consumption of

    standard CMOS integrated circuits, as well as the ability to drive 15 LS-TTL loads.

    This device contains an eight-bit serial-in, parallel-out, shift register that feeds an

    eight-bit D-type storage register. The storage register has eight 3-state outputs. Separate

    clocks are provided for both the shift register and the storage register. The shift register has a

    direct over riding clear, serial input, and serial output(standard) pins for cascading. Both the

    shift register and storage register use positive-edge triggered clocks. If both clocks are

    connected together, the shift register state is one clock pulse ahead of the storage register. The

    74HC logic family is speed, function, and pin-out compatible with the standard 74LS logic

    family. All inputs are protected from damage due to static discharge by internal diode clamps

    to VCC and ground.

    3.8.2 Features

    Low Quiescent current: 80 A Maximum

    (74HC Series)

    Low Input Current: 1 A Maximum

    8-Bit Serial-In, Parallel-Out Shift Register with

  • 7/30/2019 Remote Control Dimmer

    36/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 36

    Storage

    Wide Operating Voltage Range: 2V6V

    Cascadable

    Shift Register has Direct Clear

    Guaranteed Shift Frequency: DC to 30MHz

    3.9 LED:

    It is a semiconductor diode having radioactive recombination. It requires a definite

    amount of energy to generate an electron hole pair. The same energy is released when an

    electron recombines with a hole. This released energy may result in the emission of photon

    and such a recombination. Hear the amount of energy released when the electro reverts from

    the conduction band to the valence band appears in the form of radiation. Alternatively the

    released energy may result in a series of photons causing lattice libration. Finally the released

    energy may be transferred to another electron. The recombination radiation may be lie in the

    infra-red and visible light spectrum. In forward is peaked around the band gap energy and the

    phenomenon is called injection luminescence. In a junction biased in the avalanche break

    down region , there results a spectrum of photons carrying much higher energies . Almost

    White light then gets emitted from micro plasma breakdown region in silicon junction. Diodes

    having radioactive recombination are termed as Light Emitting Diode, abbreviated as LEDs.

    In gallium arsenide diode, recombination is predominantly a radiation recombination

    and the probability of this radioactive recombination far exceeds that in either germanium or

    silicon . Hence GaAs LED has much higher efficiency in terms of Photons emitted per carrier.

    The internal efficiency of GaAs LED may be very close to 100% but because of high index of

    refraction, only a small fraction of the internal radiation can usually come out of the device

    surface. In spite of this low efficiency of actually radiated light, these LEDs are efficiency

    used as light emitters in visual display units and in optically coupled circuits, The efficiency

    of light generation increases with the increase of injected current and with decreases in

    temperature. The light so generated is concentrated near the junction since most of the charge

    carriers are obtained within one diffusion length of the diode junction.

  • 7/30/2019 Remote Control Dimmer

    37/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 37

    Fig.3.16. Circuit Diagram of LED

    The following are the merits of LEDs over conventional incandescent and other types of

    lamps

    Low working voltages and currents

    Less power consumption

    Very fast action

    Emission of monochromatic light

    Small size and weight

    No effect of mechanical vibrations

    Extremely long life

    3.10 Transformer:

    A transformer is an electrical device which is used to convert electrical power from

    one Electrical circuit to another without change in frequency.

    Transformers convert AC electricity from one voltage to another with little loss of

    power. Transformers work only with AC and this is one of the reasons why mains electricity

    is AC. Step-up transformers increase in output voltage, step-down transformers decrease in

    output voltage. Most power supplies use a step-down transformer to reduce the dangerously

    high mains voltage to a safer low voltage. The input coil is called the primary and the output

  • 7/30/2019 Remote Control Dimmer

    38/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 38

    coil is called the secondary. There is no electrical connection between the two coils; instead

    they are linked by an alternating magnetic field created in the soft-iron core of the

    transformer. The two lines in the middle of the circuit symbol represent the core.

    Transformers waste very little power so the power out is (almost) equal to the power in. Note

    that as voltage is stepped down current is stepped up. The ratio of the number of turns on

    each coil, called the turns ratio, determines the ratio of the voltages. A step-down transformer

    has a large number of turns on its primary (input) coil which is connected to the high voltage

    mains supply, and a small number of turns on its secondary (output) coil to give a low output

    voltage.

    Fig.3.17.An Electrical Transformer

    Turns ratio = Vp/ VS = Np/NS

    Power Out= Power In

    VS X IS=VP X IP

    Vp =primary (input) voltage

    Np =number of turns on primary coil

    Ip = primary (input) current

  • 7/30/2019 Remote Control Dimmer

    39/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 39

    RESISTORS:

    Fig:3.18 Resistors

    A resistor is a passive two-terminal electrical component that implements electrical

    resistance as a circuit element.

    The current through a resistor is in direct proportion to the voltage across the resistor's

    terminals. This relationship is represented by Ohm's law:

    where I is the current through the conductor in units of amperes, V is the potential

    difference measured across the conductor in units of volts, and R is the resistance of the

    conductor in units of ohms.

    The ratio of the voltage applied across a resistor's terminals to the intensity of current

    in the circuit is called its resistance, and this can be assumed to be a constant (independent of

    the voltage) for ordinary resistors working within their ratings.

    Resistors are common elements of electrical networks and electronic circuits and areubiquitous in electronic equipment. Practical resistors can be made of various compounds and

    films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel-chrome).

    Resistors are also implemented within integrated circuits, particularly analog devices, and can

    also be integrated into hybrid and printed circuits.

  • 7/30/2019 Remote Control Dimmer

    40/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 40

    The electrical functionality of a resistor is specified by its resistance: common

    commercial resistors are manufactured over a range of more than nine orders of magnitude.

    When specifying that resistance in an electronic design, the required precision of the

    resistance may require attention to the manufacturing tolerance of the chosen resistor,

    according to its specific application. The temperature coefficient of the resistance may also be

    of concern in some precision applications. Practical resistors are also specified as having a

    maximum power rating which must exceed the anticipated power dissipation of that resistor in

    a particular circuit: this is mainly of concern in power electronics applications. Resistors with

    higher power ratings are physically larger and may require heat sinks. In a high-voltage

    circuit, attention must sometimes be paid to the rated maximum working voltage of the

    resistor.

    3.12 CAPACITORS:

    A capacitor (originally known as condenser) is a passive two-terminal electrical

    component used to store energy in an electric field. The forms of practical capacitors vary

    widely, but all contain at least two electrical conductors separated by a dielectric (insulator);

    for example, one common construction consists of metal foils separated by a thin layer of

    insulating film. Capacitors are widely used as parts of electrical circuits in many common

    electrical devices.

    When there is a potential difference (voltage) across the conductors, a static electric

    field develops across the dielectric, causing positive charge to collect on one plate and

    negative charge on the other plate. Energy is stored in the electrostatic field. An ideal

    capacitor is characterized by a single constant value, capacitance, measured in farads. This is

    the ratio of the electric charge on each conductor to the potential difference between them.

    The capacitance is greatest when there is a narrow separation between large areas of

    conductor, hence capacitor conductors are often called "plates," referring to an early means ofconstruction. In practice, the dielectric between the plates passes a small amount of leakage

    current and also has an electric field strength limit, resulting in a breakdown voltage, while the

    conductors and leads introduce an undesired inductance and resistance.

  • 7/30/2019 Remote Control Dimmer

    41/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 41

    Capacitors are widely used in electronic circuits for blocking direct current while

    allowing alternating current to pass, in filter networks, for smoothing the output of power

    supplies, in the resonant circuits that tune radios to particular frequencies, in electric power

    transmission systems for stabilizing voltage and power flow, and for many other purposes.

    Fig:3.19 Types of capacitors

    3.13 ELECTRONIC SWITCHES:

    A relay is an electrically operated switch. Many relays use an electromagnet to operate

    a switching mechanism mechanically, but other operating principles are also used. Solid-state

    relays control power circuits with no moving parts, instead using a semiconductor device to

    perform switchingoften a silicon-controlled rectifier or triac.

    The analogue switch uses two MOSFET transistors in a transmission gate arrangement

    as a switch that works much like a relay, with some advantages and several limitations

    compared to an electromechanical relay.

  • 7/30/2019 Remote Control Dimmer

    42/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 42

    The power transistor(s) in a switching voltage regulator, such as a power supply unit,

    are used like a switch to alternately let power flow and block power from flowing.

    3.20Various types of tactile switches

    Many people use metonymy to call a variety of devices "switches" that conceptually

    connect or disconnect signals and communication paths between electrical devices, analogous

    to the way mechanical switches connect and disconnect paths for electrons to flow between

    two conductors. Early telephone systems used an automatically operated Strowger switch to

    connect telephone callers; telephone exchanges contain one or more crossbar switches today.

    3.20.1 Dip switch

    Since the advent of digital logic in the 1950s, the term switch has spread to a variety of

    digital active devices such as transistors and logic gates whose function is to change their output

    state between two logic levels or connect different signal lines, and even computers, network

    switches, whose function is to provide connections between different ports in a computer

    network.[12] The term 'switched' is also applied to telecommunications networks, and signifies a

  • 7/30/2019 Remote Control Dimmer

    43/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 43

    network that is circuit switched, providing dedicated circuits for communication between end

    nodes, such as the public switched telephone network

  • 7/30/2019 Remote Control Dimmer

    44/65

    R

    E.C.E Dept., ALIET.

    4.1 INTRODUCTION

    AVR Studio is a Dev

    AVR Studio enables the user

    Emulator or on the built-in A

    execution of Assembly progr

    and C programs compiled

    microcontrollers. AVR Studio

    4.2DESCRIPTION:

    AVR Studio enables

    the built-in AVR Instruction

    it must first be compiled wi

    Assembler to generate an obje

    4.3 AVR STUDIO WIN

    4.3.1 Source window:

    The Source window is

    an object file is opened, and i

    the session is terminated.

    MOTE CONTROL DIMMER

    CHAPTER 4

    AVR STUDIO

    O AVR STUDIO:

    lopment Tool for the AT90S Series of AVR

    to fully control execution of programs on the

    R Instruction Set Simulator. AVR Studio sup

    ams assembled with the Atmel Corporation's

    with IAR Systems ICCA90 C Compile

    runs under Microsoft Windows95 and Microso

    xecution of AVR programs on an AVR In-Ci

    et Simulator. In order to execute a program us

    h IAR Systems' C Compiler or assembled wi

    ct file which can be read by AVR Studio.

    OW:

    the main window in an AVR Studio session. I

    s present throughout the session. If the Source

    Figure 4.1 Source Window 1

    Page 44

    microcontrollers.

    T90S In-Circuit

    orts source level

    AVR Assembler

    for the AVR

    t Windows NT.

    cuit Emulator or

    ing AVR Studio,

    th Atmel's AVR

    is created when

    window is close,

  • 7/30/2019 Remote Control Dimmer

    45/65

    R

    E.C.E Dept., ALIET.

    The next instruction t

    moved by the user, this next

    becomes red. A breakpoint i

    statement where the breakpoi

    Fig

    4.3.2 Watch window:

    The Watch window

    variables in a C program.

    information, this window can

    An example of a Watch wind

    The Watch window has three

    watched. The next is the type

    MOTE CONTROL DIMMER

    be executed is always marked by AVR Studi

    tatement can still be identified since the previo

    s identified in the Source window as a dot t

    t is set. An example of a Source window is giv

    re 4.2 Source window 2

    an display the types and values of symbols

    Since the AVR Assembler does not gener

    only be used in a meaningful way when execu

    w is given below.

    fields. The first field is the name of the symb

    of the symbol, and the third is the value of the s

    Page 45

    . If the marker is

    usly marked text

    o the left of the

    n below.

    like for instance

    ate any symbol

    ting C programs.

    l which is being

    ymbol.

  • 7/30/2019 Remote Control Dimmer

    46/65

    R

    E.C.E Dept., ALIET.

    4.3.3 Register window:

    The Register window d

    An example of the Register w

    When the Register wi

    the shape of the window.

    The values in the Reg

    order to change the contents

    the cursor on the register tomake sure to make a pause be

    4.3.4 Message window:

    The Message window

    command is issued, the con

    Message window is given bel

    The contents in the M

    toggled off and then on again.

    MOTE CONTROL DIMMER

    isplays the contents of the 32 registers in the

    indow is given below.

    Figure 4.3 Register window

    ndow is resized, the contents is reorganized in

    ister window can be changed when the executi

    f a register, first make sure the execution is sto

    change, press the left mouse button twice (noween the mouse button clicks).

    displays messages from AVR Studio to the us

    tents of the Message window are cleared.

    w.

    ssage window is remembered also when the M

    Only one Message window can be active at a ti

    Page 46

    VR register file.

    order to best fit

    on is stopped. In

    pped. Then place

    t a double click,

    r. When a Reset

    n example of a

    ssage window is

    me.

  • 7/30/2019 Remote Control Dimmer

    47/65

    R

    E.C.E Dept., ALIET.

    4.3.5 Memory window:

    The Memory windo

    various memories present in

    memory types. The Memory

    I/O memory and EEPROM m

    The user can have se

    window is shown below.

    Which Memory type

    left of the Memory window.

    default memory type. AVR S

    placed, but also which mem

    Window.

    MOTE CONTROL DIMMER

    enables the user to inspect and modify the

    the execution target. The same window is

    window can be used to view Data memory, P

    mory.

    eral concurrent Memory windows. An exam

    o view can be changed in the memory selecti

    When a new Memory window is created, Dat

    udio not only keeps track over where the Mem

    ry type it is displaying, and also the formatt

    Figure 4.4 Memory window

    Page 47

    contents of the

    sed to view all

    rogram memory,

    le of a Memory

    n box at the top

    a memory is the

    ory windows are

    ing status of the

  • 7/30/2019 Remote Control Dimmer

    48/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 48

    4.3.6 Processor window:

    The Processor window contains vital information about the execution target. An

    example of a Processor window is shown below.

    Figure 4.5 Processor window

    4.3.7 Peripheral Device windows:

    The user can watch the contents of the I/O in the Memory window. Viewing the

    I/O area as a flat memory structure is not a very convenient way of observing the status of themany I/O devices of the microcontroller in question. Specialized Device windows have

    therefore been incorporated to ease the observation of I/O devices.

    4.3.8 Commands:

    AVR Studio incorporates a number of different commands. The commands can be

    given in various ways: through menu selections, toolbar buttons and by keyboard shortcuts.

    4.3.9 Execution Target:

    AVR Studio can be targeted towards an AVR In-Circuit Emulator or the built-in AVR

    Simulator. When the user opens a file, AVR Studio automatically detects whether an Emulator

    is present and available on one of the systems serial ports. If an Emulator is found, it is

  • 7/30/2019 Remote Control Dimmer

    49/65

    R

    E.C.E Dept., ALIET.

    selected as the execution targ

    AVR Simulator instead.

    The Status bar will i

    Emulator or the built-in AVR

    4.4 Shortcut summary:

    4.5 Embedded C:

    Embedded C is a set o

    Standards committee to addr

    different embedded systems.

    extensions to the C language i

    multiple distinct memory ban

    In 2008, the C Standar

    providing a common standar

    features not available in norm

    basic I/O hardware addressin

    MOTE CONTROL DIMMER

    t. If no Emulator is found, execution will be do

    ndicate whether execution is targeted at the

    Simulator.

    Figure 4.6 summary

    f language extensions for the C Programming l

    ess commonality issues that exist between

    Historically, embedded C programming requ

    n order to support exotic features such as fixed

    s, and basic I/O operations.

    s Committee extended the C language to addre

    for all implementations to adhere to. It inclu

    al C, such as, fixed-point arithmetic, named ad

    .

    Page 49

    ne on the built-in

    AVR In-Circuit

    nguage by the C

    extensions for

    ires nonstandard

    point arithmetic,

    s these issues by

    des a number of

    ress spaces, and

  • 7/30/2019 Remote Control Dimmer

    50/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 50

    Embedded C use most of the syntax and semantics of standard C, e.g., main () function,

    variable definition, data type declaration, conditional statements (if, switch. case), loops

    (while, for), functions, arrays and strings, structures and union, bit operations, macros, etc.

    As assembly language programs are specific to a processor, assembly language didntoffer portability across systems. To overcome this disadvantage, several high level languages,

    including C, came up. Some other languages like PLM, Modula-2, Pascal, etc. also came but

    couldnt find wide acceptance. Amongst those, C got wide acceptance for not only embedded

    systems, but also for desktop applications. Even though C might have lost its sheen as

    mainstream language for general purpose applications, it still is having a strong-hold in

    embedded programming. Due to the wide acceptance ofC in the embedded systems, various

    kinds of support tools like compilers & cross-compilers, ICE, etc. came up and all this

    facilitated development ofembedded systems using C.

  • 7/30/2019 Remote Control Dimmer

    51/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 51

    CHAPTER-5

    CIRCUIT ANALYSIS

    5.1 BLOCK DIAGRAMS:

    5.1.1 BLOCK DIAGRAM OF POWER SUPPLY:

    Figure 5.1 Power supply block diagram

    A power supply may be implemented as a discrete, stand-alone device or as an integral

    device that is hardwired to its load. Examples of the latter case include the low voltage DC

    power supplies that are part of desktop computers and consumer electronics devices.The basic

    circuit diagram of a regulated power supply (DC O/P) with led connected as load.

    The components mainly used in above figure are

    230V AC MAINS

    TRANSFORMER

    BRIDGE RECTIFIER(DIODES)

    CAPACITOR

    VOLTAGE REGULATOR(IC 7805)

    RESISTOR

    LED(LIGHT EMITTING DIODE)

  • 7/30/2019 Remote Control Dimmer

    52/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 52

    5.2 Block Diagram of Remote control Dimmer:

    5.2.1 Transmitter

    Fig.5.2. Block Diagram of Transmitter

  • 7/30/2019 Remote Control Dimmer

    53/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 53

    5.2.2 Block Diagram Of Receiver

    Fig.5.3. Block Diagram Of Receiver

  • 7/30/2019 Remote Control Dimmer

    54/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 54

    5.3 CIRCUIT DIAGRAM

    5.3.1 POWER SUPPLY CIRCUIT DIAGRAM:

    Figure5.4 Power Supply Circuit Diagram

    Transformers are used to transform the primary to secondary windings which help to

    step up or step down the voltage. In the circuit above we have used a step down transformer

    which decreases the voltage from 230V to 12V. Then the signal is passed through the rectifier,

    which converts one form of energy into another form. Rectifier is of two types full wave and

    a half wave. After rectification the unwanted signal is removed using a filter. The voltage

    regulator maintains the output voltage at a constant value. 7805 provides +5V regulated power

    supply. Capacitors of suitable values can be connected at input and output pins dependingupon the respective voltage levels. By this the output voltage is maintained to 5V.

  • 7/30/2019 Remote Control Dimmer

    55/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 55

    5.3.2 TRANSMITTING CIRCUIT

    Fig:5.5 Transmitting circuit

  • 7/30/2019 Remote Control Dimmer

    56/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 56

    5.3.3 RECEIVING CIRCUIT

    Fig:5.6 Receiving circuit

  • 7/30/2019 Remote Control Dimmer

    57/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 57

    5.4 OPERATION:

    The entire circuit is supplied with 12 volts it is done by using a step down transformer

    connected to the mains supply. The 12 volts supply is then regulated to 5 volts with a 7805

    voltage regulator .The 5v output is given to the HT12 E encoder it will encodes the given databy using DIP and I is given to the RF transmitting module. The RF module transmits the

    given data to the RF receiver. It will receives and gives the output to the HT12D decoder. It

    will decodes the given data and sends it to the microcontroller . The micro controller gives the

    output to the L293D which acts like an H-bridge circuit. The output from the L293D is given

    to the LED.

    The code is debugged in the AVR studio software with EMBEDDED C language and

    is dumped in the micro controller. The sequence of steps which are used in the code are based

    on the EMBEDDED C language.

    The RF module will transmits the signals in the form of RF waves in to the space. For

    the correct reception we are using the DIP . DIP maintains a code value and it receives only

    the data from the respected transmitting section by using the code.

    By using the transmitter we can adjust the Intensity of the light. We can increase the

    intensity of light (or) we can decrease the intensity of light.

    The code is written in such a way that at the intensity may increase or decrease

    according to the operations given from the transmitter (or) remote.

  • 7/30/2019 Remote Control Dimmer

    58/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 58

    5.5 PROGRAM CODE

    CODE:

    /* REMOTE CONTROL DIMMER

    Active low switches

    PD0- decrease the intensity of light

    PD3- increase the intensity of light

    PD4- Indication of the decreased intensity

    PD5- Indication of the increased intensity

    PD6- IR sensor output

    */

    #ifndef sbi

    #define sbi(ADDRESS,BIT) (ADDRESS|=1

  • 7/30/2019 Remote Control Dimmer

    59/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 59

    OCR1A = 200;

    TCCR1A = 0x82;

    TCCR1B = 0x19; //Fast PWM

    }

    void main()

    {

    DDRD=0x00;

    DDRC=0x00;

    DDRB=0xFF;

    //init_timer1();

    PORTD=0xFF;

    PORTB=0xFF;

    PORTC=0x00;

    _delay_ms(1000);

    while(1)

    {

    PORTB=0x00;

    If(!rbi(PIND,0))

    decrease_the_light intensity();if(!rbi(PIND,3))

    increase_the_light intensity();

    }

    }

    void decrease_the_light intensity()

    {

    while(rbi(PINC,4))

    {

    if(rbi(PINC,0))

    PORTB=0x01;

    else

    {

  • 7/30/2019 Remote Control Dimmer

    60/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 60

    while(rbi(PINC,5))

    PORTB=0x02;

    break;

    }

    }

    }

    void increase_the_light intensity ()

    {

    while(rbi(PINC,5))

    PORTB=0x02;

    }

  • 7/30/2019 Remote Control Dimmer

    61/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 61

    CHAPTER 6

    RESULT ANALYSIS

    6.1 Results:

  • 7/30/2019 Remote Control Dimmer

    62/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 62

    6.2 Applications:

    Industries:

    Many people use RF solutions for monitoring, process, control, inventory

    tracking, data links and bar code reading devices.

    Commercial wireless applications:

    Such as door announcers, security and access systems, gate control,

    remote activation, score board and paging systems.

    Automotive companies:

    Many of them employ RF for wireless remote control, remote keyless

    entry and safety applications.

    Consumer products:

    Including electronic toys, home security, gate and garage door openers,intercom, fire and safety systems and irrigation controllers

    Medical products :Patient call and monitoring, handicap assistance device, surgery

    communication system, remote patient data logging and ECG monitor

    6.3 Advantages

    Speed and direction control from remote place

    Speed level and direction display on LCD Reliable and Easy to operate

    Scopes for Advancement:

    Tachometer can be developed to measure the speed using reed switch

    6.4 Disadvantages

    Initial cost is high

    It gets affected by climatic disturbances

  • 7/30/2019 Remote Control Dimmer

    63/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 63

    CHAPTER 7

    CONCLUSION:

    It is an automated device since the RF transmission and reception is handled by the

    micro controller the entire code for this operation of the micro controller is debugged in the

    AVR studio software and also here we have learnt regarding the Micro Controller ATMEGA8

    working and its applications .Here we have used the encoders, decoders and also the voltage

    regulators .The interface between the Micro controller and RF module is learnt i.e. I2C bus

    interface made between this two components was learnt and also observed in the circuit. The

    language which was used for the coding of the program in the Micro Controller is Embedded

    C. It was learnt and also the code was dumped in the micro controller.

  • 7/30/2019 Remote Control Dimmer

    64/65

    REMOTE CONTROL DIMMER

    E.C.E Dept., ALIET. Page 64

    CHAPTER 8

    FUTURE SCOPE & FURTHER DEVELOPMENTS

    ADDING A CAMERA:

    For the purpose of security system cameras is being used at the shutter openers.

    ZIGBEE MODULE:

    Zigbee module is replaced in place of RF module for long distance transmission or

    large coverage area.

    HIGH VOLATGE DC MOTORS:

    In order to meet the practical applications high voltage dc motors is being used.

  • 7/30/2019 Remote Control Dimmer

    65/65

    REMOTE CONTROL DIMMER

    CHAPTER 9

    BIBILOGRAPHY

    1. Mastering serial communications-Peter- W. Gafton.2. An Embedded Software Primer David E. Simon.

    3. Introduction to Embedded Systems Raj Kamal.

    4. www.atmel.com

    5. www.stepperworld.com

    6. www.engineergarage.com

    7. www.nationalsemiconductor.com

    8. www.datasheetachieved.com