Sie sind auf Seite 1von 37

Device Control Using Bluetooth

BY AADIL TAHIR

JULY 2012

ABSTRACT In the present world, with emerging technologies, desires for having the Smart Home are becoming a reality. It is capable of facilitating occupants need in managing the home appliances with ease like remotely switching appliances on/off , controlling home surveillance, opening/closing gate ,watering in/outdoor plant, etc. making lives easier. Most elderly and handicap people will gain most benefit from this, i.e. just by sitting in the wheelchair, watching through windows; they can open the gate for arriving guests without needing to go to the main gate. This cost-effective project, providing solution to these, differs from similar projects in view of its simplicity and an entirely different concept of generating control signals. This circuitry system is used for controlling a home appliance circuit by Bluetooth module and Symbian OS mobile. In this device we mainly use a mobile phone having Symbian OS facility such like N-series Nokia mobiles. This mobile phone that we using as remote to controlling the circuitry system. We use a blue tooth module as receiver. In this circuit diagram it is show that a microcontroller is embedded with the Bluetooth module, and this is pre-programmed for controlling the circuitry. And there is also a Relay driver IC for passing the output of the microcontroller to the relay circuit.

CONTENTS

1 1.1 1.2 1.3 1.4

INTRODUCTION .................................................................................. Error! Bookmark not defined. Project Background ............................................................................. Error! Bookmark not defined. Project Objective ................................................................................. Error! Bookmark not defined. Project Scope ....................................................................................... Error! Bookmark not defined. Proposed Approach and Methodology ................................................................................................. 1 Layout of the Project Report....1 LITERATURE REVIEW ........................................................................................................................ 1 2.1 2.2 Technology ........................................................................................................................................... 1 Description of Different Components .................................................................................................. 1 PROJECT MANAGEMENT ................................................................................................................... 1 3.1 3.2 Required Resources .............................................................................................................................. 1 Project Plan .......................................................................................................................................... 1 SCHEMATIC DESIGN & DEVELOPMENT ........................................................................................ 1

1.5
2

4.1 PCB Design And Implementation1


5 7 8 8.1 8.2 9 10 11 TESTING AND INTEGRATION ........................................................................................................... 1 CRITICAL REVIEW AND REFLECTION ............................................................................................ 1 CONCLUSION AND FUTURE ENHANCEMENTS ............................................................................ 1 Conclusion............................................................................................................................................ 1 Future enhancements ............................................................................................................................ 1 REFERENCES ........................................................................................................................................ 1 APPENDICES ......................................................................................................................................... 1 GLOSSARY ............................................................................................................................................ 1

LIST OF FIGURES u 1 Block Diagram of proposed system design

Figure 2 Screen shots of Bluetooth control application on mobile phone.


Figure 3 Basic Layout of Microcontroller

Figure 4 Figure 5

20 pin PDIP of microcontrooler\ block diagram of Microcontroller

Figure 5.1. Oscillator Connections Figure 5.2. External Clock Drive Configuration
Figure 7 programming the flash memory of AT89C2051

Figure 7.1 Verifying the flash memory Figure 8 SIP Module Figure 9 PIN description of IC ULN2803

Figure 10 Relay Coil & Switch Contact with Circuit Symbol & Protection Diode Figure 11 SPDT Relay Figure 12 Schematic of Proposed module Figure 13 COMPONENT LAYOUT Figure 13 PCB layout of Hardware module

Figure 13.1 Component description of Hardware Module

INTRODUCTION Project Background As we utilize more and more electronic devices at home, controlling them becomes an important issue. No one would want to keep dozens of remote controls for various devices of the home entertainment system or other electrical appliances. Its easy for us to wrongly match the remote control and the device. If we can control all these appliances by just a single remote control, our life will definitely be much simpler and better. Just imagine how convenient our life would be if we could switch off the living rooms light or air-conditioner from our bedroom which we tend to forget switching them off. With difficulty in catching up with the fast moving pace of emerging technology and lack of exposure to computer for most elderly and handicap people, the need to come out with simple design for controlling appliances is crucial. From the design point of view, this project will offer the simplicity to the target users; elderly and handicap people. Since people use mobile phones in their daily life, it is the most common or user-friendly to almost everyone. By installing a simple application in in our mobile phone, almost all the elderly will get benefits from this simple design of controlling appliances as to operate this product is as simple as clicking for a picture. PROJECT OBJECTIVE The objective of this project is to design and implement a remote control unit which makes use of the Bluetooth technology to control up to 8 various electrical appliances. It can be used to switch appliances without going for separate remote controls for each of them. This project will involve research on the microcontrollers, Bluetooth modules and comparison of various available control methods to understand how we can employ and to integrate them into whole remote control design. The academic goal of this project is to develop skills in combination of research, design and analysis. Other goals are to improve project management, presentation and problem solving skills. PROJECT SCOPE The following is a list of expected end products and other deliverables. Transmitter module:

a) An application in our mobile phone will generate control signals. b) These control signals will be transmitted by Bluetooth module of mobile phone. Receiver module:

a) The transmitted signals will be received by a receiver Bluetooth module. b) The received control signal will control the operation of microcontroller. c) The microcontroller will generate instructions to control relays, which in turn control various appliances. Project poster for showcasing objectives to the students and faculties members. Design documentation to outline technical specifications and systems functionalities. Final report for documentations on the whole project including; testing until end results; success or failures, etc.

PROPOSED APPROACH AND METHODOLOGY

1 Block Diagram of proposed system design

LAYOUT OF THE PROJECT REPORT This report consists of the following eight chapters: Chapter 1: Introduction This chapter illustrates the project background, aim and scope. Chapter 2: Literature Review This chapter illustrates the background of different components necessary for building prototype. Chapter 3: Project Management This chapter illustrates the methodology of project management and project planning. Chapter 4: Schematic Design & Development This chapter discusses the hardware development of the each and every subsystem with final integration of the whole system. Chapter 5: Testing and Integration This chapter shows test carried out for remote controls with test results & illustrations. Chapter 6: Challenges and Results This chapter discusses the problems encountered during the implementation of the project and the solutions. Chapter 7: Critical Review and Reflection The illustration on my progress with this project and how I overcome the problems encountered and what I had learnt through out. Chapter 8: Conclusion and Future Enhancements This chapter illustrates the conclusion and highlights possible future enhancements.

CHAPTER 2 2 LITERATURE REVIEW

