loading
1 Comments

Tell us about yourself!

Complete Your Profile
  • Sending data from Arduino to Excel (and plotting it)

    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:[code]int val = 0;int row = 0;void setup() {Serial.begin(4800); // the bigger number the betterSerial.println("CLEARDATA"); //clears up any data left from previous projectsSerial.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 loo...see more »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:[code]int val = 0;int row = 0;void setup() {Serial.begin(4800); // the bigger number the betterSerial.println("CLEARDATA"); //clears up any data left from previous projectsSerial.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 BSerial.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 rundelay(750); //add a delay}[/code]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...

    View Instructable »