Discussion in "GSM and CDMA Discussion" started by    bobdxcool    Feb 4, 2013.
Thu Feb 07 2013, 02:29 am
#21
Another thing to check.
The GPS ,the GSM and the Arduino might work off different voltages.

They could be 5 volt or 3.3 volts.
Connecting TX and RX could be a problem if the voltages are different.


On a practical note.
The MAX232 or MAX3232 chips can be unplugged.
Unplug the chip and fit a pin header,then connect to the pin header.
This saves soldering to the board.

Pin headers are rows of pins with narrow legs intended to be plugged into sockets for this purpose.
Thu Feb 07 2013, 02:53 am
#22


Another thing to check.
The GPS ,the GSM and the Arduino might work off different voltages.

They could be 5 volt or 3.3 volts.
Connecting TX and RX could be a problem if the voltages are different.


On a practical note.
The MAX232 or MAX3232 chips can be unplugged.
Unplug the chip and fit a pin header,then connect to the pin header.
This saves soldering to the board.

Pin headers are rows of pins with narrow legs intended to be plugged into sockets for this purpose.

ExperimenterUK




Sorry sir. I did not get you. Did u mean connect a pin header onto ic holder and connect max 232 on top of it, and use the same pin holder for soldering wires for rx and tx to be connected to arduino ?

Although i will be powering it using ac/ dc 12v adapter provided on the board.






As per the datasheet of sim300 digital pins have a o/p of 3.3v and the gr 87 datasheet it is mentioned as

TXA- Serial Data output port A(CMOS Level: Voh≧2.4V
Vol≦0.4V Ioh=Iol=2mA)

RXA-Serial Data input port A(CMOS Level Vih≧0.7*VCC
Vil≦0.3*VCC)


And I am using an arduino uno board.

I will also be using different power supplies for each module, so that 3.3v devices are'nt damaged if they were powered by arduino

Will it lead to any problem?


[ Edited Thu Feb 07 2013, 03:08 am ]
Thu Feb 07 2013, 06:34 am
#23


I will also be using different power supplies for each module, so that 3.3v devices are'nt damaged if they were powered by arduino
Will it lead to any problem?

bobdxcool


It could.
Having different power supplies will not help.

I think the best idea is to use the RS232 connections you already have.

Supply 5 volt power to your RS232 adapter.
Confirm that the voltage on R1 out and T1 in is less than 5 volts.

Connect R1 out to the RX pin of the Arduino
Connect T1 in to the TX pin of the Arduino.

Connect a PC to the 9 way socket on the adapter, and write a simple test program
to send and receive from the Arduino to the PC.
Let us know what happens.

Thu Feb 07 2013, 07:36 pm
#24



I will also be using different power supplies for each module, so that 3.3v devices are'nt damaged if they were powered by arduino
Will it lead to any problem?

bobdxcool


It could.
Having different power supplies will not help.

I think the best idea is to use the RS232 connections you already have.

Supply 5 volt power to your RS232 adapter.
Confirm that the voltage on R1 out and T1 in is less than 5 volts.

Connect R1 out to the RX pin of the Arduino
Connect T1 in to the TX pin of the Arduino.

Connect a PC to the 9 way socket on the adapter, and write a simple test program
to send and receive from the Arduino to the PC.
Let us know what happens.


ExperimenterUK



[quote]

I can solder two wires from beneath the board (for rx and tx) of gps module (ttl ) as i know which pin is what from data sheet and connect to tx and rx of arduino respectively. But i would leave the max ic intact on the board itself and leave the rs 232 port on the board unused , but power the gps module using 12 v adapter provided on board.

What do you think?

bobdxcool



Guys, I tried connecting gsm and gps modules (ttl pins) to tx n rx of arduino. It did not work.

I am totally confused.

This is what I did.

1. I soldered two wires from tx and rx pins of my gps and gsm boards.

2. I connected the tx pin of gsm to rx pin (pin 0) of arduino uno and rx of gsm to tx (pin1) of
arduino. I did this for both gsm and gps modules separately.

3. I just made 2 connections b/w arduino and gsm/gps. No other connections. I powered both the modules using 12v ac/dc adapter connected to the power pin provided on the board. I did not connect the grounds of gsm/gps to arduino or to each other.

GSM module used- sim300
GPS module used- Holux GR-87- baud-4800


The arduino tx and rx pins give 5v, whereas the gps and gsm modules (not boards) rx and tx pins give voltage under 4v (3.3v, 2.9v) .

Is this the problem?

Please help.







[ Edited Thu Feb 07 2013, 08:05 pm ]
Thu Feb 07 2013, 08:13 pm
#25
This is the code I used for testing gps.


#include <NewSoftSerial.h>
#include <TinyGPS.h>
/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of NewSoftSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 0(rx) and 1(tx).
*/

TinyGPS gps;
NewSoftSerial nss(0, 1);

static void gpsdump(TinyGPS &gps);
static bool feedgps();
static void print_float(float val, float invalid, int len, int prec);
static void print_int(unsigned long val, unsigned long invalid, int len);
static void print_date(TinyGPS &gps);
static void print_str(const char *str, int len);