In this project we make mobile phone to act as transmitter & microcontroller will acts as receiver. The Data transmission between transmitter & receiver is taking through the Bluetooth module. The status from the relay is transmitted to mobile through Bluetooth module and process of controlling is taking place in mobile phone which is our controller. TECHNOLOGY USED: BLUETOOTH Bluetooth is a specification for a small form-factor, low-cost radio solution providing links between mobile computers, mobile phones and other portable handheld devices, and connectivity to the Internet. It will enable users to connect a wide range of computing and telecommunications devices easily and simply, without the need to buy, carry, or connect cables.It is a wireless technology that operates on an unlicensed radio spectrum. There is no charge for communicating between two Bluetooth devices. Bluetooth is intended to get around the problems that come with both infrared and cable synchronizing systems. The hardware vendors, which include Siemens, Intel, Toshiba, Motorola and Ericsson, have developed a specification for a very small radio module to be built into computer, telephone and entertainment equipment. From the users point of view, there are three Important features to Bluetooth: 1. xIts wireless. When you travel, you dont have to worry about keeping track of a briefcase full of cables to attach all of your components, and you can design your office without wondering where all the wires will go. 2. xIts inexpensive. 3. xYou dont have to think about it. Bluetooth doesnt require you to do anything special to make it work. The devices find one another and strike up a conversation without any user input at all. It is a wireless protocol that is used to communicate from one device to another in a small area usually less than 30 feet. Bluetooth communicates on a frequency of 2.45 gigahertz, which has been set aside by international agreement for the use of industrial, scientific and medical devices (ISM). Bluetooths founding members include Ericsson, IBM, Intel, Nokia and Toshiba. Bluetooth was designed to allow low bandwidth wireless connections to become so simple to use that they seamlessly integrate into your daily life. A simple example of a Bluetooth application is updating the phone directory of your mobile phone. Today, you would have to either manually enter the names and phone numbers of all your contacts or use a cable or IR link between your phone and your PC and start an application to synchronize the contact information. With Bluetooth, this could all happen automatically and without any user involvement as son as the phone comes within range of the PC! Of course, you can easily see this expanding to include your calendar, to do list, memos, email, etc. This is just one of many exciting applications for this new technology! Can you imagine walking into a store and having all the sale items automatically available on your cell phone or PDA? It is a definite possibility with Bluetooth System Architecture Bluetooth communication occurs in the unlicensed ISM band at 2.4 GHz. This is an unlicensed band and, in most countries, includes the frequency range from 2400 to 2483.5 MHz of course, as always when dealing with international standards, there are a few exceptions. The primary geographies with exceptions are France (2446.5 to 2483.5 MHz) and Spain (2445 to 2475 MHz). The transceiver utilizes frequency hopping to reduce interference and fading. A typical Bluetooth device has a range of about 10 meters. The communication channel can support both data (asynchronous) and voice (synchronous) communications with a total bandwidth of 1 Mb/sec. The supported channel configurations are as follows:

Configuration 3 Simultaneous Voice Channels Symmetric Data Asymmetric Data

Max. Data Rate Upstream 64 kb/sec X3 channels

Max. Data Rate Downstream 64 kb/sec X3 channels

433.9 kb/sec 723.2 kb/sec or 57.6 kb/sec

433,9 kb/sec 57.6 kb/sec or 723.2 kb/sec

The synchronous voice channels are provided using circuit switching with a slot reservation at fixed intervals. A synchronous link is referred to as an SCO (synchronous connection-oriented) link. The asynchronous data channels are provided using packet switching utilizing a polling access scheme. An asynchronous link is referred to as an ACL (asynchronous connection-less) link. A combined data-voice SCO packet is also defined. This can provide 64 kb/sec voice and 64 kb/sec data in each direction. Bluetooth devices can interact with one or more other Bluetooth devices in several different ways. The simplest scheme is when only two devices are involved. This is referred to as point-topoint. One of the devices acts as the master and the other as a slave. This ad-hoc network is referred to as a piconet. Blu tooth V s ons Bluetooth as a technology is getting upgraded day by day, started from version 1.0, 1.1, 1.2, 2.0 etc Current popular Bluetooth versions are 1.2 & 2.0, the major difference between these two are the speed, please find the chart below.

Bluetooth 1.0 and 1.0B Versions 1.0 and 1.0B had many problems, and manufacturers had difficulty making their products interoperable. Versions 1.0 and 1.0B also included mandatory Bluetooth hardware device address (BD_ADDR) transmission in the Connecting process (rendering anonymity impossible at the protocol level), which was a major setback for certain services planned for use in Bluetooth environments.

Bluetooth 1.1 Ratified as IEEE Standard 802.15.1-2002. 1. 2. 3. Many errors found in the 1.0B specifications were fixed. Added support for non-encrypted channels. Received Signal Strength Indicator (RSSI).

Bluetooth 1.2 This version is backward compatible with 1.1 and the major enhancements include the following: 1. 2. 3. 4. Faster Connection and Discovery Adaptive frequency-hopping spread spectrum (AFH), which improves resistance to radio frequency interference by avoiding the use of crowded frequencies in the hopping sequence. Higher transmission speeds in practice, up to 721 kbit/s, than in 1.1. Extended Synchronous Connections (eSCO), which improve voice quality of audio links by allowing retransmissions of corrupted packets, and may optionally increase audio latency to provide better support for concurrent data transfer. Host Controller Interface (HCI) support for three-wire UART. Ratified as IEEE Standard 802.15.1-2005. Introduced Flow Control and Retransmission Modes for L2CAP.

5. 6. 7.

Bluetooth 2.0 It is backward compatible with the previous version 1.2. The main difference is the introduction of an Enhanced Data Rate (EDR) for faster data transfer. The nominal rate of EDR is about 3 megabits per second, although the practical data transfer rate is 2.1 megabits per second. The additional throughput is obtained by using a different radio technology for transmission of the data. Standard, or Basic Rate, transmission uses Gaussian Frequency Shift Keying (GFSK) modulation of the radio signal with a gross air data rate of 1 Mbit/s. EDR uses a combination of GFSK and Phase Shift Keying modulation (PSK) with two variants, -DQPSK and 8DPSK. These have gross air data rates of 2, and 3 Mbit/s respectively. According to the 2.0 specification, EDR provides the following benefits: 1. 2. 3. Three times faster transmission speed up to 10 times (2.1 Mbit/s) in some cases. Reduced complexity of multiple simultaneous connections due to additional bandwidth. Lower power consumption through a reduced duty cycle.

The Bluetooth Special Interest Group (SIG) published the specification as "Bluetooth 2.0 + EDR" which implies that EDR is an optional feature. Aside from EDR, there are other minor improvements to the 2.0 specification, and products may claim compliance to "Bluetooth 2.0" without supporting the higher data rate. At least one commercial device, the HTC TyTN Pocket PC phone, states "Bluetooth 2.0 without EDR" on its data sheet. Bluetooth 2.1 Bluetooth Core Specification Version 2.1 is fully backward compatible with 1.2. This specification includes the following features: Extended Inquiry Response (EIR): provides more information during the inquiry procedure to allow better filtering of devices before connection. This information may include the name of the device, a list of services the device supports, the transmission power level used for inquiry responses, and manufacturer defined data.

