# Good practice for sending data from Arduino to Processing

**URL:** <https://discourse.processing.org/t/good-practice-for-sending-data-from-arduino-to-processing/6339>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [December 5, 2018, 6:48pm UTC](https://discourse.processing.org/t/good-practice-for-sending-data-from-arduino-to-processing/6339 "2018-12-05T18:48:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 5, 2018, 7:12pm UTC](https://discourse.processing.org/t/good-practice-for-sending-data-from-arduino-to-processing/6339/2 "2018-12-05T19:12:51Z")

</div>

there are many ways, but for datasets i use CSV style,

> 1024,1024,1024,1024,

per line what actually requires good documentation what data is what sensor…  
and it is faster insofar as the line sending and line catching via serial/USB  
( you would send 4 lines )  
takes more time as the string separation.  
( your way also needs that value decoding… )

but there are many other way,  
the fastest still would be a byte stream ( not ASCII ) but i hate, as i can not read it in  
Arduino IDE terminal  
the slowest would be a full text way what i actually can recommend,  
it is a JSON record

```auto
{ "unit1" : { "S1" : 1024 , "S2" : 1024, "S3" : 1024, "S4" : 1024 }, "unit2" : {....} }

```

so sending a lot of “redundant” text looks like a waste of “bandwidth”…  
but is very clear, readable for us and a JSON function from reading to saving to file…  
there is a kind of frame check ( too short lines would be rejected… )

is this to slow for you??  
well why not run with

```auto
 Serial.begin(57600);

```

if you need slow 9600Bd to get connection you have heavy cable issues  
like free wiring or too long cable…

---

_[View the full topic](https://discourse.processing.org/t/good-practice-for-sending-data-from-arduino-to-processing/6339)._
