Home
| pfodApps/pfodDevices
| WebStringTemplates
| Java/J2EE
| Unix
| Torches
| Superannuation
|
| About
Us
|
Data Transfer Rate in Ardunio |
by Matthew Ford 10th Dec 2016 (originally
posted 10th Aug 2014)
© Forward Computing and
Control Pty. Ltd. NSW Australia
All rights reserved.
pfodApp can
plot incoming CSV (comma delimited values) data in real time, so a
common question is
“How fast can I plot data?”
The
simple answer is:- (see Remote
High Speed Data Logging for a more detailed answer)
“If
you have a recent multi-core mobile, then Arduino Uno is the limiting
factor. At 115200 baud you can send about 500 data pairs per sec
maximum. That is about 1mS per 9 byte field.”
The maximum speed you send sample data depends on:-
the baud rate for transferring the bytes off the Arduino card
the time required to convert the numeric data into bytes (e.g. Serial.print(data) )
the time used by the rest of the Arduino loop() to collect and scale the data, and do what ever else the loop() is doing.
In order of importance.
Use 115200 baud rate hardware serial connections. (SPI connection to the Ethernet shield is slower when tested on Uno)
Use faster Arduino processors. (The timings below use an 8Mhz Arduino. The Mega uses 16Mhz)
Avoid floating point operations particularly division as they are much slower then integer operations on most Arduino boards
Send integer data instead of floating point. The Print statements format faster.
Keep the rest of the loop()
quick. Avoid delay()
and use polling or interrupt operations in preference to the
operations that wait for results. See Polling
Analog Reads for example.
Here is a simple sketch to test the data transfer rate. It prints out the time in milliseconds every 1000 loops and sends on line of CSV per loop to the pfodApp.
Sending 16 bytes as two 7byte fields takes less then 2ms per sample on 8Mhz FioV3 using 115200 baud connection to a Roving Networks Wifly wifi board. Most of the time is consumed transferring the bytes at 115200 baud, since the loop() is not doing much else and the sketch is sending integers. This is about as fast a you can go.
For use of the Arduino name see http://arduino.cc/en/Main/FAQ
The General Purpose Android/Arduino Control App.
pfodDevice™ and pfodApp™ are trade marks of Forward Computing and Control Pty. Ltd.
Contact Forward Computing and Control by
©Copyright 1996-2020 Forward Computing and Control Pty. Ltd.
ACN 003 669 994