Sniff Subrating: reduces the power consumption when devices are in the sniff lowpower mode, especially on links with asymmetric data flows. Human interface devices (HID) are expected to benefit the most, with mouse and keyboard devices increasing their battery life by a factor of 3 to 10. It lets devices decide how long they will wait before sending keepalive messages to one another. Previous Bluetooth implementations featured keep alive message frequencies of up to several times per second. In contrast, the 2.1 specification allows pairs of devices to negotiate this value between them to as infrequently as once every 5 or 10 seconds. Encryption Pause Resume (EPR): enables an encryption key to be changed with less management required by the Bluetooth host. Changing an encryption key must be done for a role switch of an encrypted an ACL link, or every 23.3 hours (one Bluetooth day) encryption is enabled on an ACL link. Before this feature was introduced, when an encryption key is refreshed the Bluetooth host would be notified of a brief gap in encryption while the new key was generated; so the Bluetooth host was required to handle pausing data transfer (however data requiring encryption may already have been sent before the notification that encryption is disabled has been received). With EPR, the Bluetooth host is not notified of the gap, and the Bluetooth controller ensures that no unencrypted data is transferred while they key is refreshed. Secure Simple Pairing (SSP): radically improves the pairing experience for Bluetooth devices, while increasing the use and strength of security. It is expected that this feature will significantly increase the use of Bluetooth. Near Field Communication (NFC) cooperation: automatic creation of secure Bluetooth connections when NFC radio interface is also available. This functionality is part of the Secure Simple Pairing where NFC is one way of exchanging pairing information. For example, a headset should be paired with a Bluetooth 2.1 phone including NFC just by bringing the two devices close to each other (a few centimeters). Another example is automatic uploading of photos from a mobile phone or camera to a digital picture frame just by bringing the phone or camera close to the frame. Bluetooth 3.0 Its main new feature is AMP (Alternate MAC/PHY), the addition of 802.11 as a high speed transport. Two technologies had been anticipated for AMP: 802.11 and UWB, but UWB is missing from the specification. Alternate MAC PHY: enables the use of alternative MAC and PHY's for transporting Bluetooth profile data. The Bluetooth Radio is still used for device discovery, initial connection and profile configuration, however when lots of data needs to be sent, the high speed alternate MAC PHY (802.11, typically associated with Wi-Fi) will be used to transport the data. This means that the proven low power connection models of Bluetooth are used when the system is idle, and the low power per bit radios are used when lots of data needs to be sent. Unicast Connectionless Data: permits service data to be sent without establishing an explicit L2CAP channel. It is intended for use by applications that require low latency between user action and reconnection/transmission of data. This is only appropriate for small amounts of data. Read Encryption Key Size: introduces a standard HCI command for a Bluetooth host to query the encryption key size on an encrypted ACL link. The encryption key size used on a link is required for the SIM Access Profile, so generally Bluetooth controllers provided this feature in a proprietary manner. Now the information is available over the standard HCI interface.

Description of Different Components This section will review on various types of components that are required in building this project such as: Control signal generation using mobile phone. Receiver Bluetooth module. Microcontroller AT 89c2051. SIP module.

IC ULN2803 to interface with Relays..


Relays.

Control signal generation using mobile phone.


The mobile phones are great boon to the humanity. The application makes it to be more served. SMART HOME application based on Bluetooth is a fully automated application. There are many disabled and aged people who always depend on others for their basic necessities. This application gives them a hand. With this application, a user can himself use the electrical appliances in his room. Without moving anywhere or without seeking anyone's help, the user himself feels a little independent. At first, the mobile phone is installed with the PYTHON run time file and also this application is installed. When the user wants to control a home appliance, he needs to open the application, and select the particular option. When the option is selected, the corresponding device gets operated. For working, the Bluetooth should be enabled. Bluetooth is an instant technology for short-range wireless connections and communications. This Bluetooth communications happens by an inbuilt device called as Bluetooth module. Each and every mobile phone of S60 series do have an inbuilt Bluetooth module inside. This Bluetooth module gets activated when the user switches the Bluetooth ON option. The method of enabling Bluetooth and finding the Blue-Home is explained by the screen shot. In the last screenshot, the enabled Bluetooth is shown clearly.

Figure 2 Screen shots of Bluetooth control application on mobile phone


To explain the working of this application more clearly, consider the Television as an example. After switching the Television ON, the entire control of the TV comes in our hand through the remote. Similarly, here the entire control of the house comes in the hands through the mobile phone. It is an embedded application which requires both the hardware and software to work. The hardware is microcontroller based and the software works on any NOKIA s60 mobile phones. With this application a disabled user can

Monitor and operate six home appliances. Give alarm to the guardian at times of emergency. Enable/Disable Automatic AC control Enable/Disable Automatic Room light control. Monitor three windows/doors

Receiver Bluetooth module


In the hardware section, we have a separate Bluetooth module connected which support SPP profile on it. This Bluetooth module will receive the information which is send from the mobile phone; (Perhaps both the modules are paired with each other, as like paralleling two Bluetooth enabled mobile phones) After receiving the information, it passes that information immediately to the Microcontroller to which it is connected. We can use any serial to Bluetooth module, there are lot of modules in the market. 1. 2. 3. BlueLINK BlueSMiRF Google it for more

BlueLINK BlueLINK is a compact Bluetooth Module ( 5V Serial TTL) from rhydoLABZ. The module is built with Voltage regulator and 3V3 to 5V level converter required to interface with 5V Micros. It is only having 5pins (Standard 2.54mm Bergsrip) VCC,GND,TX,RX and RESET. The module is factory configured in Transparent Mode. So there is no command required for normal operation. The BlueLINK is a Drop-in replacement for wired serial connections, transparent usage. You can use it simply for serial port replacement to establish connection between MCU and GPS, PC to your embedded project / Robot etc. Any serial stream from 9600 to 115200 bps can be passed seamlessly from your PC/PDA/MOBILE to your target board!

BlueLINK Bluetooth Module (Serial TTL) Features:

Support Master & Slave Mode 5PIN Standard Bergsrip Bluetooth core V2.0 compliant SPP (Serial Port Profile) support Support UART interface to host system Serial communications @ : 9600-115200bps No Setup/Initial command required Breadboard Compatible On-board Status and Power LED Encrypted connection Frequency: 2.4~2.524 GHz Built-in Chip antenna Power Supply: 5V Dimension: 55mm x 19mm x 3.2 mm Operating Temperature: -40 ~ +70C

PIN
GND

PIN NAME
GROUND PIN

DETAILS
GROUND LEVEL OF POWER SUPPLY

5V

POWER SUPPLY

5V LEVEL OF POWER SUPPLY

RXD

RECIEVER

PIN FOR DATA RECEPTION

TXD

TRANSMITTER

PIN FOR DATA TRANSMISSION

RST

RESET

RESET INPUT (INTERNALLY PULLED-UP)

MICROCONTROLLER A microcontroller (or MCU) is a computer-on-a-chip. It is a type of microprocessor emphasizing self-sufficiency and costeffectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC). The basic internal designs of microcontrollers are pretty similar. Figure1 shows the block diagram of a typical microcontroller. All components are connected via an internal bus and are all integrated on one chip. The modules are connected to the outside world via I/O pins.

