Tuesday 7 July 2015

WEEK ELEVEN: 29 June to 3 July 2015


Task 1: PLX-DAQ

In order to have our data saved in an excel form for easy analyzing in the future, we have to extract the information from the Arduino. The software that we can use to directly send data over to excel is call PLX-DAQ.

Figure 1. PLX-DAQ Interface
Figure 1 shows the PLX-DAQ user interface. When the arduino is connected, set the serial port on the PLX-DAQ and run the program by clicking connect. 

But before that... There are some standard codes! We will use this simple code to explain how DAQ works.

double y = 2.14;   //y is a constant 

void setup() 
{
  Serial.begin(128000); // Sets baudto 128000 bps, set to 128000 on PLX-DAQ as well
  Serial.println("CLEARDATA");   //this is the standard code to include in order to print to 
  Serial.println("LABEL,Time,x,xy");   //printing the headings for DAQ. 
                                                               //LABEL must be included in front of each parameter
                                                               //Time is the time on our computer
}

void loop() 
{
  double x=random(20);   //generate a random number between 0-20
  double xy=x*y;   
  
  Serial.print("DATA,TIME,");    //standard code to initiate data & time display
  Serial.print(x);    //print out parameter x on on column
  Serial.print(",");   //comma doesn't gets printed out but it will move to the next cell
  Serial.print(xy);    //print

  row++;   //moving onto the next row

//this is to limit number of rows
  if (row > 360) 
   {
    row=0;
    Serial.println("ROW,SET,2");
   }
  delay(500);

}

Figure 2. Testing of DAQ
With this knowledge, we are able to send data to DAQ from the arduino and then logged in the parameters. At the end of race day, we can cross check them.


Task 2: Data Logging with Ethernet Shield

Apart from the distant transmission of data via modems, we also need to log data locally from the source - SunSPEC 4. This is so that we have a backup when there is a cut off in our transmission. We tested out data logging using the Ethernet shield. Data logger shield would be a more preferable method, however we do not have any at the moment.

Figure 3. Data collected 

Using the Ethernet shield, we connected it directly above the arduino. Using the above program, we are able to log data from the non invasive current sensor connected to a circuit. There is also a SD card slot which allows to log data and improve the reliability of the data shown on the serial monitor. However, connecting directly above the arduino shows an inaccurate reading of data. The data should be 2.5 V compared to the data collected of 2.74V at 0A. Hence, the test concluded that this is not the best way to log data.

Processing data in notepad to excel

Figure 4. Processing data from txt to excel file
During the race, we will require a good and clear display of data for analysis and one way is to put it into excel file. Besides using the PLX-DAQ to log data into excel, what if data is collected in note form or other forms? Actually, microsoft excel allows us to convert those files into excel without the need to install additional drivers or softwares.