Pages: [1]   Go Down
Author Topic: gsm modem #~plz help~#  (Read 553 times)
0 Members and 1 Guest are viewing this topic.
Delhi, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
~
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I am trying to connect arduino with GSM modem.
I have connected Rx of arduino w/ Tx of modem and vice versa.
Here is the code
Code:
#include <NewSoftSerial.h> //Include the NewSoftSerial library to send serial commands to the cellular module.
#include <string.h>         //Used for string manipulations
char incoming_char=0;      //Will hold the incoming character from the Serial Port.
NewSoftSerial cell(2,3);  //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.
void setup()
{
  //Initialize serial ports for communication.
Serial.begin(9600);
cell.begin(9600);
Serial.println("Starting  Communication...");
}
void loop()
{
//If a character comes in from the cellular module...
if(cell.available() >0)
{
incoming_char=cell.read();    //Get the character from the cellular serial port.
Serial.print(incoming_char);  //Print the incoming character to the terminal.
}
//If a character is coming from the terminal to the Arduino...
if(Serial.available() >0)
{
incoming_char=Serial.read();  //Get the character coming from the terminal
cell.print(incoming_char);    //Send the character to the cellular module.
}
}

There is no response from the modem nor the arduino is sending any command to the mode.
The modem is working fine w/ computer.

Regeards,
Shubham Garg
Logged

Regards
Shubham Garg

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 241
Posts: 24480
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Rs232 level conversion?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Delhi, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
~
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

check out the modem here http://probots.co.in/index.php?main_page=product_info&cPath=77&products_id=326.
The modem comes with a serial TTL output.

Regards
Shubham Garg
Logged

Regards
Shubham Garg

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 553
Posts: 46300
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have connected Rx of arduino w/ Tx of modem and vice versa.
Code:
NewSoftSerial cell(2,3);  //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.
If the modem is connected to RX/TX (pins 0 and 1), why are you talking to/listening to pins 2 and 3?
Logged

Delhi, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
~
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

by Rx/Tx I meant the fake Rx/Tx pin created by the Newsoft library.
Logged

Regards
Shubham Garg

London
Offline Offline
Full Member
***
Karma: 0
Posts: 146
Ugi was not declared in this scope
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure of how the board is marked for Tx & Rx?

Some boards mark their function (i.e. Rx is the pin on which the board receives) and some boards seem to mark the function of the pin that they should be connected to (i.e. Rx on the board should be connected to the pin on which the microcontroller receives).  If it's not entirely clear then it might be worth trying them reversed.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 553
Posts: 46300
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
by Rx/Tx I meant the fake Rx/Tx pin created by the Newsoft library.
Maybe you connect the device to a real pin. There is nothing fake about the software serial port.
Logged

Pages: [1]   Go Up
Jump to: