Introduction
Home automation refers to the controlling or managing of home appliances by local networking or by remote control. Home automation is a system that enables you to control your home�s appliances more conveniently. It can be a simple system such as remote or automatic control of a few lights, or it can be a complex system that that can control all major appliances of your home. Home automation system can give you remote or automatic control of home appliances. Home automation systems are becoming famous due to their control and managing. Our project will demonstrate one of the simple home automation system using GSM Communication.
The aim of our project is to build an automation system for home so that we can control our home appliances via our cell phones. We are using GSM for communication so that we should not be restricted to short range of our automation system.

This automation system will be controlled through GSM communication. The use of wireless communication is increasing day by day. This has motivated us to use mobile phones to remotely control household appliances and to receive a feedback SMS. In this project we are building a remote appliance control system which can control different household appliances by sending a SMS from a mobile phone. This controller is extremely handy at places
where we have to control the ON and OFF switching of the devices as no wired connection is required between the switch and the home appliances as it can be controlled from any place in this world. The microcontroller would then control the home appliances based on the information given to it and send a feedback. It also uses temperature and humidity sensors to analyze the enviroment conditions. The enviromental condition can help us for controlling various appliances. The proposed solution is easy to use, simple and secure.
Team Members:
- Asad Majeed (BE-IV CSE)
- Shafqatullah (BE-IV EE)

High Level Design

- ATMega328p Micro-controller: The ATmega328 is a single-chip microcontroller created by Atmel.
It has a modified Harvard architecture 8-bit RISC processor core. The Atmel 8-bit AVR RISC-based microcontroller combines 32 KB ISP flash memory with read-while-write capabilities, 1 KB EEPROM, 2 KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface and SPI serial port. The device operates between 1.8-5.5 volts. The device achieves throughput approaching 1 MIPS per MHz.
- GSM-Module SIM900: The SIM900 shield packs a surprising amount of features into its little frame. Some of them are listed below:
- Supports Quad-band: GSM850, EGSM900, DCS1800 and PCS1900
- Connect onto any global GSM network with any 2G SIM
- Make and receive voice calls using an external earphone & electret microphone
- Send and receive SMS messages
- Send and receive GPRS data (TCP/IP, HTTP, etc.)
- Scan and receive FM radio broadcasts
- Transmit Power:
- Class 4 (2W) for GSM850
- Class 1 (1W) for DCS1800
- Serial-based AT Command Set
- Accepts Full-size SIM Card
- Relay module: A 5V 4-channel relay interface board, and each channel needs a 15-20mA driver current. It can be used to control various appliances and equipment with large current. It is equiped with high-current relays that work under AC250V 10A or DC30V 10A.
It has a standard interface that can be controlled directly by microcontroller.
- Humidity and temperature sensor:The DHT22 is a basic, low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). It's fairly simple to use. It has following features:
- Low cost
- 3 to 5V power and I/O
- 2.5mA max current use during conversion (while requesting data)
- Good for 0-100% humidity readings with 2-5% accuracy
- Good for -40 to 80�C temperature readings �0.5�C accuracy
- No more than 0.5 Hz sampling rate (once every 2 seconds)
- Nokia 5110LCD:The Nokia 5110 is a basic graphic LCD screen for lots of applications. It was originally intended to be used as a cell phone screen. This one is mounted on an easy to solder PCB. It uses the PCD8544 controller, which is the same used in the Nokia 3310 LCD.
The PCD8544 is a low power CMOS LCD controller/driver, designed to drive a graphic display of 48 rows and 84 columns.
All necessary functions for the display are provided in a single chip, including on-chip generation of LCD supply and bias voltages, resulting in a minimum of external components and low power consumption. The PCD8544 interfaces to microcontrollers through a serial bus interface.
Deligation of Tasks

Intellectual Properties and Ethical Considerations
When we were assigned this project, we searched on the internet for this project. There were many resources on the internet that were available, but we have to first interfaces different components so we searched for their interfacing. "LastMinuteEngineers" website was very helpful for providing information about interfacing SIM900. For interfacing DHT22 and Nokia5110LCD "Arduino"s website was very helpful. There were present many toturials about this stuff. For interfacing Relay Modules with "Mywikis" provid some essential information. For "GSM BASED HOME Automation" Project "alselectro wordpress" toturial was very helpful. From the above mentioned sites there were many useful codes and libraries were available. I have also included their links in the References. I have devoted this project for the open-source community. We are making the project files resource files freely available.Commercialization Aspects
GSM is a widely available service in urban and rural areas, it can help monitor and control electrical equipment and plants from remote location. Although such devices are commercially available but we assess that costum products tailored for domestic market may find market. For future, We have decided to improve this model. Improvement will decrease the cost and improve its efficiency and will add some new features, so that we could sell product in the market.System Design
The design process has several layers to it. Electrical Design, Software Design, User Interface and Final Hardware Assembly. The next sections we describe our Design activities.Electrical Circuit

