Wireless Data Logging

I want to log 3 analog inputs taken from my Arduino (2 bytes each sample since A/D is 10 bit) and wirelessly send the data to my computer at 10KHz. I would like to highlight that my computer needs to log the samples at 10KHz using LABVIEW or MATLAB.

I've experimented with using Zigbee (Xbee) and Bluetooth (RN-41) protocols and they both don't seem to communicate as fast as I would like (I'm still trying to work on the Bluetooth). I know that my Arduino Uno A/D converter can sample faster than 10KHz, so that's not a limiting factor. I'm now looking at Wi-Fi since apparently it's the fastest option.

  1. My first question is can Wi-Fi log my data faster than 10KHz? It seems that the datasheets for Xbee and Bluetooth that specify throughput rate have almost nothing to do with data transfer speed, so I'm wondering if anyone has actually done this.

  2. My second question is what exactly do I need to log these inputs if I use Wi-Fi? I do not have much microcontroller experience, so I'm not sure what base components I need. I have a personal habit of always forgetting to order something that I need (for example, a Bluetooth USB Dongle for my computer), so I'm trying to minimize that.

It seems like Wi-Fi is a completely different animal from Zigbee and Bluetooth, so any advice at all would be great. Thanks!

Also, if anyone has any questions about max data sampling rates using Zigbee or Bluetooth for their own projects, feel free to ask me about the tests I've been running.

Are you taking into account that the Arduino has only one ADC and without special tricks, 3 channels can be sampled at no more rapidly than about 3 kHz each?

Are you taking into account that the Arduino has only one ADC and without special tricks, 3 channels can be sampled at no more rapidly than about 3 kHz each?

I set the ADC prescalar value to 32 (the original one is 128). Therefore, I can sample at a faster rate. I have test code of determining the total sampling time of all 3 AnalogReads, and it came out to be 92us (10.87 KHz). I can keep lowering the prescalar value to 2, but to my understanding, that would decrease the resolution.

I have my test code attached:

#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
// the setup routine runs once when you press reset:
void setup() {
// This next set of code sets the ADC sampling rate (Page 217 of ATmega32 Datasheet)
// sbi changes the corresponding bit to 1, while cbi changes the bit to 0
 sbi(ADCSRA,ADPS2) ;
 cbi(ADCSRA,ADPS1) ;
 sbi(ADCSRA,ADPS0) ;

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int start = micros() ;
  uint16_t  sensorValue1 = analogRead(A1);
  uint16_t  sensorValue2 = analogRead(A2);
  uint16_t  sensorValue3 = analogRead(A3);
  int time=micros()-start;
  Serial.println(time) ;

Even if the Arduino is the limiting factor, I would still like to know of a wireless module/transceiver combination people know can log data higher than 10KHz so that I can try to put something together that works.

Rather than discuss sample transmission rate, you need to be looking at bit transfer rates, for error free transmission (if that is required). If you send two bytes/sample, the minimum packet size is 48 bits, which is equivalent to 480,000 bits/sec. Packing 3 samples into 32 bits gets you down to 320,000 bps. I think the general rule or thumb is that the bit rate for error-free transmission is less than one tenth of the raw bit rate.

The other question is: how rapidly can the Arduino sample the ADC and send the data out through a port in the required format, with the needed handshaking, for the chosen transport medium? You may be asking too much of a standard Uno.