void setup()
{
  Serial.begin(115200);
  nss.begin(4800);
  
  Serial.print("Testing TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
  Serial.print("Sizeof(gpsobject) = "); Serial.println(sizeof(TinyGPS));
  Serial.println();
  Serial.println("Sats HDOP Latitude Longitude Fix  Date       Time       Date Alt     Course Speed Card  Distance Course Card  Chars Sentences Checksum");
  Serial.println("          (deg)    (deg)     Age                        Age  (m)     --- from GPS ----  ---- to London  ----  RX    RX        Fail");
  Serial.println("---------------------------------------------------------------");
}

void loop()
{
  bool newdata = false;
  unsigned long start = millis();
  
  // Every second we print an update
  while (millis() - start < 1000)
  {
    if (feedgps())
      newdata = true;
  }
  
  gpsdump(gps);
}

static void gpsdump(TinyGPS &gps)
{
  float flat, flon;
  unsigned long age, date, time, chars = 0;
  unsigned short sentences = 0, failed = 0;
  static const float LONDON_LAT = 51.508131, LONDON_LON = -0.128002;
  
  print_int(gps.satellites(), TinyGPS::GPS_INVALID_SATELLITES, 5);
  print_int(gps.hdop(), TinyGPS::GPS_INVALID_HDOP, 5);
  gps.f_get_position(&flat, &flon, &age);
  print_float(flat, TinyGPS::GPS_INVALID_F_ANGLE, 9, 5);
  print_float(flon, TinyGPS::GPS_INVALID_F_ANGLE, 10, 5);
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);

  print_date(gps);

  print_float(gps.f_altitude(), TinyGPS::GPS_INVALID_F_ALTITUDE, 8, 2);
  print_float(gps.f_course(), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_float(gps.f_speed_kmph(), TinyGPS::GPS_INVALID_F_SPEED, 6, 2);
  print_str(gps.f_course() == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(gps.f_course()), 6);
  print_int(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0UL : (unsigned long)TinyGPS::distance_between(flat, flon, LONDON_LAT, LONDON_LON) / 1000, 0xFFFFFFFF, 9);
  print_float(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : TinyGPS::course_to(flat, flon, 51.508131, -0.128002), TinyGPS::GPS_INVALID_F_ANGLE, 7, 2);
  print_str(flat == TinyGPS::GPS_INVALID_F_ANGLE ? "*** " : TinyGPS::cardinal(TinyGPS::course_to(flat, flon, LONDON_LAT, LONDON_LON)), 6);

  gps.stats(&chars, &sentences, &failed);
  print_int(chars, 0xFFFFFFFF, 6);
  print_int(sentences, 0xFFFFFFFF, 10);
  print_int(failed, 0xFFFFFFFF, 9);
  Serial.println();
}

static void print_int(unsigned long val, unsigned long invalid, int len)
{
  char sz[32];
  if (val == invalid)
    strcpy(sz, "*******");
  else
    sprintf(sz, "%ld", val);
  sz[len] = 0;
  for (int i=strlen(sz); i<len; ++i)
    sz[i] = ' ';
  if (len >
 0) 
    sz[len-1] = ' ';
  Serial.print(sz);
  feedgps();
}

static void print_float(float val, float invalid, int len, int prec)
{
  char sz[32];
  if (val == invalid)
  {
    strcpy(sz, "*******");
    sz[len] = 0;
        if (len >
 0) 
          sz[len-1] = ' ';
    for (int i=7; i<len; ++i)
        sz[i] = ' ';
    Serial.print(sz);
  }
  else
  {
    Serial.print(val, prec);
    int vi = abs((int)val);
    int flen = prec + (val < 0.0 ? 2 : 1);
    flen += vi >
= 1000 ? 4 : vi >
= 100 ? 3 : vi >
= 10 ? 2 : 1;
    for (int i=flen; i<len; ++i)
      Serial.print(" ");
  }
  feedgps();
}

static void print_date(TinyGPS &gps)
{
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned long age;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
  if (age == TinyGPS::GPS_INVALID_AGE)
    Serial.print("*******    *******    ");
  else
  {
    char sz[32];
    sprintf(sz, "%02d/%02d/%02d %02d:%02d:%02d   ",
        month, day, year, hour, minute, second);
    Serial.print(sz);
  }
  print_int(age, TinyGPS::GPS_INVALID_AGE, 5);
  feedgps();
}

static void print_str(const char *str, int len)
{
  int slen = strlen(str);
  for (int i=0; i<len; ++i)
    Serial.print(i<slen ? str[i] : ' ');
  feedgps();
}

static bool feedgps()
{
  while (nss.available())
  {
    if (gps.encode(nss.read()))
      return true;
  }
  return false;
  }



This code gave number of received characters, but did not show any latitude and longitude.


This is code which I used for testing gsm-sending message to a number

#include <NewSoftSerial.h>
NewSoftSerial cell(0,1); 
char mobilenumber[] = "xxxxxxxxx";  // Replace xxxxxxxx with the recipient's mobile number
void setup()
{  //Initialize serial ports for communication.
cell.begin(4800);
delay(3500); // give the GSM module time to initialise, locate network etc.
// this delay time varies. Use example 26.1 sketch to measure the amount
// of time from board reset to SIND: 4, then add five seconds just in case
}
void loop()
{
cell.println("AT+CMGF=1"); // set SMS mode to text
cell.print("AT+CMGS=");  // now send message...
cell.print(34,BYTE); // ASCII equivalent of "
cell.print(mobilenumber);
cell.println(34,BYTE);  // ASCII equivalent of "
delay(500); // give the module some thinking time
cell.print("They call me the count... because I like to count! Ah ha ha ha");   // our message to send
cell.println(26,BYTE);  // ASCII equivalent of Ctrl-Z
delay(15000); // the SMS module needs time to return to OK status
do // You don't want to send out multiple SMSs.... or do you?
{
delay(1);
}
while (1>
0);
}




[ Edited Sun Feb 10 2013, 04:30 am ]
Fri Feb 08 2013, 02:40 pm
#26
grounds need to be connected as they both should have same ground. Did you check GPS datasheet if it can handle 5V? or atleast what is the max voltage it supports? and to see GPS lat/long you need to put GPS under open sky. If you testing inside a room or something then your GPS will never fix.
Fri Feb 08 2013, 03:00 pm
#27


grounds need to be connected as they both should have same ground. Did you check GPS datasheet if it can handle 5V? or atleast what is the max voltage it supports? and to see GPS lat/long you need to put GPS under open sky. If you testing inside a room or something then your GPS will never fix.

Ajay Bhargav



Hi, the gsm module is working..

I connected the grounds and removed that max ic from pcb.

For gps i am getting garbage values, which I think means it is not getting a fix.

So, I am buying active external gps antenna to be conected to antenna on board. I think this will solve it.

Power ratings from datat sheet..

2.1.6 Power
1). Input power : 3.3 ~ 5.5 VDC input。
2). Input current: Less than 80 mA (without antenna) 。
3). Backup power: 3V Rechargeable Lithium cell battery, up to 500 hours
discharge。

