Thursday, 12 January 2017

WEEK 14

Date:4/1/2017 (Wednesday)
Title:  Presentation of Final Year Project


The Final Year Project presentation was conducted at Dewan Gemilang British Malaysian Institute at 2pm to 5.30pm.
Alhamdulillah everything went well for the presentation. After the presentation is time to prepare the report.


ACKNOWLEDGEMENT: 

First of all, we would like to thank my supervisor Madam Johara Bte Ghazali for his guidance, advices and attention throughout the development of this project. This project would not have happened without the supports of our family. We would like to thank our beloved parents and siblings who have help to encourage whenever we feeling down. They are the backbones of our success.

We would also like to thank all of our friends for the supports. Our friends have helped we a lot in improving our knowledge and skills. Then we would like to thank all the lecturers that have taught me throughout my studies. We will try to use the knowledge that have been taught as good as we can. Lastly we would like to thank those who have helped we in developing this project.

WEEK 13

Date:27/12/2016
Title: Preparation for the presentation FYP day.


In this week, we do many things for the project which is troubleshoot, construction the model and prepare the poster for presentation.


Equipments and tools that needed to complete this model:
    1) Pt Board

    2) hot glue
    3) Plywood
    4) Board
    5) Double Tape
    6) Ruler
    7) Scissor
    8) Colour Paper

    9) Tack tape 
   10) Sticker carbon 
   11) Hinge
   12) Driller
   13) Cutter




The poster needs to have :
  • Project title 
  • Student's name
  • Logo University
  • Block diagram
  • Flow Chart
  • Objectives
  • Methodology
  • Conclusion
  • References 
Inline images 1

Wednesday, 11 January 2017

WEEK 12

Date:22/12/2016
Title: Construct the hardware.


In this week, we have to construct the hardware which is Arduino Uno interface LCD, relay and GSM Module SIM900A. All the hardware for this project were construct according from the circuit schematic above.
Circuit schematic diagram








After we complete construct all component, then we continue with the important part which is write the code for upload to the Arduino Uno.

The code for this project


#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>

#define RELAY1    13
#define RELAY2    12
#define RELAY3    11

SoftwareSerial sim900a(2,3);
LiquidCrystal_I2C lcd(0x27 ,2,1,0,4,5,6,7);

String message,phone;
int data;

void setup()
{
  pinMode(RELAY1,OUTPUT);
  pinMode(RELAY2,OUTPUT);
  pinMode(RELAY3,OUTPUT);
  Serial.begin(9600); 
  sim900a.begin(9600);

  digitalWrite(RELAY1,LOW);
  digitalWrite(RELAY2,LOW);
  digitalWrite(RELAY3,LOW);

 /**************LCD*************************/
  
  lcd.begin (16,2); 
  lcd.setBacklightPin(3,POSITIVE);
  lcd.setBacklight(HIGH);   
  lcd.setCursor(0,0);
  lcd.print("GSM Control Home");
  lcd.setCursor(0,1);
  lcd.print("   Automation   ");
  delay(2000);
  lcd.clear();
  lcd.print("Circuit Digest  ");
  delay(1000);
  lcd.setCursor(0,1);
  lcd.print("System Ready    ");
  delay(1000);
  lcd.clear();

 
  lcd.setCursor(0,0);
  lcd.print(" L1    L2    FAN ");
  lcd.setCursor(0,1);
  if(digitalRead(RELAY1)==LOW) lcd.print("OFF "); 
  else lcd.print(" ON ");
  if(digitalRead(RELAY2)==LOW) lcd.print("  OFF "); 
  else lcd.print("  ON  "); 
  if(digitalRead(RELAY3)==LOW) lcd.print("  OFF "); 
  else lcd.print("  ON  "); 
}