Figure 3 Basic Layout of Microcontroller The following list contains the modules typically found in a microcontroller. Processor Core The CPU of the controller. It contains the arithmetic logic unit, the control unit, and the registers (stack pointer, program counter, accumulator register, register file . . .). Memory The memory is sometimes split into program memory and data memory. In larger controllers, a DMA controller handles data transfers between peripheral components and the memory. Interrupt Controller Interrupts are useful for interrupting the normal program flow in case of (important) external or internal events. In conjunction with sleep modes, they help to conserve power. Timer/Counter Most controllers have at least one and more likely 2-3 Timer/Counters, which can be used to timestamp events, measure intervals, or count events. Many controllers also contain PWM (pulse width modulation) outputs, which can be used to drive motors or for safe breaking (antilock brake system, ABS). Furthermore the PWM output can, in conjunction with an external filter, be used to realize a cheap digital/analog converter. Digital I/O Parallel digital I/O ports are one of the main features of microcontrollers. The number of I/O pins varies from 3-4 to over 90, depending on the controller family and the controller type. Analog I/O Apart from a few small controllers, most microcontrollers have integrated analog/digital converters, which differ in the number of channels (2-16) and their resolution (8-12 bits). The analog module also generally features an analog comparator. In some cases, the microcontroller includes digital/analog converters. The UART: What it is and how it works The Universal Asynchronous Receiver/Transmitter (UART) controller is the key component of the serial communications subsystem of a computer. The UART takes bytes of data and transmits the individual bits in a sequential fashion. At the destination, a second UART re-assembles the bits into complete bytes Serial transmission is commonly used with modems and for non-networked communication between computers, terminals and other devices. There are two primary forms of serial transmission: Synchronous and Asynchronous. Depending on the modes that are supported by the hardware, the name of the communication sub-system will usually include a A if it supports Asynchronous communications, and a S if it supports Synchronous communications. Both forms are described below. Synchronous Serial Transmission Synchronous serial transmission requires that the sender and receiver share a clock with one another, or that the sender provide a strobe or other timing signal so that the receiver knows when to read the next bit of the data. In most forms of serial Synchronous communication, if there is no data available at a given instant to transmit, a fill character must be sent instead so that data is always being transmitted. Synchronous communication is usually more efficient because only data bits are transmitted

between sender and receiver, and synchronous communication can be more costly if extra wiring and circuits are required to share a clock signal between the sender and receiver. A form of Synchronous transmission is used with printers and fixed disk devices in that the data is sent on one set of wires while a clock or strobe is sent on a different wire. Printers and fixed disk devices are not normally serial devices because most fixed disk interface standards send an entire word of data for each clock or strobe signal by using a separate wire for each bit of the word. In the PC industry, these are known as Parallel devices. The standard serial communications hardware in the PC does not support Synchronous operations. This mode is described here for comparison purposes only Asynchronous Serial Transmission Asynchronous transmission allows data to be transmitted without the sender having to send a clock signal to the receiver. Instead, the sender and receiver must agree on timing parameters in advance and special bits are added to each word which are used to synchronize the sending and receiving units. When a word is given to the UART for Asynchronous transmissions, a bit called the "Start Bit" is added to the beginning of each word that is to be transmitted. The Start Bit is used to alert the receiver that a word of data is about to be sent, and to force the clock in the receiver into synchronization with the clock in the transmitter. These two clocks must be accurate enough to not have the frequency drift by more than 10% during the transmission of the remaining bits in the word. (This requirement was set in the days of mechanical tele printers and is easily met by modern electronic equipment.) After the Start Bit, the individual bits of the word of data are sent, with the Least Significant Bit (LSB) being sent first. Each bit in the transmission is transmitted for exactly the same amount of time as all of the other bits, and the receiver looks at the wire at approximately halfway through the period assigned to each bit to determine if the bit is a 1 or a 0. For example, if it takes two seconds to send each bit, the receiver will examine the signal to determine if it is a 1 or a 0 after one second has passed, then it will wait two seconds and then examine the value of the next bit, and so on. The sender does not know when the receiver has looked at the value of the bit. The sender only knows when the clock says to begin transmitting the next bit of the word. When the entire data word has been sent, the transmitter may add a Parity Bit that the transmitter generates. The Parity Bit may be used by the receiver to perform simple error checking. Then at least one Stop Bit is sent by the transmitter. When the receiver has received all of the bits in the data word, it may check for the Parity Bits (both sender and receiver must agree on whether a Parity Bit is to be used), and then the receiver looks for a Stop Bit. If the Stop Bit does not appear when it is supposed to, the UART considers the entire word to be garbled and will report a Framing Error to the host processor when the data word is read. The usual cause of a Framing Error is that the sender and receiver clocks were not running at the same speed, or that the signal was interrupted. Regardless of whether the data was received correctly or not, the UART automatically discards the Start, Parity and Stop bits. If the sender and receiver are configured identically, these bits are not passed to the host. If another word is ready for transmission, the Start Bit for the new word can be sent as soon as the Stop Bit for the previous word has been sent.

AT89C2051 MICROCONTROLLER
Description The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytes of Flash programmable and erasable read-only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a power-ful microcomputer which provides a highly-flexible and costeffective solution to many embedded control applications. The AT89C2051 provides the following standard features: 2K bytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator and clock circuitry. In addition, the AT89C2051 is designed with static logic for opera-tion down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. Pin Configuration 20-lead PDIP/SOIC

Figure 4 Block Diagram

20 pin PDIP of microcontrooler

Figure 5 block diagram of Microcontroller


Pin Description

VCC Supply voltage GND Ground. Port 1 The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide internal pull-ups. P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog comparator. The Port 1 out-put buffers can sink 20 mA and can drive LED displays directly. When 1s are written to Port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are used as inputs and are externally pulled low, they will source current (IIL) because of the internal pull-ups. Port 1 also receives code data during Flash programming and verification. Port 3 Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible as a gen-eral-purpose I/O pin. The Port 3 output buffers can sink 20 mA. 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 also serves the functions of various special features of the AT89C2051 as listed below: Port 3 also receives some control signals for Flash programming and verification.

RST Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high for two machine cycles while the oscillator is running resets the device. Each machine cycle takes 12 oscillator or clock cycles. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier. Oscillator Characteristics The XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 5-1. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 5-2. There are no require-ments on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

Figure 6. Oscillator Connections Note: C1, C2 = 30 pF 10 pF for Crystals = 40 pF 10 pF for Ceramic Resonators Figure 7. External Clock Drive Configuration

Special Function Registers A map of the on-chip memory area called the Special Function Register (SFR) space is shown in the table below. Note that not all of the addresses are occupied, and unoccupied addresses may not be imple-mented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect. User software should not write 1s to these unlisted locations, since they may be used in future products to invoke new features. In that case, the reset or inactive values of the new bits will always be 0. Restrictions on Certain Instructions The AT89C2051 and is an economical and cost-effective member of Atmels growing family of microcontrollers. It contains 2K bytes of Flash program memory. It is fully compatible with the MCS-51 architecture, and can be programmed using the MCS-51 instruction set. However, there are a few considerations one must keep in mind when utilizing certain instructions to pro-gram this device. All the instructions related to jumping or branching should be restricted such that the destination address falls within the physical program memory space of the device, which is 2K for the AT89C2051. This should be the responsibility of the software programmer. For example, LJMP 7E0H would be a valid instruction for the AT89C2051 (with 2K of memory), whereas LJMP 900H would not. Idle Mode In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions regis-ters remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. The P1.0 and P1.1 should be set to 0 f no xt nal pull-ups a us d, o s t to 1 f xt nal pull-ups are used. It should be noted that when idle is terminated by a hardware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory. Power-down Mode In the power-down mode the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated. The only exit from power-down is a hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. Th P1.0 and P1.1 should b s t to 0 f no xt nal pull-ups a us d, o s t to 1 f external pull-ups are used. Programming The Flash The AT89C2051 is shipped with the 2K bytes of on-chip PEROM code memory array in the erased state (i.e., contents = FFH) and ready to be programmed. The code memory array is pro-grammed one byte at a time. Once the array is programmed, to re-program any non-blank byte, the entire memory array needs to be erased electrically. Internal Address Counter: The AT89C2051 contains an internal PEROM address counter which is always reset to 000H on the rising edge of RST and is advanced by applying a positive going pulse to pin XTAL1. Programming Algorithm: To program the AT89C2051, the following sequence is recommended. 1. Power-up sequence: Apply power between VCC and GND pins Set RST and XTAL1 to GND 2. Set pin RST to H Set pin P3.2 to H 3. Apply the appropriate combination of H or L logic levels to pins P3.3, P3.4, P3.5, P3.7 to select one of the programming operations shown in the PEROM Programming Modes table. To Program and Verify the Array: 4. Apply data for Code byte at location 000H to P1.0 to P1.7. 5. Raise RST to 12V to enable programming. 6. Pulse P3.2 once to program a byte in the PEROM array or the lock bits. The byte-write cycle is self-timed and typically takes 1.2 ms.

