Arduino Connection Problem

Status
Not open for further replies.

MyMelon

Member level 2
Joined
May 7, 2012
Messages
44
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,564
How to interface Arduino to GSM SIM900D? do i need to use RS232 to ttl converter to view the activity in the hyperterminal? thanks:???:
 

Are you trying to connect plain chip to Arduino? If yes, then you don't need level converter. Just connect Arduino Tx and Rx pins to modem Rx and Tx pins and start playing with. But hardly you will get a signal without antenna. Better look for a Arduino Shield that has everything you need.
 
Reactions: MyMelon

    MyMelon

    Points: 2
    Helpful Answer Positive Rating
If you want to see serial data in PC Hyperterminal then Yes, you need a RS232 Converter (MAX232). You connect your Arduino Rx and Tx pins to MAX232 on one side and then connect a DB9 connector to the o/p of MAX232 circuit. See MAX232 Microcontroller and PC interface circuits.
 
Reactions: MyMelon

    MyMelon

    Points: 2
    Helpful Answer Positive Rating
@MinDaugasu When i connect GSM to Arduino directly the hyperterminal hangs.

@Jayan i know how to connect arduino to Rs232 but how will i connect GSM to arduino? tnx
 

Does your GSM has Rx and Tx pins which are TTL i/p and o/p? If yse you can connect it to Rx and Tx pins of Arduino. If your Arduino doesn't have 2 pairs of Rx and Tx then I think you have to use Soft_UART library and connect your GSM Rx and Tx pins to any pins of Arduino. The software uart library is necessary. can you post the datasheet of your GSM Module?

Are you doing something similar to this http://tronixstuff.wordpress.com/2011/01/19/tutorial-arduino-and-gsm-cellular-part-one/

https://www.edaboard.com/threads/236063/

You have to use UART0_Rx and UART0_Tx pins of SIM900D to connect to Arduino.

http://www.cooking-hacks.com/index.php/documentation/tutorials/arduino-gprs-gsm-quadband-sim900
 
Last edited:
Reactions: MyMelon

    MyMelon

    Points: 2
    Helpful Answer Positive Rating
Does both your boards work at 5V or 3.3V? If both boards work at the same voltage levels then just connect the Rx to Tx and Tx to Rx. That is cross connection betwwen the boards.
 
Reactions: MyMelon

    MyMelon

    Points: 2
    Helpful Answer Positive Rating
thank you jayanth it works now :smile:

i have another problem. i try different programs and when i compile theres an error like this samp.cpp:1:20: error: SIM900.h: No such file or directory.
i downloaded a file GSM directories and i put it in the Arduino Libraries but i dont work.:???:
 

Do you have the file SIM900.h? What is your include statement? Is it
Code:
 [syntax=c] #include <SIM900.h> [/syntax]
or
Code:
 [syntax=c] #include "SIM900.h" [/syntax]
?

If you have used the second type then you should put SIM900.h file in your project folder.
 
Reactions: MyMelon

    MyMelon

    Points: 2
    Helpful Answer Positive Rating
this one #include "SIM900.h", what is the difference between the 1st code to the second? why the other have like this < >
 

If you use the first method it will search for the file in library folder like INCLUDE folder. If you use the second type it will search for the file in Project folder. Do you have SIM900.h file on your system?
 

i get some files in arduino libraries and put inside my project folder but still occuring the errors.
is it lacking of files?

**broken link removed**
 

I don't see a warning related to SIM900.h
The warning shown are 1. "'delay' was not declared in this scope"
2. "only initialized variables can be placed into program memory area"
3. "unused variable response"

You have to include a header file like delay.h, Initialize all variables with 0 or with their starting values, variable response is not used in the code so you can remove it. If you post your project files it will be easy to solve the issue.
 
Reactions: MyMelon

    MyMelon

    Points: 2
    Helpful Answer Positive Rating
i don't know if this program is working. only if i know how to figure out how to fix the libraries :sad:

Code:
#include "SIM900.h"
#include "SoftwareSerial.h"
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.

//Simple sketch to send and receive SMS.

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

void setup() 
{
  //Serial connection.
  mySerial.begin(9600);
  Serial.begin(9600); //only if USB will be connected
  mySerial.println("AT+IPR=9600"); //sets the GPRS chip to communicate at 9600 as well
  //Start configuration of shield with baudrate.
  //For http uses is raccomanded to use 4800 or slower.
  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    started=true;  
  }
  else Serial.println("\nstatus=IDLE");
  
  if(started){
    //Enable this two lines if you want to send an SMS.
    if (sms.SendSMS("+639062407300", "Arduino SMS"))
      Serial.println("\nSMS sent OK");
  }

};

void loop() 
{
  if(started){
    //Read if there are messages on SIM card and print them.
    if(gsm.readSMS(smsbuffer, 160, n, 20))
    {
      Serial.println(n);
      Serial.println(smsbuffer);
    }
    delay(1000);
  }
};
 

I don't use Arduino. Can you zip and post your project folder and mention what software you are using to compile the code. I will have to install it and check the working.

You have only 1 error the other 2 are just warning. The error is due to the statement delay(1000);. You have to include delay.h file in your program. Look for delay.h or any file which as delay in its filename in the library folder.
 
Last edited:


Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…