How to Pack a data in Arduino?

Need help in data packing...
actually my project is to send a packed data through GSM Module..
the packed data contain pulses (8-bit) + GPS Coordinates + some Digital bits ..

Please explain more as this is too little information to say something meaningful

What is the goal of your project?
What hardware do you use?
What sensor?
What code do you have allready?

actually the project is Fuel Management system...
using a sensor
now i have to take the values from sensor through Arduino..
the goal of this project is to take the values of fuel from the vehicle, its GPS location and some digital bits (i.e. engine running or not running, fuel tank is open or not, engine in idle state or not),
and send this data through GSM module to a server or at database.
the problem now i m facing is that,
how to pack these informations ?

and the fuel sensor i m using is this
Differential Fuel Flow Meter

http://www.jv-technoton.com/fuel_flow_meter/differential_fuel_flow_meter

Packing data:

  1. send a comma separated string in which each field has a defined meaning: e.g. 12,3,90,16,...

  2. used named fields: la=12, lo=3, speed=90, uptime=16

The advantage of 2 is that you can send a subset and the order does notmatter, the advantage of the first is you get all readings every time so relations between fields are more clear,

is it possible to pack this data in single byte...
and then send this byte?

No. To send GPS position data with any meaningful precision, let alone your other data, will take much more than a single byte.

ok

As in my earlier post i questioned that: how to pack the data?
now i am not getting that how to convert the pack data from string into a single byte?

Please keep your discussion in one thread, otherwise it is more difficult for us to see what has been said on this topic, and for you to collect the answers.

A byte [8-bit] can only contain 256 distinct values, if you have more than 256 different strings you cannot code them in a byte.

sorry :frowning:
can u share the code ?

what code?

of converting the string to byte?

I am receiving the data from fuel sensor, from GPS, digital bits, and I am adding the bytes to an array, ultimately I would like to get this string of values into a single integer. say Ive got an array that is [62, 22,1,1,0,0] ... I need to get this as an int

say Ive got an array that is [62, 22,1,1,0,0]

An array of what? Characters? If that is the case, it should be shown as "[62, 22,1,1,0,0]".

I need to get this as an int

If it is an array of characters, the characters look like they contain 6 distinct numbers. Why do you think that you can pack those 6 values into a single int, with any hope of making sense of the data later?

Depending on the details of the data you're trying to transmit, it will likely be possible to pack it into a few bytes, but you're going to need to specify exactly what that data is, particularly what range each item can vary through. Regarding the Lat/Long data, there may be potential to reduce it somewhat, depending on how precise a fix you need. Also, if your vehicle is constrained to Peshawar, or even Pakistan, you may be able to avoid sending the high order bits of the positional info. We need more specifics to be any more help, but right now, I don't see this fitting in an int; why is this important?