7. To verify the programmed data, lower RST from 12V to logic H level and set pins P3.3 to P3.7 to the appropriate levels. Output data can be read at the port P1 pins. 8. To program a byte at the next address location, pulse XTAL1 pin once to advance the internal address counter. Apply new data to the port P1 pins. 9. Repeat steps 6 through 8, changing data and advancing the address counter for the entire 2K bytes array or until the end of the object file is reached. 10. Power-off sequence: set XTAL1 to L set RST to L Turn VCC power off Data Polling: The AT89C2051 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the writ-ten data on P1.7. Once the write cycle has been completed, true data is valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated. Ready/Busy: The Progress of byte programming can also be monitored by the RDY/BSY output signal. Pin P3.1 is pulled low after P3.2 goes High during programming to indicate BUSY. P3.1 is pulled High again when programming is done to indicate READY. Program Verify: If lock bits LB1 and LB2 have not been programmed code data can be read back via the data lines for verification: 1. Reset the internal address counter to 000H by bringing RST from L to H. 2. Apply the appropriate control signals for Read Code data and read the output data at the port P1 pins. 3. Pulse pin XTAL1 once to advance the internal address counter. 4. Read the next code data byte at the port P1 pins. 5. Repeat steps 3 and 4 until the entire array is read. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled. Chip Erase: The entire PEROM array (2K bytes) and the two Lock Bits are erased electrically by using the proper combination of control signals and by holding P3.2 low for 10 ms. The code array is written with all 1s in the Chip Erase operation and must be executed before any non-blank memory byte can be re-programmed. Reading the Signature Bytes: The signature bytes are read by the same procedure as a nor-mal verification of locations 000H, 001H, and 002H, except that P3.5 and P3.7 must be pulled to a logic low. The values returned are as follows. (000H) = 1EH indicates manufactured by Atmel (001H) = 21H indicates 89C2051. Programming Interface Every code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self-timed and once initiated, will automatically time itself to completion. Programming the Flash Memory

Figure 7

programming the flash memory of AT89C2051

Verifying the Flash Memory

Figure 7.1 Verifying the flash memory PROGRAM CODE FOR MICROCONTROLLER INCLUDE REG_51.PDF LOAD1 EQU P1.0 LOAD2 EQU P1.1 LOAD3 EQU P1.2 LOAD4 EQU P1.3 LOAD5 EQU P1.4 LOAD6 EQU P1.5 LOAD7 EQU P1.6 LOAD8 EQU P1.7 DSEG ORG 20H MOBILE: DS 3 COUNTER: DS 1 ; This is internal data memory ; Bit addressable memory

CSEG ; Main routine. Program execution starts here. ORG 00H ; Reset AJMP MAIN

; Code begins here

ORG 0023H AJMP SERIAL MAIN: MOV SP, #40H MOV TMOD, #20H MOV TH1, #0FDH MOV SCON, #50H MOV A, PCON SETB ACC.7 MOV PCON, A MOV IE, #10010000B SETB TR1 MOV COUNTER, #00H MOV P1, #00H AJMP $ SERIAL: JB TI, TRAS1 MOV A, SBUF CJNE A, #'A', DOWNW MOV COUNTER, #00H AJMP DOWN1 TRAS1: AJMP TRAS ; Initialize serial port ; Select 9600 baud rate

;Start timer

DOWNW: CJNE A, #0AH, DOWNW1 CALL DEVICE_DECODE AJMP DOWN1 DOWNW1: MOV A, COUNTER CJNE A, #01H, SD1 MOV MOBILE, SBUF AJMP DOWN1 SD1: xCJNE A, #02H, DOWN1 MOV MOBILE+1, SBUF

DOWN1: INC COUNTER CLR RI RETI TRAS: CLR TI RETI DEVICE_DECODE: MOV A, MOBILE CJNE A, #31H, SDF1 MOV A, MOBILE+1 CJNE A, #31H, SDF2 SETB LOAD1 AJMP SDF1 SDF2: CJNE A, #32H, SDF1 ; LOAD1

CLR LOAD1 SDF1: MOV A, MOBILE CJNE A, #32H, SDF11 MOV A, MOBILE+1 CJNE A, #31H, SDF21 SETB LOAD2 AJMP SDF11 SDF21: CJNE A, #32H, SDF11 CLR LOAD2 ; LOAD2

SDF11: MOV A, MOBILE CJNE A, #33H, SDF12 MOV A, MOBILE+1 CJNE A, #31H, SDF22 SETB LOAD3 AJMP SDF12 SDF22: CJNE A, #32H, SDF12 CLR LOAD3 SDF12: MOV A, MOBILE CJNE A, #34H, SDF14 MOV A, MOBILE+1 CJNE A, #31H, SDF24 SETB LOAD4 AJMP SDF14 SDF24: CJNE A, #32H, SDF14 CLR LOAD4 SDF14: MOV A, MOBILE CJNE A, #35H, SDF15 MOV A, MOBILE+1 CJNE A, #31H, SDF25 SETB LOAD5 AJMP SDF15 SDF25: CJNE A, #32H, SDF15 CLR LOAD5 SDF15: MOV A, MOBILE CJNE A, #36H, SDF16 MOV A, MOBILE+1 CJNE A, #31H, SDF26 SETB LOAD6 AJMP SDF16

; LOAD3

; LOAD4

; LOAD5

; LOAD6

SDF26 CJNE A,#32H,SDF16 CLR LOAD6 SDF16 MOV A, MOBILE CJNE A, #37H, SDF17 MOV A, MOBILE+1 CJNE A, #31H, SDF27 SETB LOAD7 AJMP SDF17 SDF27: CJNE A,#32H,SDF17 CLR LOAD7 SDF17: MOV A, MOBILE CJNE A, #38H, SDF18 MOV A, MOBILE+1 CJNE A, #31H, SDF28 SETB LOAD8 AJMP SDF18 SDF28: CJNE A, #32H, SDF18 CLR LOAD8 SDF18: MOV A, MOBILE CJNE A, #39H, SDF19 MOV P1, #0FFH SDF19: MOV A, MOBILE CJNE A, #30H, SDF10 MOV P1, #00H SDF10: RET END

; LOAD7

; LOAD8

; LOAD8

; LOAD8

SIP module Bluetooth module cannot receive information in parallell. So the parallel information must be converted to serial data. SIP module is used to convert the parallel data from relay driver to serial data.

Figure 8 SIP Module

