Maker Pro
Maker Pro

how to connect max 232 to gps to get ttl output

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
If the max232 is in a socket, removing it will be simple. If it's not, you may want to consider other options.

I would recommend cutting the track leading from the GPS to the max232 (so that you can connect your own wire there).

But DONT DO ANYTHING until you are sure that the chips are compatible.
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
The problem (or at least one of them) is that the max232's output (which goes to the receive data pin on the GPS chip) will be solidly pulled to some logic level.

When you try to send data to it from the arduino, it will essentially short it out.

Another issue is that the GPS chip may be 3.3V and your arduino is almost certainly 5V. When it drives the signal high, it may damage the gps unless it has 5V tolerant inputs.

As Harald suggests, getting hold of the datasheets is probably the first thing you need to do before interfacing a pair of chips you've not interfaced before.

Yes sir, you are right. I got it. I see that on my board ,tx pin on gps is connected to pin no 11 (T1 in) on max 232 on rx to pin no 12 (r2 out) on gps and rs 232 connector is connected to pins 13 and 14.

Now, I will solder a gnd pin from the pcb board and connect it to arduino. Also, I will remove the max 232 ic on the board , but I will use the board to provide power to gps module (with ic max 232 taken out from the ic holder).

And ,also yes gps gives 3.3v output and arduino is 5v. But , I will just send data from gps to arduino and no data is going to be sent from arduino to gps.

I am just using the gps to read latitude and longitude values to the arduino. Thats it!

I think this will not be a problem? What you think?
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
If the max232 is in a socket, removing it will be simple. If it's not, you may want to consider other options.

I would recommend cutting the track leading from the GPS to the max232 (so that you can connect your own wire there).

But DONT DO ANYTHING until you are sure that the chips are compatible.

Yes sir, the ic is in an ic holder/ socket on the board. I will just remove the chip and power the whole board now.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,615
Joined
Nov 17, 2011
Messages
12,615
Here's a schematic attempt to explain:
attachment.php

It shows either the connection via RS232 or via TTL.

Depending on the modules and the software, an additional connection of RTS/CTS may be required or not.
 

Attachments

  • bla.gif
    bla.gif
    6.8 KB · Views: 225

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
Here's a schematic attempt to explain:
attachment.php

It shows either the connection via RS232 or via TTL.

Depending on the modules and the software, an additional connection of RTS/CTS may be required or not.

Thank you sir, gsm is now working.

For gps I am getting output in the form of..

ÿøÂ�xxxÂ�à Â�à Â�à Â�à Â


I think I need to get an external gps antenna to my gps reciever (already has a n antenna but I heard its sensitivity is very less) like the one I have attached below.

Right?

gr-87-antenna.jpg
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,615
Joined
Nov 17, 2011
Messages
12,615
The antenna is possibly a factor. Another factor is that you need to know the data format (output) of the receiver (I'm a bit confused as to your mentioning gsm and gps). Without that information you will not be able to interpret the data.

Also you need to verify that the UART parameters are set correctly on both sides (baud rate, stop bits, parity etc.). Wrong parameters can give unintelligible data.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
Yeah, that looks like a speed issue
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
The antenna is possibly a factor. Another factor is that you need to know the data format (output) of the receiver (I'm a bit confused as to your mentioning gsm and gps). Without that information you will not be able to interpret the data.

Also you need to verify that the UART parameters are set correctly on both sides (baud rate, stop bits, parity etc.). Wrong parameters can give unintelligible data.

I meant GPS
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
Hurray!!!!!!!!!!

Both GPS and GSM working.

Thank you for all (Steve and Harold) for your help.

I am really grateful to you guys

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=byteGPS;

GPS_RMC=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);

}

 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
Good job!
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
Congratulations.


Good job!


Is it possible to read data from gps module to an arduino board and send that data from that arduino board to a mobile phone when some condition is met in the program using Gsm module?

This is with reference to softwareserial library.

ex:

softwareserial (2,3) for gps

and

softwareserial (7,8) for gsm


If this is not possible, pls suggest alternatives ? 2 arduino boards? or any modifications to the same program?

I am also using a TINYGPS library in the program.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
With software serial, yes you should be able to have several serial ports operating at once. But it pays to check the documentation for the library, that will tell you authoritatively.
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
With software serial, yes you should be able to have several serial ports operating at once. But it pays to check the documentation for the library, that will tell you authoritatively.

With software serial, yes you should be able to have several serial ports operating at once. But it pays to check the documentation for the library, that will tell you authoritatively.

As per the documentation, it is not possible to rx data simultaneously on 2 ports from 2 devices.

But, here I will be sending a message to a mobile phone using gsm when a condition on gps is met.
I am not receiving anything from the gsm here.

So, that wont be a problem, right sir?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
As per the documentation, it is not possible to rx data simultaneously on 2 ports from 2 devices.

But, here I will be sending a message to a mobile phone using gsm when a condition on gps is met.
I am not receiving anything from the gsm here.

So, that wont be a problem, right sir?
Can't you use the hardware RS232 for one channel, and a software RS232 for the other?

Otherwise, yeah, you may have to coordinate things so you only deal with one device at a time.
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
Can't you use the hardware RS232 for one channel, and a software RS232 for the other?

Otherwise, yeah, you may have to coordinate things so you only deal with one device at a time.

I was using latitude and longitude values in my program. I am using TINY GPS library in arduino uno.

How many digits after the decimal point should I take to get good values?

This is because I need to define a set of co-ordinates (lat and long) in my program, and have to match these defined values with the current values at that specific location.
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
Congratulations.

I was using latitude and longitude values in my program. I am using TINY GPS library in arduino uno.

How many digits after the decimal point should I take to get good values?

This is because I need to define a set of co-ordinates (lat and long) in my program, and have to match these defined values with the current values at that specific location.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
You need as many digits as you require...

What sort of accuracy do you need? Within a km, 100m, 1m, 3mm?
 

bobdxcool

Mar 9, 2012
98
Joined
Mar 9, 2012
Messages
98
You need as many digits as you require...

What sort of accuracy do you need? Within a km, 100m, 1m, 3mm?

1m accuracy.

But ,will the arduino uno board be able to process so many digits (that I will enter in the program) ?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
If you're only looking to match a point location, then you can use simple string comparison.

If you want to do full distance and azimuth calculations on the geoid, then you'll need math that the arduino is likely not going to be capable of doing (are there any high resolution floating point libraries with transcendental functions?)

1m accuracy is likely to be tricky. You need 5 decimal places of lat/long to get to about 1m accuracy on the equator. You may well find that the accuracy of your GPS is the determining factor.
 
Top