void loop()
{  
  if(sim900a.available()>0)
  {
    delay(100);
    message="";
    while(sim900a.available())
    {
      message+=(char)sim900a.read();
      data=Serial.read();
      
    }

    if (data=='1')
    {
      Serial.print("RELAY 1 ON");
      digitalWrite(RELAY1,HIGH);
       lcd.setCursor(0,1); 
           lcd.print("ON   ");
      delay(200);
    }
    
    if (data=='2')
    {
     Serial.print("RELAY 1 OFF");
     digitalWrite(RELAY1,LOW);
      lcd.setCursor(0,1); 
      lcd.print("OFF    ");
      delay(200);

    }
    if (data=='3')
    {
     Serial.print("RELAY 2 ON");
     digitalWrite(RELAY2,HIGH);
     lcd.setCursor(7,1); 
     lcd.print(" ON    ");
      delay(200);

    }
    if (data=='4')
    {
     Serial.print("RELAY 2 OFF");
     digitalWrite(RELAY2,LOW);
       lcd.setCursor(7,1); 
      lcd.print("OFF    ");
      delay(200);
     
    }
    if (data=='5')
    {
     Serial.print("RELAY 3 ON");
     digitalWrite(RELAY3,HIGH);
     lcd.setCursor(13,1); 
      lcd.print("ON    ");
      delay(200);
     }
     if(data=='6')
     {
      Serial.print("RELAY 3 OFF");
      digitalWrite(RELAY3,LOW);
      lcd.setCursor(13,1); 
       lcd.print("OFF    ");
       
      delay(200);
     }
     if(data=='7')
     {digitalWrite(RELAY1,HIGH);
     digitalWrite(RELAY2,HIGH);
     digitalWrite(RELAY3,HIGH);
     lcd.setCursor(13,1); 
      lcd.print("ON    ");
       lcd.setCursor(7,1); 
     lcd.print("ON    ");
           lcd.setCursor(0,1); 
           lcd.print("ON   ");
      delay(200);
      
      }
      if(data=='8')
     {digitalWrite(RELAY1,LOW);
     digitalWrite(RELAY2,LOW);
     digitalWrite(RELAY3,LOW);
      lcd.setCursor(0,1);
       lcd.print("OFF  OFF  OFF");
      delay(200);
      
      }
     }
    
    if(message.indexOf("CMT")>-1)
    {
      message=message.substring(message.indexOf('"')+1);
      phone=message.substring(0,message.indexOf('"'));
      message=message.substring(message.indexOf('"')+1);
      message=message.substring(message.indexOf('"')+1);
      message=message.substring(message.indexOf('"')+1);
      message=message.substring(message.indexOf('"')+1);
      message=message.substring(message.indexOf('"')+1);
      message=message.substring(message.indexOf('\n')+1);
      message=message.substring(0,message.indexOf('\n')-1); 
      Serial.print("Message:" + message);
      Serial.println(" From:" + phone);

      if(phone.length()>=10)
      {
        if(message=="L1 ON")
        {
          digitalWrite(RELAY1,HIGH);
          Serial.print("RELAY1 ON");//Text message
           lcd.setCursor(0,1); 
           lcd.print("ON   ");
           delay(200);
        
        }
        else if(message=="L1 OFF")
        {
          digitalWrite(RELAY1,LOW);
           Serial.print("RELAY1 OFF");//Text message
           lcd.setCursor(0,1); 
      lcd.print("OFF    ");
      delay(200);
               
        }
        else if(message=="L2 ON")
        {
          digitalWrite(RELAY2,HIGH);
          Serial.print("RELAY2 ON");//Text message
          lcd.setCursor(7,1); 
            lcd.print(" ON    ");
            delay(200);
                    
        }
        else if(message=="L2 OFF")
        {
          digitalWrite(RELAY2,LOW);
          Serial.print("RELAY2 OFF");//Text message
           lcd.setCursor(7,1); 
          lcd.print("OFF    ");
            delay(200);
     
               
        }
        else if(message=="L3 ON")
        {
          digitalWrite(RELAY3,HIGH);
          Serial.print("RELAY3 ON");//Text message
          lcd.setCursor(13,1); 
          lcd.print("ON    ");
          delay(200);
                 
        }
        else if(message=="L3 OFF")
        {
          digitalWrite(RELAY3,LOW);
          Serial.print("RELAY3 OFF");//Text message
          digitalWrite(RELAY3,LOW);
        lcd.setCursor(13,1); 
        lcd.print("OFF    ");
             
               
        }
        else if(message=="ALL ON")
        {
          digitalWrite(RELAY1,HIGH);
          digitalWrite(RELAY2,HIGH);
          digitalWrite(RELAY3,HIGH);
          Serial.print("ALL RELAY ON");//Text message
          lcd.setCursor(0,1);
          lcd.print(" ON     ON    ON");
                   
        }
        else if(message=="ALL OFF")
        {
          digitalWrite(RELAY1,LOW);
          digitalWrite(RELAY2,LOW);
          digitalWrite(RELAY3,LOW);
          Serial.print("ALL RELAY OFF");//Text message
          lcd.setCursor(0,1);
          lcd.print("OFF  OFF  OFF");
         
        }
        else
        {
          sim900a.print("AT+CMGF=1\r");  //Set text mode
          delay(1000);
          sim900a.print("AT+CMGS=\"" + phone + "\"\r"); //Send message
          delay(1000);
          sim900a.print("Arahan salah");//Text message
          sim900a.println((char)0x1A); //Ctrl+Z        
        }
        
      lcd.setCursor(0,1); 
      if(digitalRead(RELAY1)==LOW) lcd.print("OFF "); 
      else lcd.print(" ON ");
      if(digitalRead(RELAY2)==LOW) lcd.print("  OFF "); 
      else lcd.print("  ON  "); 
      if(digitalRead(RELAY3)==LOW) lcd.print("  OFF "); 
      else lcd.print("  ON  "); 
      delay(5000);                
      }
    }
    else
    {
      Serial.println(message);  
    }
  
}