IC ULN2803 A ULN2803 is an Integrated Circuit (IC) chip with a High Voltage/High Current Darlington Transistor Array. It allows you to interface TTL signals with higher voltage/current loads. In English, the chip takes low level signals (TLL, CMOS, PMOS, NMOS - which operate at low voltages and low currents) and acts as a relay of sorts itself, switching on or off a higher level signal on the opposite side. A TTL signal operates from 0-5V, with everything between 0.0 and 0.8V considered "low" or off, and 2.2 to 5.0V being considered "high" or on. The maximum power available on a TTL signal depends on the type, but generally does not exceed 25mW (~5mA @ 5V), so it is not useful for providing power to something like a relay coil. Computers and other electronic devices frequently generate TTL signals. On the output side the ULN2803 is generally rated at 50V/500mA, so it can operate small loads directly. Alternatively, it is frequently used to power the coil of one or more relays, which in turn allow even higher voltages/currents to be controlled by the low level signal. In electrical terms, the ULN2803 uses the low level (TTL) signal to switch on/turn off the higher voltage/current signal on the output side. The ULN2803 comes in an 18-pin IC configuration and includes eight (8) transistors. Pins 1-8 receive the low level signals, pin 9 is grounded (for the low level signal reference). It needs to be connected to the same ground reference that the TTL input is using. Pin 10 is the "snubber diode" connection aka clamping aka protection diodes that Russ was talking about. This connects to the +V supply of the output.. Pins 11-18 are the outputs (Pin 1 drives Pin 18, Pin 2 drives 17, etc.) First, pin 9, the ground pin, needs to be connected to the same ground reference that the TTL input is using. PIN CONFIGURATION

From 1995 Dick Smith Catalogue Figure 9 PIN description of IC ULN2803

The ULN2803 Integrated Circuit (IC) is a "Eight-way Line Driver". The IC takes small current at its 8 input pins (pins 1 to 8) and allows much larger current (up to one amp) to flow via its output lines These Darlington drivers are "open collector"; they can sink current, but they cannot source current. They're used as a ground-side switch for all kinds of things; very popular with hobbyists to control stepper motors and relays - basically, higher current loads than standard TTL levels support. The 7.2k and 3k resistors keep the Darlington pair turned off when there is no current flowing into the base. When the transistors are off, there is no current being sunk from pin 18.

When a logic "1" (5v) is placed on pin 1, current flows through the 2.7k resistor to the base of the 1st transistor, turning it on. The 1st transistor in the pair is now supplying current to the 2nd transistor's base, turning it on, and it begins to sink current from the load connected to the output. Darlington transistors are used because the gains of the two transistors are multiplied. If both transistors have a gain of 20, 20*20=400, so an input current of 1mA can control a load current of 400mA.

RELAYS Relays are simple electromechanical switches that operate on electromagnetic principles. Typically, a relay contains a few simple parts that all join together to allow the relay to function. To control the opening and closing of the relay, each relay contains an electromagnet and an armature that actually opens and closes. Relays also contain a spring, which forces the relay back to its original state after each cycle, and a set of electrical contacts to transfer power. Relays are use when it's necessary to switch from a small amount to larger amount of power. They are also used to efficiently regulate the flow of energy in an application. Relays can also be placed in tandem, in order to "step up" to very high voltages. How a Relay Works : A relay is made up of two circuits. One circuit is the switch, which controls power to the

electromagnet that controls the relay. The armature is attracted to the contact point when the electromagnet turned on, and upon contact the armature completes the circuit. Once the circuit is completed, it allows the current to flow freely, activating whatever device the relay is designed to operate. When the first switch is turned off, the electromagnet loses power and thus stops attracting the armature. The second circuit opens when the spring pulls the armature away and is released from the contact point.

Figure 10 Relay Coil & Switch Contact with Circuit Symbol & Protection Diode

What to Know About Relays : There are a few things that we need to know before we can purchase the correct relay for a task. Not all relays are created equal, and small differences can create large mistakes if we don't plan carefully. First, figure out whether we want our device to be "always on" or "always off". This also might be known as "normally on" or "normally off." If we want the device on constantly, we'll need to select a relay where the armature is always in contact with the contact point and the electromagnet is used to pull it away and break the circuit. Normally off is the opposite. In order to avoid electrical mishaps, we'll also need to know the maximum voltage that we can put through the armature before it fails.

Figure 11 SPDT Relay The A, B and C terminals are an SPDT switch controlled by the electromagnet. When electricity is applied to V1 and V2, the electromagnet acts upon the SPDT switch so that the B and C terminals are connected. When the electricity is disconnected, then the A and C terminals are connected. It is important to note that the electromagnet is magnetically linked to the switch but the two are not linked electrically. Choosing a relay : As mentioned above, there are many aspects to look into when choosing a relay. Below are

some guidelines for me to consider when choosing relay for circuit: i. Switch contact arrangement (SPDT, DPDT etc) Most relays are SPDT or DPDT which are often described as single pole changeover (SPCO) or double pole changeover (DPCO).

ii. Coil voltage Another point to take note is the coil voltage rating and resistance which must suit the circuit powering the relay coil. Many relays have a coil rated for a 12V supply but 5V and 24V relays are also readily available. iii. Switch ratings (voltage and current) Relays switch contacts must be suitable for the circuit they are to control. Note that the voltage rating is usually higher for AC, for example: 5A at 24V DC or 125V AC. iv. Coil resistance The circuit must be able to supply the current required by the relay coil. Ohms law can be used to calculate the current:
Relay coil current = . supply voltage coil resistance

v. Physical size and pin arrangement When choosing a relay for an existing PCB, I will need to ensure that its dimensions and pin arrangement are suitable.

CHAPTER 3

PROJECT MANAGEMENT REQUIRED RESOURCES

For the project to be made possible, several resources were needed for the research. In order to build the system for my project, understanding the datasheet of every component in each subsystem is important. It is so as to make the right approach in the selection of the components. The resources used throughout this project are outlined below. UNIVERSITY FACILITY Library The access to Electronics library is a must. As most of our research and read up on the various types of application circuits and electronics project ideas came from the library shelf. Laboratory The Project Lab of Department Of Electronics, University Of Kashmir provide students with an environment where we can do testing and troubleshooting of our project. INTERNET BROADBAND The access to internet is very important as most researches could be done by a click of the mouse. It is especially essential as many datasheets are available in the World Wide Web for information from the suppliers. The Broadband connection will help speed up the downloading of the information we need. PROJECT PLAN

Precise planning since starting is an essential tool for the route to the success of the project. Time management factor is the rule of having a good graded project. The project plan was categorised into four main phases involving different tasks: i. ii. iii. iv. Literature research Design and Development Testing & Troubleshooting Documentation

i. During Literature research phase, as planned, it really took us 2 weeks plus (spent about 88hrs) to gather relevant information and study relevant systems & applications in order to gain more knowledge and confidence to build the correct foundation on the project approach and methodology. Concurrently, we had 3 meetings with supervisor for getting advice on the project plan and drafting out the plan. It took 1 week for the finalising of

