26-10-2016, 02:34 PM
1461391915-SMSbasedelectricalappliancesapparatuscontrolinhomes.docx (Size: 1.9 MB / Downloads: 3)
INTRODUCTION
1.1 BACK GROUND OF THE PROBLEM
In this competitive world human cannot spare his time to perform his daily activities manually without any fail. The most important thing he forgets is to switch off the room lights wherever not required. With this, even the power will be wasted up to some extent. This can be seen more effectively in the case of lights, fans. This project gives the best solution for electrical power wastage. Also the manual operation is completely eliminated.
Problem Statement & Motivation
As mentioned earlier, latest technology offers us this flexibility. We wish to take advantage of this project.
The project SMS based electrical appliances apparatus control in homes or offices is an exclusive project which allows the user to control the electrical loads in homes or offices just by sending predefined messages to the controlling system.
1.2 AIM & OBJECTIVE OF THE STUDY
The project SMS based electrical appliances apparatus control in homes or offices is an exclusive project which allows the user to control the electrical loads in homes or offices just by sending predefined messages to the controlling system. A buzzer is provided for audio effect of switch bounce. Whenever a switch is pressed, the system acknowledges the bounce by a short beep sound. LCD is used to display the number of votes gained by each contestant and the related messages.
1.3 THESIS ORGANISATION
The thesis explains the implementation of “SMS based electrical appliances apparatus control in homes of offices” using ATmega8 Microcontroller. The organization of the thesis is explained here
Chapter 1: Presents introduction to the overall thesis and the overview of the project. In the project overview, a brief introduction to SMS based electrical appliances apparatus control in homes or offices and its applications are discussed.
Chapter 2: Presents the Project requirements. It explains the hardware and software requirements and its description of the project.
Chapter 3: Presents the Project Design. It deals with the Block diagram and functioning and working of each block. And also the circuit specification, designing steps and also working of it discussed in this.
Chapter 4: Block diagram
Chapter 5: project execution
Chapter 6: Presents the conclusion and future scope of the project
CHAPTER 2
PROJECT REQUIREMENTS
2.1 Hardware Requirements:
This chapter deals with the project requirement. It explains the hardware and software requirements and its description of the project.
The main components used in the project are:
1. Microcontroller (Atmega8).
2. GSM module.
3. MAX 232.
4. Power supply.
5. LDR.
6. LED.
2.1.1 Microcontroller:
A quick look on the market reveals there are tons of micros available.
Some of them which we have narrowed down are
1) AVR ATMega8 microcontroller Series
2) 8051 Series
3) PIC microcontroller Series
4) ARM Series
AVR has got advanced features combined with rich instructions and architecture. Hence we have used AVR as the controller. There are minimum six requirements for proper operation of microcontroller.
Those are:
1) power supply section
2) ports
3) Reset circuit
4) Crystal circuit
5) ISP circuit (for program dumping)
For this project we are using AVR microcontroller. We can use transistors instead of microcontroller and even transistors are cheap also in comparison to microcontroller but the reason behind using the microcontroller is we are in learning phase. One reason also stand for using microcontroller is that if we have used transistor, circuit would have been very complexed. This is because we prefer to use microcontroller.
2.1.2 I/O Port
Microcontrollers usually have special hardware for dealing with outside world. These are called I\O ports. We normally use I\O ports to interface the microcontrollers to sensors, actuators etc.
Microcontroller input\output is always logic high or logic low in terms of voltage. If logic high, it means +5 V and if logic low, it means 0 V. All AVR ports have true Read-Modify-Write functionality when used as general digital I/O ports.
This means that the direction of one port pin can be changed without unintentionally changing direction of any other pins. Each output buffer has symmetrical drive characteristics with both high sink and source capability. The pin driver is strong enough to drive LED displays directly. All port pins have individually selectable pull-up resistors with a supply-voltage invariant resistance.
In AVR microcontroller there are three I\O ports named B, C & D. The port B & D has 8 pins or bits and the port C has 7 pins. All the bits of any these said ports, we can use as both I\O port. In this above said system we’ll use port D as input and port B as output. This is shown in the circuit diagram
Features
• High-performance, Low-power AVR® 8-bit Microcontroller
• Advanced RISC Architecture
– 130 Powerful Instructions – 2.1.3
Most Single-clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 16 MIPS Throughput at 16 MHz
– On-chip 2-cycle Multiplier
• Nonvolatile Program and Data Memories
– 8K Bytes of In-System Self-Programmable Flash
Endurance: 10,000 Write/Erase Cycles
– Optional Boot Code Section with Independent Lock Bits In-System Programming by on-chip Boot Program True Read-While-Write Operation
– 512 Bytes EEPROM
Endurance: 100,000 Write/Erase Cycles
– 1K Byte Internal SRAM
– Programming Lock for Software Security
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
– Real Time Counter with Separate Oscillator
– Three PWM Channels
– 8-channel ADC in TQFP and MLF package
Six Channels 10-bit Accuracy
Two Channels 8-bit Accuracy
– 6-channel ADC in PDIP package Four Channels 10-bit Accuracy Two Channels 8-bit Accuracy
– Byte-oriented Two-wire Serial Interface
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and
Standby
• I/O and Packages
– 23 Programmable I/O Lines
– 28-lead PDIP, 32-lead TQFP, and 32-pad MLF
• Operating Voltages
– 2.7 - 5.5V (ATmega8L)
– 4.5 - 5.5V (ATmega8)
• Speed Grades
– 0 - 8 MHz (ATmega8L)
– 0 - 16 MHz (ATmega8)
• Power Consumption at 4 MHz, 3V, 25°C
– Active: 3.6 mA
– Idle Mode: 1.0 mA
– Power-down Mode: 0.5 µA
The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC Microcontrollers.
The ATmega8 provides the following features: 8K bytes of In-System Programmable Flash with Read-While-Write capabilities, 512 bytes of EEPROM, 1K byte of SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte oriented Two wire Serial Interface, a 6-channel ADC (eight channels in TQFP and QFN/MLF packages) with 10-bit accuracy, a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and five software selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM; Timer/Counters, SPI port, and interrupt system to continue functioning.
The Power down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next Interrupt or Hardware Reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping.
The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low-power consumption.
The device is manufactured using Atmel’s high density non-volatile memory technology. The Flash Program memory can be reprogrammed In-System through an SPI serial interface, by a conventional non-volatile memory programmer, or by an On-chip boot program running on the AVR core. The boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash Section will continue to run while the Application Flash Section is updated, providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel ATmega8 is a powerful microcontroller that provides a highly-flexible and cost-effective solution to many embedded control applications.
The ATmega8 AVR is supported with a full suite of program and system development tools, including C compilers, macro assemblers, program debugger/simulators, In-Circuit Emulators, and evaluation kits
Pin Descriptions
VCC
Digital supply voltage.
GND
Ground.
Port B (PB7..PB0) XTAL1/XTAL2/TOSC1/TOSC2
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.
Depending on the clock selection fuse settings, PB6 can be used as input to the inverting Oscillator amplifier and input to the internal clock operating circuit.
Depending on the clock selection fuse settings, PB7 can be used as output from the inverting Oscillator amplifier.
If the Internal Calibrated RC Oscillator is used as chip clock source, PB7..6 is used as TOSC2..1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.
Port C (PC5..PC0)
Port C is an 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running.
PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical characteristics of PC6 differ from those of the other pins of Port C. If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level on this pin for longer than the minimum pulse length will generate a Reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a Reset.
Port D (PD7..PD0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port D also serves the functions of various special features of the ATmega8.
RESET
Reset input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a reset.
AVCC
AVCC is the supply voltage pin for the A/D Converter, Port C (3..0), and ADC (7..6). It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. Note that Port C (5..4) use digital supply voltage, VCC.
AREF
AREF is the analog reference pin for the A/D Converter.
Configuring the Pin
Each port pin consists of 3 Register bits: DDxn, PORTxn, and PINxn.The DDxn bits are accessed at the DDRx I/O address, the PORTxn bits at the PORTx I/O address, and the PINxn bits at the PINx I/O address.
The DDxn bit in the DDRx Register selects the direction of this pin. If DDxn is written logic one, Pxn is configured as an output pin. If DDxn is written logic zero, Pxn is configured as an input pin.
If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor is activated. To switch the pull-up resistor off, PORTxn has to be written logic zero or the pin has to be configured as an output pin. The port pins are tri-stated when a reset condition becomes active, even if no clocks are running.
If PORTxn is written logic one when the pin is configured as an output pin, the port pin is driven high (one). If PORTxn is written logic zero when the pin is configured as an output pin, the port pin is driven low (zero).
When switching between tri-state ({DDxn, PORTxn} = 0b00) and output high ({DDxn, PORTxn} = 0b11), an intermediate state with either pull-up enabled ({DDxn, PORTxn} = 0b01) or output low ({DDxn, PORTxn} = 0b10) must occur. Normally, the pull-up enabled state is fully acceptable, as a high-impedant environment will not notice the difference between strong high drivers.
Reading the Pin Value
Independent of the setting of Data Direction bit DDxn, the port pin can be read through the PINxn Register Bit. The PINxn Register bit and the preceding latch constitute a synchronizer. This is needed to avoid metastability if the physical pin changes value near the edge of the internal clock, but it also introduces a delay.
ADVANTAGES:
• LED’s have many advantages over other technologies like lasers. As compared to laser diodes or IR sources
• LED’s are conventional incandescent lamps. For one thing, they don't have a filament that will burn out, so they last much longer. Additionally, their small plastic bulb makes them a lot more durable. They also fit more easily into modern electronic circuits.
• The main advantage is efficiency. In conventional incandescent bulbs, the light-production process involves generating a lot of heat (the filament must be warmed). Unless you're using the lamp as a heater, because a huge portion of the available electricity isn't going toward producing visible light.
• LED’s generate very little heat. A much higher percentage of the electrical power is going directly for generating light, which cuts down the electricity demands considerably.
• LED’s offer advantages such as low cost and long service life. Moreover LED’s have very low power consumption and are easy to maintain.
DISADVANTAGES OF LEDS:
• LED’s performance largely depends on the ambient temperature of the operating environment.
• LED’s must be supplied with the correct current.
• LED’s do not approximate a "point source" of light, so cannot be used in applications needing a highly collimated beam.
But the disadvantages are quite negligible as the negative properties of LED’s do not apply and the advantages far exceed the limitations.
2.1.8. REGULATOR:
Voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. Now from the given datasheet we can see that we are obtaining 5V and current of 500mA fron this regulator.