sms based home automation system

13
By: Sujit Kumar Nayak www.ectech.in

Upload: sujit-kumar-nayak

Post on 15-Apr-2017

128 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: SMS Based Home Automation System

By:

Sujit Kumar Nayak

www.ectech.in

Page 2: SMS Based Home Automation System

Introduction

In recent days, the whole world is rushing fast to make one or other attempt to add

tags to the comfort zone of mankind, my effort, although a small one, would be of some significance.

I have developed an Embedded System

using which one can control electrical appliances such as Fan, Light, Heater etc. remotely irrespective of how far the device

is.

www.ectech.in

Page 3: SMS Based Home Automation System

Contd… Introduction

Also status of each device connected to it can be known.

All we have to do is to send SMS commands like Device1 On, Device2 Off, Status etc.

www.ectech.in

Page 4: SMS Based Home Automation System

System Overview

My system contains a GSM Mobile phone with F-Bus support (Nokia 3310) and a Microcontroller (ATmega16L) as the main unit.

Some other peripherals are also there in addition with the above like LCD (Liquid Crystal Display), Relays, Status LEDs etc.

The devices to be controlled are connected to its port via Relays.

The communication between the Phone and microcontroller is serial type with F-Bus Protocol, which is Nokia’s own protocol.

Status of devices are indicated by indicator LEDs connected as well by the LCD interfaced (Optional).

www.ectech.in

Page 5: SMS Based Home Automation System

Block Diagram

www.ectech.in

Page 6: SMS Based Home Automation System

The F-Bus

The phone and the microcontroller are connected via the F-Bus port of the phone.

The F-Bus is full-duplex bi-directional serial type bus running at 115,200bps, 8 data bits, no parity, one stop bit.

It uses one pin to transmit data (Tx), one pin to receive data (Rx) and one ground pin.

The first step, after connecting the F-bus is to synchronize the UART (Universal Asynchronous Receive Transmit) in the phone with the PC or microcontroller.

This is done by sending a string of 0x55 or 'U' 128 times. Simple! The bus is now ready to be used for sending frames.

www.ectech.in

Page 7: SMS Based Home Automation System

F-Bus connector in Nokia3310

www.ectech.in

Page 8: SMS Based Home Automation System

Connecting the Phone and mC

Special F-Bus adapters are available to made connection to the F-Bus, but I have directly solder wires to it, taking a risk of frying the Phone!!

The Phone runs on 3V and the microcontroller on 5V. So if we connect these two directly, surely, the phone will get damaged.

To solve this, I have used a voltage divider circuit which convert 5V signals from microcontroller’s Tx pin to Phone’s Rx pin.

www.ectech.in

Page 9: SMS Based Home Automation System

Contd… Connecting the Phone and mC

The voltage divider circuit consist of two resistor (2.2k and 3.3k) to do the above.

Nothing is done on the microcontroller Rx side as it can run from 3V, just a current limiting resistor is connected in series on the Rx (mC)- Tx (Phone) line to limit excess current flow between these two devices.

The next step is to synchronize the UART in the Phone with the microcontroller. This is done by sending a string of 0x55 (‘U’) 128 times. The Bus is now ready to be used for sending Frames.

www.ectech.in

Page 10: SMS Based Home Automation System

For testing the F-Bus

To test the working of F-Bus in my phone I have connected it to PC via the cable shown below :

www.ectech.in

Page 11: SMS Based Home Automation System

The F-Bus Protocol

The F-Bus protocol has a series of commands that allow to make calls, send and get SMS etc.

A simple frame sent to Nokia3310 Byte: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15

Data: 1E 00 0C D1 00 07 00 01 00 03 00 01 60 00 72 D5

This sample frame is used to get the hardware and software version from a Nokia phone.

www.ectech.in

Page 12: SMS Based Home Automation System

A Snap of the Processor Unit

www.ectech.in

Page 13: SMS Based Home Automation System

A snap shot my system

www.ectech.in