Tuesday, 10 January 2017

WEEK 11

Date: 15/12/2016
Title: Make a flowchart

 In this week, we are make a flowchart for this project. flowchart is a visual representation of a flow of data. It can be used to outline a process or a solution to a problem, whether it is simple or complex. For beginners in programming, it is vital to learn flowcharting to understand the basic logic behind a program. So, it will be easier to write the code if we have a flowchart.


WEEK 10

Date: 5/12/2016- 11/12/2016
Title: Interface GSM Module SIM900A with Arduino Uno

This post is for progresses made on the week 10 of completing this project. In this week, we have to buy a new GSM Module which is SIM900A. Because SIM800L before that was damage. 
A new GSM Module SIM900A that we buy and SIM800L

SIM900A is one of the products GSM / GPRS SIMCOM Serial Modem from which we can use as well Arduino microcontroller to feature SMS, Phone or data GPRS. This is a specifications Chip Module SIM900A brief: Features: -Quad-Band 850/900/1800/1900 MHz - Can be used on any GSM network in various countries. -GPRS Multi-slot class 10/8 -GPRS Mobile station class B Compliant to GSM phase 2/2 + -Class 4 (2 W (AT) 850/900 MHz) -Class 1 (1 W (AT) 1800 / 1900MHz) -Instruction Using AT Command - Standard Commands: GSM 07:07 & 07:05 | Enhanced Commands: SIMCOM AT Commands. Short Message-Service (SMS) - Embedded TCP / UDP stack - can upload data to the web server -Support RTC -Selection Serial Port (3.3V and 5V Level) -There Speaker and headphone jack (type specific breakout board) -assume Low power - 1.5m (sleep mode) -Working Temperature - -40C to +85 C


GSM SIM900A Datasheet Click here.


Wiring connection between SIM900A and Arduino UNO.


SIM900A     <-->     Arduino Uno 
GND           <--->   GND
VCC           <--->   5V
TXD 5V      <--->   D2 (digital PIN 2)
RXD 5V      <--->   D3 (digital PIN 3)


The code that we use in Arduino IDE Software to interface GSM Module SIM900A

#include <SoftwareSerial.h>

SoftwareSerial sim900a(2,3);

int data;

void setup()
{
  Serial.begin(9600); 
  sim900a.begin(9600);
  Serial.println("Enter");
  Serial.println("1 - Manufacturer identification");
  Serial.println("2 - Model identification");
  Serial.println("3 - Software version");
  Serial.println("4 - IMEI number");
  Serial.println("5 - Calling");
  Serial.println("6 - Hang Up");
  Serial.println("7 - Send message");
  Serial.println("8 - Read message");
  Serial.println("9 - Delete message");
}

