Hello,
I am doing a project based on GSM+GPS+ARDUINO. I have to make communications in between them. I have divided the big project into several small parts & finally I will add them to make the final project.
Right now I am trying to make communication between Arduino & sim300.
Step 1. Arduino > SIM300
Step 2. SIM300 > Arduino
Step1 is successfully done. I can send sms by controlling the Arduino input pins as switch. Now I want to send instruction to arduino via SIM300 modem. Suppose If I send a text "ON" to SIM300 an LED will glow & If I send a text "OFF" to SIM300 the LED will be off.
current progress (Step1)
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9,10);
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13;
int buttonState = 0;
void setup()
{
mySerial.begin(9600); // the GPRS baud rate
delay(2000);
mySerial.println("AT");
delay(2000);
mySerial.println("AT+CSMP=17,167,0,0");
delay(2000);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop()
{
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
delay(1000);
mySerial.println("AT+CMGF=1"); // set the SMS mode to text
delay(2500);
mySerial.write("AT+CMGS=");
mySerial.write(34); //ASCII of “
mySerial.write("+919681108468");
mySerial.write(34);
mySerial.write(13);
mySerial.write(10);
delay(2500);
mySerial.println("Yahoo, You are Successful...!"); //this is the message to be sent
delay(2500);
mySerial.write(26);
mySerial.write(13);
mySerial.write(10);//Ascii code of ctrl+z to send the message
delay(2500);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
Need help for the "Step2". I want to control the arduino output via my sim300 modem. Kindly show me the way, I'll walk the path.
Thanks