Using PLX-DAQ to read data from Arduino Uno, please help!

So I am attempting to read in a voltage. I then want to log that voltage over time and graph the change. I am currently using excel 2003 and the voltage I am reading is coming from a circuit with a source, photo-resistor, and 10k resistor in series. I can read output in the serial monitor so I know the circuit is working. Please take a look at my Arduino code:
int val = 0;
int row = 0;

void setup() {

Serial.begin(4800); // the bigger number the better

Serial.println("CLEARDATA"); //clears up any data left from previous projects

Serial.println("LABEL,Time,Data"); //always write LABEL, so excel knows the next things will be the names of the columns (instead of Acolumn you could write Time for instance)

Serial.println("RESETTIMER"); //resets timer to 0

}

void loop() {

float value = analogRead(3);
float voltage = value * (5.0 / 1023.0);

Serial.print("DATA,TIME,TIMER,");//writes the time in the first column A and the time since the measurements started in column B
Serial.println(voltage);

row++;
if(row>360){
    row = 0;
    Serial.println("ROW,SET,2");
  }

Serial.println(); //be sure to add println to the last command so it knows to go into the next row on the second run
delay(750); //add a delay

}

I get the feeling my code should work. When I open PLX-DAQ three sheets open: Simple data, Simple data with plots, and Interactive bar graph, also, the active x program pops up and I am able to connect to the Arduino through port 3.. C is green R flashes red and T is green. However, when I do click connect nothing happens. I was under the impression that data should have started filling the first two coulombs, is this not correct? I also tried clicking new, three new sheets pop up, here I tried again to connect and no data started to flow in. I tried labeling coulomb a and b with Time and Data and then connecting but still no data.

So my question is this. Is there a problem with my code or is there some kind of data acquisition setup I have to go through in excel to get data coming in to new sheets or any sheet for that matter. Please help, been wrestling with this for a few days now...

Comments

  • Reduce the code in the loop to just this:
    Serial.println(analogRead(3));
    delay(250);
    

    If your sensor is working, you should see the values directly. If it stays at 0 or some other value, then you can suspect the sensor is not working, rather than your code. You should always verify the operation of things attached to the Arduino (or other microcontroller) using the simplest code you can. Makes it easier to determine where the problem is.
Sign In or Register to comment.