Monday, March 4, 2013

sim-548 Interfacing without Breakout Board with Arduino and PIC Microcontroller

sim-548 Interfacing without Breakout Board with Arduino and PIC Microcontroller : : by Syed Razwanul Haque (Nabil)

Please Download the image and Rotate Clockwise. You have to very careful while Soldering.. Module Tx will be connected with Arduino Rx and Module Rx will be conected with Arduino Tx. I used a nokia 3.7V battery for Power . Power key should be connected with Push button. Other pin of push button should be connected with Ground. For status LED +ve of LED should be connected with PIN 16 of gsm module and negative with Ground.Dont forget to use LM2576 power IC for power supply as recommended in datasheet. a Code Below :


 
www.fb.com/Nabilphysics
Code : For Arduino
//OISHI electronics sylhet,Bangladesh. www.fb.com/OishiElectronicsSylhet
//Syed Razwanul haque(Nabil) and Robi Kormoker www.fb.com/Nabilphysics +8801717973140
//Shahjalal University of Science and Technology (www.sust.edu)
//Department of Physics
// Code for Arduino 0023
// Download NewSoftSerial library from www.arduino.cc
#include <NewSoftSerial.h>  //Include the NewSoftSerial library to send serial commands to the cellular module.

char r=13;  //return character
NewSoftSerial cell(2,3);  //Create a 'fake' serial port. Pin 4 is the Rx pin, pin 3 is the Tx pin.
String cellContent="";   //string we're sending
String ctlZ="\x1A";     //the code for Ctrl-Z

String content="Test Massage";    //The text I'm sending

void setup() {

  // start the serial library:
  Serial.begin(9600);
  cell.begin(9600);

}

void loop()
{

//add our message to the CellContent string
  cellContent+=content;
//add the Crtl-Z hex character 
  cellContent+=ctlZ;
//put the modem into text mode 
  textMode();
//wait for a moment 
  delay(50);
//send message 
  sendMsg();

cellContent="";
delay(60000);

}

void textMode()
{
  //init text mode
  cell.print("AT+CMGF=1");
  cell.print(r);
}

void sendMsg(){
//This number needs to be replaced with the number you are sending to 
  cell.print("AT+CMGS=\"01717973140\"");
  cell.print(r);
  cell.print(cellContent);
  cell.print(r);
}

No comments:

Post a Comment