how to make a NMEA sentence using arduino

i want to output the NMEA sentences e.g GGA using raw data of GPS.... anyone can help using tinyGPS++ library??

The "raw data" from the GPS usually consists of NMEA sentences.

Please explain what you actually want to do.

adeelzxz:
i want to output the NMEA sentences e.g GGA using raw data of GPS… anyone can help using tinyGPS++

TinyGPS++ does not ‘output’ NMEA sentences, it reads them and parses the latitude, longitude, altidude etc.

adeelzxz: i want to output the NMEA sentences e.g GGA using raw data of GPS.... anyone can help using tinyGPS++ library??

void setup()
{
  Serial.begin(115200);
  Serial2.begin(9600); //gps serial port
}

void loop()
{
  if(Serial2.available())
  {
    Serial.write(Serial2.read());
  }
}

Boom. Done.

sorry my question was not much comprehensive.... i meant to say that if how could make NMEA sentence from just values of lat, long and time available..

Creating a CGA sentence from those elements is just a matter of formatting the string appropriately and faking those pieces, like altitude, Satellites Used etc. that you apparently don't have. You'll need to calculate the checksum too.

I'm also struggling to see why you would do this though. The only thing I can think of is that you're testing something that consumes NMEA and you want to simulate movement. For that though, I'd use the NMEA coming from the GPS and tweak it rather than build it from scratch.

i meant to say that if how could make NMEA sentence from just values of lat, long and time available

Serial.print statements will work, if you follow all the rules for constructing the NMEA sentences.

Actually my aim is to make a ZDA sentence if it is not available and my system run on ZDA sentence only.. however the GPS that i have give GGA GSV GRMC etc no ZDA specifically.. i tried to work it out through tiny GPS library but it didnt worked

For informed help, please read and follow the directions in the "How to use this forum" post.

adeelzxz: Actually my aim is to make a ZDA sentence

So buy a Ublox 6M or similar and configure it to send the ZDA.

Actually my aim is to make a ZDA sentence

To get anywhere on this forum, at some point you will have to describe what you actually want to do.

Why are you having so much trouble understanding this simple point?

The ZDA sentence provides TIME AND DATE INFORMATION and has nothing at all to do with TinyGPS, or GPS, for that matter.

The NMEA standard

The NMEA 0183 Interface Standard is used worldwide across many industry segments. The standard defines electrical signal requirements, data transmission protocol and time, and specific sentence formats for a 4800-baud serial data bus. Each bus may have only one talker but many listeners. This standard is intended to support one-way serial data transmission from a single talker to one or more listeners. This data is in printable ASCII form and may include information such as time, position, speed, water depth, etc.

adeelzxz,

which GPS module do you have? Your module might just need a little encouragement to provide you the data in the format you need. It is usually done trough the serial interface. We just need to figure out what chip is used, what messages need to be send and what software can be used to do this in a comfortable way.