project proposal and getting approval from the supervisor. For this whole phase, it took us about 100hr in total apart from family and work schedule. ii. For Design and Development phase, we scheduled one month (about 150hrs required) in total to produce the physical prototype of our project. In this phase we spent 1 week for identification of components required for different subsystems. After identifying, wed set 2 weeks to figure out necessary mapping for accomplishment of design and analysis. We started the actual product development in May 2012. iii. For the Testing and Troubleshooting phase which was the most challenging phase, we started in the mid of May 2012 once after the development phase started, while partially finished sub systems were tested, and evaluated the outcomes of each stage in accordance to our target goal. we spent more than 80hrs which we had planned earlier for this phase because of some modification in the system design. iv. Documentation was done throughout the whole project, concurrently with every task performed, since the very beginning. We used about 15 min to half an hour daily recording down in project diary for documentation purpose. So total hours scheduled mainly for documentation was about 20hrs including preparation of oral presentation. Apart from the precise planning, We tried meeting with our supervisor or communicating via phone or email regularly keeping him updated of our progress which allowed him to access our performance. Overall, this whole project required about 170hrs (40 main-days) to accomplish.

CHAPTER 4 SCHEMATIC DESIGN & DEVELOPMENT

Figure 12 Schematic of Proposed module


For the design phase, firstly, we performed the study on each and individual components to be used in the whole system and perform characteristics comparison on alternative components available in the market before selections and purchases were made. Concurrently to the development phase, testing of functionality for each subsystem were done separately before combining as a whole. Hence, necessary actions or corrections were made possible while testing each sub system. Communication through Bluetooth module is the basic principle used in this circuit. Here Bluetooth module and mobile phone will act as a Trans receiver. Mobile Phone will give instruction to microcontroller through Bluetooth module. For controlling the relay circuit and it will receive information from microcontroller through Bluetooth Module about the status of the relay. The Bluetooth module will receive data from both Mobile phone & microcontroller. The BlueLINK Bluetooth module is used here. Mobile phone operation will be controlled by the python software which is installed in the mobile phone. The relay is controlled by the programmed AT 89c2051Microcontroller. ULN2803 is the IC we are using to drive the relay. Bluetooth module cannot receive information parallelly. So the parallel Information must convert to serial data. So a SIP is used which convert the parallel data from relay driver to serial data. The instruction from mobile phone will be received by Bluetooth module

and transfer it to microcontroller and the microcontroller will send this data to relay driver and will Control the relay. The relay will send the status to micro controller and will convert data in to serial and transfer it to mobile phone through Bluetooth module. PCB LAYOUT

Figure 13

PCB layout of Hardware module

COMPONENT LAYOUT

Figure 13.1 Component description of Hardware Module PCB PREPARATION TECHNIQUES PCB Preparation You need to generate a positive (copper black) UV translucent art work film. You will never get a good board without good art work, so it is important to get the best possible quality at this stage. The most important thing is to get a clear sharp image with a very solid opaque black. Art work is done using ORCAD software. It is absolutely essential that your PCB software prints holes in the middle of pads, which will act as centre marks when drilling. It is virtually impossible to accurately hand-drill boards without these holes. If you are looking to buy PCB software at any cost level and want to do hand-protyping of boards before production, check that this facility is available when defining pad and line shapes, the minimum size recommended (through-linking holes) for reliable result is 50 mil, assuming 0.8mm drill size; 1 mil=(1/1000)th of an inch. You can go smaller drill sizes, but through linking will be harder. 65mil round or square pads for normal components.ICs, with 0.8 mm hole, will allow a 12.5mil, down to 10mil if you really need to. Centre-to-centre spacing of 12.5 mil tracks should be 25 mil-slightly less may be possible if your printer can manage it. Take care to preserve the correct diagonal track spacing on mitered corners; grid is 25 mil and track width 12.5mil. The art work must be printed such that the printed side is in contact with PCB surface when exposing, to avoid blurred edges. In practice, this means that if you design the board as seen from the component side, the bottom (solder side) layer should be printed the correct way round, and top side of the double-sided board must be printed mirrored. Etching Ferric chloride etchant is a messy stuff, but easily available and cheaper than most alternatives. It attacks any metal including stainless steel. So when setting up a PCB etching area, use a plastic or ceramic sink, with plastic fitting and screws wherever possible, and seal any metal screws with silicon. Copper water pipes may be splashed or dripped-on, so sleeve or cover them in plastic; heat-shrink sleeving is great if you are installing new pipes. Fume extraction is not normally required, although a cover over the tank or tray when not in use is a good idea. You should always use the hex hydrate type of ferric chloride, which should be dissolved in warm water until saturation. Adding a teaspoon of table salt helps to make the etchant clearer for easier inspection. Avoid anhydrous ferric chloride. It creates a lot of

heat when dissolved. So always add the powder very slowly to water; do not add water to the powder, and use gloves and safety glasses. The solution made from anhydrous ferric chloride doesnt etch at all, so you need to add a small amount of hydrochloric acid and leave it for a day or two. Always take extreme care to avoid splashing when dissolving either type of ferric chloride, acid tends to clump together and you often get big chunks coming out of the container and splashing into the solution. It can damage eyes and permanently stain clothing. If you are making PCBs in a professional environment where time is money you should get a heated bubble etch tank. With fresh hot ferric chloride, the PCB will etch in well under 5 mins. Fast etching produces better edge-quality and consistent line widths. If you arent using a bubble tank, you need to agitate frequently to ensure even etching. Warm the etchant by putting the etching tray inside a larger tray filled with boiling water. Drilling If you have fibre glass (FR4) board, you must use tungsten carbide drill bits.Fiber glass eats normal high-speed steel (HSS) bits very rapidly, although HSS drills area right for older larger sizes (> 2mm). Carbide drill bits are available as straight-shank or thick-shank. In straight shank, the hole bit is the diameter of the hole, and in thick shank, a standard size (typically about 3.5 mm) shank tapers down to the hole size. The straight shank drills are usually preferred because they break less easily and are usually cheaper. The longer thin section provides more flexibility. Small drills for PCB use usually come with either a set of collets of various sizes or a three-jaw chuck. Sometimes the 3-jawchuck is an optional extra and is worth getting for the time it saves on changing collets. For accuracy, however, 3-jaw chucks are not brilliant, and small drill sizes below 1 mm quickly formed grooves in the jaws, preventing good grip. Below 1 mm, you should use collets, and buy a few extra of the smallest ones; keeping one collets per drill size as using a larger drill in a collets will open it out and it no longer grips smaller drills well. You need a good strong light on the board when drilling, to ensure accuracy. A dichroic halogen lamp, under run at 9V to reduce brightness, can be mounted on a microphone gooseneck for easy positioning. It can be useful to raise the working surface above 15 cm above the normal desk height for more comfortable viewing. Dust extraction is nice, but not essential and occasional blow does the trick! A foot-pedal control to switch the drill off and on is very convenient, especially when frequently changing bits. Avoid hole sizes less than 0.8 mm unless you really need them. When making two identical boards, drill them both together to save time. To do this, carefully drill a 0.8 mm whole in the pad near each corner of each of the two boards, getting the centre as accurately as possible. For larger boards, drill a hole near the centre of each side as well. Lay the boards on the top of each other and insert a 0.8 mm track pin in two opposite corners, using the pins as pegs to line the PCBs up. Squeeze or hammer the pins into boards, and then into the remaining holes. The two PCBs are now nailed together accurately and can be drilled together. Soldering Soldering is the joining together of two metals to give physical bonding and good electrical conductivity. It is used primarily in electrical and electronic circuitry. Solder is a combination of metals, which are solid at normal room temperatures and become liquid between 180 and 200 degree Celsius. Solder bonds well to various metals, and extremely well to copper. Soldering is a necessary skill you need to learn to successfully build electronics circuits. To solder you need a soldering iron. A modern basic electrical soldering iron consists of a heating element, a soldering bit (often called a tip), a handle and a power cord. The heating element can be either a resistance wire wound around a ceramic tube, or a thick film resistance element printed on to a ceramic base. The element is then insulated and placed into a metal tube for strength and protection. This is then thermally insulated from the handle. The heating element of soldering iron usually reaches temperatures of around 370 to 400 degree Celsius (higher than need to melt the solder). The strength or power of a soldering iron is usually expressed in watts. Irons generally used in electronics are typically in the range of 12 to 25 watts. Higher powered iron will not run hotter. Most irons are available in a variety of voltages; 12V, 24V, 115Vand 230V are most popular. Today most laboratories and repair shops use soldering irons, which operate at 24V. You should always use this low voltage where possible, as it is much safer. For advanced soldering work, you will need a soldering iron with temperature control. In this type of soldering irons, the temperature may be usually set between 200and 450 degree Celsius. Many temperature control soldering iron designed for electronics have a power rating of around 40 to 50 watt. They will heat fast and give enough power for operation, but are mechanically small. You will occasionally see gaspowered soldering irons which use butane rather than the main electrical supply to operate. They have a catalytic element which once warmed up, continues to glow hot when gas passes over them. Gas powered soldering irons are designed for occasional on the spot used for quick repairs, rather than for mainstream construction or for assembly work. Currently, the best commonly available, workable, and safe solder alloy is63/37. That is, 63% lead, 37% tin. It is also known as eutectic solder. Its most desirable characteristic is that it solids (pasty) state, and its liquid state occur at the same temperature -361 degree Fahrenheit. The combination of 63% lead and 37% tin melts at the lowest possible temperature. Nowadays there is tendency to move to use lead free solders, but it will take years until they