Table 4-1 J1 connector pin definition:
Pin Pin Name Function description
1 VCC_5V +3.5~5.5VDC power input
2 TXA
Serial Data output port A(CMOS Level: Voh≧2.4V
Vol≦0.4V Ioh=Iol=2mA)


3 RXA
Serial Data input port A(CMOS Level Vih≧0.7*VCC
Vil≦0.3*VCC)


4 RXB
Serial Data input port B(CMOS Level Vih≧0.7*VCC
Vil≦0.3*VCC)

5 GND Power ground


6
TIMEMARK/
RESET (option)
TIMEMARK: 1PPS Time mark output(Vil≦0.2V Pulse
Width 1 usec)。
RESET: Reset Input (Active Low)(option function

Fri Feb 08 2013, 08:00 pm
#28
Hurray!!!!!!!!!!

Both GPS and GSM working.

Thank you for all (Ajay and Experimenter) for your help.

I will post a detailed project report if everything goes fine.

This is the code I finally used for GPS

#include <SoftwareSerial.h>


 

// Constants

#define rxPin 9      //rx pin in gps connection

#define txPin 8      //tx pin in gps connection

 

// set up the serial port

 

SoftwareSerial gps = SoftwareSerial(rxPin, txPin);

 

// variables

byte byteGPS = 0;

int i = 0;

int h = 0;

 

// Buffers for data input

char inBuffer[300] = "";

char GPS_RMC[100]="";

 

 

void setup(){

 

//setup for mySerial port

pinMode(rxPin, INPUT);

pinMode(txPin, OUTPUT);

gps.begin(9600);

 

//setup for Serial port

Serial.begin(9600);

 

delay(1000);

}

 

void loop(){

 

// Read the RMC sentence from GPS

byteGPS = 0;

byteGPS = gps.read();

while(byteGPS != 'R'){

byteGPS = gps.read();

}

GPS_RMC[0]='$';

GPS_RMC[1]='G';

GPS_RMC[2]='P';

GPS_RMC[3]='R';

 

i = 4;

while(byteGPS != '*'){

byteGPS = gps.read();

inBuffer[i]=byteGPS;

GPS_RMC[i]=byteGPS;

i++;

}

// print the RMC sentence to USB

Serial.print("Location Is: ");

h = 0;

while(GPS_RMC[h] != 42){

Serial.print(GPS_RMC[h],BYTE);

h++;

}

delay(50000);

}


Sun Feb 10 2013, 04:31 am
#29
thats a great news congrats. We will wait for the final thing what exactly the project is?
Sun Feb 10 2013, 11:43 am
#30


thats a great news congrats. We will wait for the final thing what exactly the project is?

Ajay Bhargav



Thats something I can not reveal at this stage. But, it is something very big and based on automobiles. The idea is going to be patented very soon.I may still have to add some more components to make it more unique. Once it is done I will definitely post a detailed report.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Richardedils
Wed Apr 24 2024, 04:07 am
ChrisLub
Tue Apr 23 2024, 05:21 pm
Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm