Hello everyone,
I am a newbie trying to get my hands on working with Arduino Uno R3 and Arduino GPRS/GSM SIM900 Shield. I have connected the two devices based on the recommendations I got from results from google search. I have also implemented some of the steps I saw on this forum but none has worked form me. I have not worked with electronics before.
The devices are using are Arduino Uno R3 and Arduino GPRS/GSM Shield
.
Including SIM card and jumper wires
1. I am using a Windows 10 OS on a HP laptop.
2. I configured my Arduino Uno R3 COM port to use 19200 baud rate from Device Manager.
3. I also made sure my Arduino Uno R3 IDE is using the same COM port.
4. I have connected my devices and I have also included the images of my connection as attachment.
5. I am using a 9v 2a power adapter to power the SIM900 and usb for Arduino Uno R3.
Please I will like to know if my connection is correct?
I tried send a message using a piece of code I copied from a pdf I got while search for materials and I have the code here
#include
SoftwareSerial GPRS(7, 8); //7 = TX, 8 = RX
unsigned char buffer[64];
int port = 11;
int count=0;
int i = 1; //if i = 0, send SMS.
void setup(){
//delay(10000);
GPRS.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the Serial port of Arduino baud rate.
Serial.print("I'm ready");
Serial.print("Hello?");
}
void loop(){
if (GPRS.available()){ // if date is comming from softwareserial port ==> data is comming from gprs shield
while(GPRS.available()){ // reading data into char array
buffer[count++]=GPRS.read(); // writing data into array
if(count == 64)break;
}
Serial.write(buffer,count); // if no data transmission ends, write buffer to hardware serial port
clearBufferArray(); // call clearBufferArray function to clear the storaged data from the array
count = 0; // set counter of while loop to zero
}
if (Serial.available()) // if data is available on hardwareserial port ==> data is comming from PC or notebook
GPRS.write(Serial.read()); // write it to the GPRS shield
if(i == 0){
GPRS.print("AT+CMGF=1\r"); //sending SMS in text mode
Serial.println("AT+CMGF=1\r");
delay(1000);
GPRS.print("AT+CMGS=\"+2347xxxxxxxx\"\r"); // phone number
Serial.println("AT+CMGS=\"+2347xxxxxxxx\"\r");
delay(1000);
GPRS.print("Test\r"); // message
Serial.println("Test\r");
delay(1000);
GPRS.write(0x1A); //send a Ctrl+Z(end of the message)
delay(1000);
Serial.println("SMS sent successfully");
i++;
}
}
void clearBufferArray(){ // function to clear buffer array
for (int i=0; i
When I upload the sketch the my Arduino Uno R3 I get I'm readyHello?
I have attached my connection for inspection. Please I need help with this problem. Thanks.