void loop()
{
  if(Serial.available()>0)
  {
    data=Serial.read();
    
    if (data=='1')
    {
      sim900a.print("AT+CGMI\r"); //Manufacturer identification
    }
    
    if (data=='2')
    {
      sim900a.print("AT+CGMM\r"); //Model identification
    }
    
    if (data=='3')
    {
      sim900a.print("AT+CGMR\r"); //Software version
    }
    
    if (data=='4')
    {
      sim900a.print("AT+CGSN\r"); //IMEI number
    }
    
    if (data=='5')
    {
      sim900a.print("ATD+60136289844;\r"); //Calling
    }
    
    if (data=='6')
    {
      sim900a.print("ATH\r"); //Hang Up
    }
    
    if (data=='7')
    {
      sim900a.print("AT+CMGF=1\r");  //Set text mode
      delay(1000);
      sim900a.print("AT+CMGS=\"+60136289844\"\r"); //Send message
      delay(1000);
      sim900a.print("Hai, I'm SIM900A");//Text message
      sim900a.println((char)0x1A); //Ctrl+Z
    }
    
    if (data=='8')
    {
      sim900a.print("AT+CMGR=1\r"); //Read message
    }
    
    if (data=='9')
    {
      sim900a.print("AT+CMGD=1,0\r"); //Delete message
    }
  }
  
  if(sim900a.available()>0)
  {
    while(sim900a.available())
    {
      data=sim900a.read();
      Serial.write(data);
    }
  }

}


Sunday, 8 January 2017

WEEK 9

Date: 28/11/2016 - 2/12/2016
Title: Interface Arduino and SIM800L

In this week, we have gone to Jalan Pasar to buy a GSM Module SIM800L. The price is only RM47.00. We would like to explain  about this module.

GSM SIM800L that we buy.
A SIM800L have a 12 pin.The pin is Antena, VCC, RESET, RX, TX, GND, Ring, DTR, Mic+, Mic-, Speaker+ and Speaker-. But we just use 5 pin only. Which is VCC, RX, TX, Antena and GND.

To can see the datasheet, click at the link above.


The connection between Arduino Uno and SIM800l that we make:
For above module Arduino to SIM800L connectivity was pretty straight forward .
  • SIM800 VCC ↔ Arduino 5v
  • SIM800 GND (either one) ↔ Arduino GND
  • SIM800 TXD ↔ Arduino D2 
  • SIM800 RXD ↔ Arduino D3 
Caution! : SIM800 module itself uses input voltage of 3.7V – 4.2V. Therefore, if you directly connect the Vcc pin to Arduino 5V pin, it might damage the module as well. I tried 3.3V Arduino pin with no luck. So I tried to connect the Vcc pin to 5V pin from the Arduino, my module is damage. The module not responding anything after that. 

The solution for this problem, by using  LM2596 DC-DC buck converter step-down power module. You can connected 5V from Arduino to pin IN+, step down the voltage (adjust between the range 3.7V-4.2V )and  connect to Vcc SIM800L with the pin OUT+.
LM2596 DC-DC Converter Step down

WEEK 8

Date:21/11/2016 -25/11/2016
Title: Find information about GSM Module.

In this week, we just only find information about GSM Module. Based on the information, GSM  is mean Global System for Mobile Communications. GSM is a standard developed by the European Telecommunications Standards Institute (ETSI).


A GSM Module was created to describe the protocols for second-generation (2G) digital cellular networks used by mobile phones and is now the default global standard for mobile communications – with over 90% market share, operating in over 219 countries and territories. Its is mean, a GSM Module just only use in receive and transmit message and call.

A GSM module  is a chip or circuit that will be used to establish communication between a mobile device or a computing machine and a GSM or GPRS system. The modem (modulator-demodulator) is a critical part here.


A GSM Module just only can be control by using AT commands. AT is the abbreviation for Attention. These commands come from Hayes commands that were used by the Hayes smart modems. The Hayes commands started with AT to indicate the attention from the MODEM. The dial up and wireless MODEMs (devices that involve machine to machine communication) need AT commands to interact with a computer. These include the Hayes command set as a subset, along with other extended AT commands.

This is example of GSM Module that we can get at the market.
GSM SIM900A


GSM GPRS Shield Module SIM900


GSM SIM800L