catch on normal soldering work. Lead free solders are nowadays available, but they are generally more expensive or harder to work on than traditional solders that they have lead in them. The metals involved are not the only things to consider in a solder. Flux is vital to a good solder joint. Flux is an aggressive chemical that removes oxide and impurities from the parts to be soldered. The chemical reactions at the point(s) of connection must take place for the metal to fuse. RMA type flux (Rosin Mildly Active) is the least corrosive of the readily available materials, and provides an adequate oxide removal .In electronics, a 60/40 fixed core solder is used. This consists of 60% lead and40% tin, with flux cores added to the length of solder. There are certain safety measures which you should keep in mind when soldering. The tin material used in soldering contains dangerous substances like lead (40-60% of typical soldering tins are lead and lead is poisonous). Also the various fumes from the soldering flux can be dangerous. While it is true that lead does not vaporize at the temperature at which soldering is typically done. When soldering, keep the room well ventilated and use a small fan or fume trap. A proper fume trap of a fan will keep the most pollution away from your face. Professional electronic workshops use expensive fume extraction systems to protect their workers. Those fume extraction devices have a special filter which filters out the dangerous fumes. If you can connect a duct to the output from the trap to the outside, that would be great. Always wash hands prior to smoking, eating, drinking or going to the bathroom. When you handle soldering tin, your hands will pick up lead, which needs to be washed out from it before it gets to your body. Do not eat, drink or smoke while working with soldering iron. Do not place cups, glasses or a plate of food near your working area. Wash also the table sometimes. As you solder, at times there will be a bit of spitting or sputtering. If you look you will see tiny balls of solder that shoot out and can be found on your soldering table.

CHAPTER 5 TESTING AND INTEGRATION CHAPTER 6

CHALLENGES AND RESULTS As with all engineering design, there may be challenges that cannot be foreseen during the design stage and

discover along with the implementation. The challenges that were not anticipated during the design stage were identified mainly in the development stage and are discussed and shared here. Problem 1: Bluetooth Module and ULN2803 IC were not available at most of component stores, since they are

not common or sellable item for most stores to keep stock. Solution 1: Only after searching on Google, managed to place order at one online electronics store and it took

two week for reception of courier.

CHAPTER 7

CRITICAL REVIEW AND REFLECTION Although, we have gone thorough lab sessions in our academic study, we have never been in this feeling of satisfaction in the development of this module-Device control using Bluetooth. For this time, it was totally a different experience, everything from scratch to the final, whether success or failure, it is all depending upon our own decisions. Upon completion, we are able to identify our own strengths and weaknesses. Not knowing where to touch on, it was quite a slow start as lots of things had to go through without clear goal or focus. However after meeting our supervisor, Mr Javaid Ahmad Shiekh, he had explained to us in details on what the project is all about. He gave us advices on how to get the project started and going. He also listed out a lot of potential obstacles that we could face along the way. This really helped us a lot as it allowed us to realize the problems nature and prepared us with well-equipped knowledge on those areas which needs more awareness. With zero knowledge in Bluetooth technology, we started doing research on it by means of surfing internet, through library resources and IEEE journals. We have also joined a lot of electronic projects, designs and hobbyists discussion forums and tried to be as much resourceful as possible. All these provided us with essential skills in design and development of embedded background. Apart from intensive research, we started to carry out the project plan with understanding based on functional flow of each subsystem then to find out components needed for each subsystem and ways to interface or integrate them into one working system. There were some points of time that we needed to carry out things in sequence. Like before going on with building the prototype straight, we needed to do research, plan, etc.. There were also times that we needed to take on tasks in parallel like evaluating before moving on with integrating all subsystems. By undertaking this project, it had benefited us not only with tremendous skill improvement in the implementation but also inspired us to move on with enthusiasms in the future even after the completion of this course. It had inspired us with thoughts and ideas to apply some projects like making our own home into Smart Home to improve our lifestyle. Furthermore, we also learnt to work in schedule and the importance of project management

skills overcoming all the obstacles. Even though undergoing this project for one whole academic month was challenging and tiring, it also taught us to be independent and gave us the satisfaction of achievement that we had never experienced in our life.

CHAPTER 8 CONCLUSION AND FUTURE ENHANCEMENTS CONCLUSION The main objective of this academic project was to design and build an embedded unit which makes use of the Bluetooth technology to control various appliances. This Devicecontrol unit should have 4 channels after which, if given room for improvement, it can be extended to 8. As such, the following main end product with scopes was set out to be achieved as per earlier chapter in project scope section. The prototype was designed and developed as per scopes. Each and every subsystem were also tested and analysed with satisfactory results and illustrated as proof in earlier chapter of testing and integration This project was not only based on academic purposes but also could be applied on real world applications. Due to its use of error free control signals, cost-effectiveness and ease of installation to pre-existing household appliances, the project could be considered quite successful, attractive and affordable to most households.

FUTURE ENHANCEMENTS There are number of enhancements in different aspect which can be considered to make the application more commercial viable. Design aspect : The prototype design can be made very small as such the users can either wear it as wrist strap, watch or necklace. It follows everywhere user go. Features : More features can be added like LCD displaying current on or off status with its device number and related logo or icon of home appliance.. In short, we can still improvise this project in many ways. A deep exploration in this project will definitely come up with new ideas to make this product more useful and bringing tons of conveniences to the user.

Das könnte Ihnen auch gefallen