06-22-2015 11:40 PM
I am using the following VI for arduino HC-06 bluettoth data acquisition. I would like to acquire multicahnnel data
Could you suggest me how to acquire multichannel data from USB? To do this, in what way i have to program the arduino?
Solved! Go to Solution.
06-23-2015 04:28 AM
06-24-2015 06:53 AM
Dear Albert,
Thank you for your reply,
The arduino code is pretty simple
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(57600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
Serial.println(voltage);
}
06-24-2015 07:33 AM
06-30-2015 05:43 AM - edited 06-30-2015 05:44 AM
Dear Mr. Dennis
You are right, that code is for single channel only.
for multi channel transmission, i am using the attached code...
The problem is,
all 4 channel data, i can read properly in arduino serial montor.
In labview, i am able to read 2 channel only.
there is some problem in acquiring data through labview, could you kindly suggest somthing which will work?
06-30-2015 06:18 AM
06-30-2015 07:05 AM
I tried arduino in suggested way. but it was throwing an error.
that's why i programmed it so.
Images are attched herewith for your perusal.
06-30-2015 07:50 AM
07-01-2015 01:18 AM
Thank you very much for your suggestions. its working.
But if i give input to channel 2 or 3 or 4, they are not responding. only channel 1 is responding irrespective of input pin. what could be the reason for this?
earlier, i was acquiring single channel data at 57600 baudrate, i was getting pure sine wave signal upto 90Hz, after that it was started distorting.
Now, it started distoring above 20Hz, i think i need to increase the baudrate to 230400 to get 4 channel undistorted signal upto 100Hz,
but arduino supports upto 115200 only, what shall i do??