To design our PCB for microcontroller ATMega328p we used EAGLE. In eagle schematic we used two 8 pin connectors that is connected to digital pins 7 and 8 of ATMega328p for GSM Module. A 6 pin connector is also used for connecting GSM Module ground to microcontroller's ground. We used a 8 pin connector that is connected to digital pins 2,3,4,5,6 and 5V,Ground of microcontroller for Nokia 5110 LCD. We used a 6 pin connector that is connected to digital pins 9,10,11,12 and 5V,Ground of microcontroller for 4 Channrelay Module. We used a 3 pin connector that is connected to digital pin 13 and 5V,Ground of microcontroller for DHT22 sensor. We used a 6 pin connector for FTDI that is connected to UART PINS(0,1),RST,5V and GND. We used a 3x2 connector for ISP header. It is connected to 5V,GND,D11,D12,D13 and RST pins of microcontroller. We used a 2 pin connector to power up the board by connecting a 5V voltage source. Another 2 pin connector is used to for power up the board by a 7.4V battery so it is connected to a voltage regulator. For testing purpose we also conneted a LED on D13 and for power checking a power LED is also connected to 5V and GND. A reset button is connected to 5V,GND and RST.
PCB Layout
We selected packages for components that was available in our Lab. After a week of continous work we completed our PCB routing. We designed our pcb in large size so that GSM Module and RelayModule can be placed under it. We also routed connectors for the analog pins so that we can use it if we will need. With the help of our mentor we were able to design the following PCB layout.Design in EAGLE

Since we have finished the design process in EAGLE so now we have to print it. In FABLAB SIBAU we have "Roland SRM20" which is used to print PCBs.
We generated rml files for the machine from fabmodules.org and generated files were given to the machine to start printing the PCB. After 30 minutes our PCB was milled and ready to be soldered.
Milled PCB

We generated BOM files from EAGLE and gave it to our instructor Engr.Nadir Ali. He gave us the required components which are shown below.
BOM for PCB
Burning Bootloader
At first, we soldered only the components that were necessary for our microcontroller so that we can check our board. Then we connected the ISP header to ISP Programmer and from Arduino IDE we burned the bootloader into our micro-controller. It was working fine.
Then we soldered our board. We left analog header pins because we were not using them.

After Complete Soldering

Software Development
For our project we need to develop a complex code so that it can handle the all the components. So we divided our code into various functions. We used a function gsmStart so that it can give GSM-Module some necessary commands for starting. We used a function checkSMS so that it can check the received sms and decode it. We used a function readSensor so that it can read the value from sensor and print it on the screen. Here is the abstract flow chart of our program.
Functional Circuit
Design of finished Product
To design the enclosure we decided to go for a 3D design. In our Lab we have "UltiMaker" which is a 3D printer.We used SOLIDWORKS to design our enclosure. After the hardwork of a week and with the help of intructor Engr.Azmat Hussain we were able to create following CAD Design:
The above given design is our 2nd design. Our first design was not accurate in measurement so we designed other box Our first design was:
Price of the Project
Given approx. bill of project in USD. You can buy the required components from your nearest store or can order online.
Given the list of components for the PCB:
Results
Conclusions
When we were assigned this project, we were having no knowledge about Embedded Systems. We searched about the project on the internet and found many projects similar to projects. Most of the projects were using SIM900 for GSM communication and Arduino as a microcontroller so we decided to use these components in our project. We decided that our project should be distinct from them, we added a temperature sensor and a proper response system so that it can give a user a proper response. We first decided to interface our required components. It took our alot of time just to interface SIM900 with Arduino. We first tried to send and receive SMS using SIM900 and Arduino. Our first received SMS from SIM900:
After sending and receiving SMS with SIM900 we decided to control a relay using sms. Our first working circuit design was:
After that we decided to interface a temperature sensor and a LCD with Arduino. But before that we have to choose a proper sensor and a LCD for our project. After searching on internet we found DHT22 sensor suitable for our project. To our luck it was also available in FABLAB. For LCD, first we decided use 16x2 LCD but since it was large in size and power requirement we decided to use another LCD. After searching on internet we found Nokia5110 LCD suitable for our project so we decided to use it. After getting the required components it took us a short time to interface them with Arduino as compared to SIM900. In the end we decided to build a microcontroller PCB in replacement for Arduino. Altough this journey was very hard but our hardwork learned us many essential skills in this course. During this journey we have learned about different microcontrollers and their architecture. We have learned how to program a microcontroller. We have learned how to interface different components with it. To sum up this discussion we would like to include the following points. During our project, We have learned:
- How to choose the components that are suitable to our needs.
- How to integrate components in a circuit.
- How to program a microcontroller to manage the components.
- How to use functions to manage our code efficiently.
- How to use interfacing protocols.
- How to use EAGLE to design a PCB.
- How to design an enclosure for a circuit using SOLIDWORKS.
- How to manage different components together in a complex circuit.
- How to troubleshoot. In the end a very helpful skill that we learned is project management.
Appendix
Eagle PCB Layout files
CAD Files
Code
References:
Sparkfun
Wikipedia
Interfacing SIM900
Interfacing Nokia 5110LCD and DHT22
Controlling relays using Arduino with SIM900