
Now I want to try and reduce the characters/bytes being transmitted and I am looking for techniques/methods of using bytes instead of asciii. This method has proved to be very reliable.
Which serial communication protocol is most valuable serial#
When using serial communication I almost always use string/ascii data with Robin’s start and end markers function. The point I am trying to illustrate is that if you move away from a text based ASCII oriented system of data transmission, it brings its own problems you will have to consider and take into account in the particular application you are designing. Both have short comings that would probably mean they are not useful any where else. You might point out that this is wasteful and you'd have a point except I don't need to transmit much data and all I am wasting is time on a serial port that would otherwise be idle.īoth the above were designed for very specific purposes and both relied on fixed data lengths. As the result of the measurement is 4 bytes (uint32_t), which could contain any value whatsoever, the only way I could think of to get a unique starting value was to use 5 bytes to indicate start, so I have 0x5a 0x5a 0x5a 0x5a 0x5a followed by 4 bytes of data. I also have a PIC measuring the mains voltage of my mains supply, this is connected directly to the mains so has to send its output via serial through an opto isolator. What methods and techniques can be employed to send the same values but using the minimum number of bytes while still being able to determineġ - I can reliable find the start of a data setĢ - identify the sensor or what the data isģ unique bytes that I knew would never appear in the data, these being 0xa5 0xa5 0xa5 followed by a fixed 5 bytes of data, soon to become 7 bytes for a particular application I working on. The data has identifying labels such as T for temperature, H for humidity, P for pressure, etc. Data from this Arduino is transmitted to a second Arduino for data logging. What are preferred protocols and how would you go about labeling data to differentiate it while minimizing the amount of bytes used? As an example, I have several sensors and devices connected to an Arduino. At present I have no real need for this beyond doing it to learn.

When using serial communication I almost always use string/ascii data with Robin's start and end markers function.
