Wednesday, 13 March 2013

Our current Poster for the bench inspection

For what's it's worth, the most we could do for 6 weeks. What is left to do is our thesis which has a deadline : 22/03/2013

Thursday, 7 March 2013

New Codes

So far, we've wanted the readings to be called rather than continuously send data. Therefore, we changed the the codes into a format where the main PC will be able to call the transmitter to send the data being read.

It turned out as so:


float tempK=0, tempC=0, tempF=0;
void setup(){
  Serial.begin(9600);                    //Setup serial to 9600 bps

}

void loop(){

  Serial.println("Enter '1' to prompt results");

  float reading = analogRead(A0) * 5.0;   //Where 5.0V and the Analog (ADC) input
  reading /= 1024.0;                                // is used to determine the voltage reading

  tempK = reading * 100;                  //Read temperature in Kelvins first

  tempC = tempK - 273.15;                //Convert from Kelvin to Celsius

  tempF = ((tempK) * 9 / 5) - 459.67;    //Convert from Kelvin to Fahrenheit


  while (Serial.available() ==0);       //where no value is entered, no data is sent

  int val = Serial.read() -'0';          //Set the codes to read 'Char' of the ASCII Table
  delay(50);

  if(val == 1)                         //For when the value '1' is given, the data is read
  {
 
    //Print all the values to Serial
    Serial.print("Voltage: ");
    Serial.println(reading);

    Serial.println();

    Serial.print("Kelvin: ");
    Serial.println(tempK);

    Serial.print("Celsius: ");
    Serial.println(tempC);

    Serial.print("Fahrenheit: ");
    Serial.println(tempF);

    Serial.println();    //Print Blank Line
  }
  else                            // For any other data expect for '1', causes an invalid
  {
    Serial.println("Invalid");
  }
  while (Serial.available() > 0) Serial.read();

}

Regarding the ASCII Table, if the code was not placed. The value read from pressing '1' will be '49'
ASCII Table

Friday, 1 March 2013

Info Gathering

Google my friend...
Loads of information gathering is needed. All thanks and appreciation goes to the findings and the links given to us thus far.

Sunday, 24 February 2013

Arduino UNO

Arduino UNO
The Arduino UNO is a microcontroller board based on the ATmega328. Using the Arduino software, we use the codes uploaded into the microcontroller to calculate, read or write however way we can code it to. This device can be powered up both ways. One is from the A-B USB Cable connected to the PC while the other is from a 9V external power supply.

XBEE Shield

Board, Arduino, XBEE Shield, w/o module
The device here is used to mount the Xbee module onto the Arduino UNO. On the far left of the device in the picture, there is a cap for 2 pins. This cap here is for the 3 pins on this Xbee Shield. Naming the pins '1', '2', '3' from left to right, covering '1' and '2' will set the shield to 'USB' mode and covering '2' and '3' will set it to 'XBEE' mode. From what we found out/ read online, the 'USB' mode allows configuration of the Xbee module. In other words, we can say that information can only be passed around from the USB using the A-B  USB Cable. The 'XBEE' mode should also work the same way where information can only be passed around from the Xbee module attached to the Xbee Shield.

XBEE Module

XB24-BWIT-004 module, ZIGBEE XBEE ZNET 2.5
The Xbee is the brand name from Digi International for a family of form factor compatible radio modules. Using 2 of this module, we can set up a wireless communication using the IEEE 802.15.4 standard. One of the module will be written and configured into a Coordinator. The device will issue an 802.15.4 beacon request command on multiple channels (frequencies) after the device has started a PAN (Personal Area Network). This is where the other module comes in play, we write and configure the other to be the End Device. This End Device will locate and join the PAN. Note that this module have a PAN ID, so make sure to set the ID (range between 0x0000 ~ 0xFFFF) similar for both modules. For our project, we set them to a PAN ID of 0x1AAA.

Friday, 15 February 2013

15th Feb 2013

New Software Used:
  • X-CTU Software (www.digi.com/support/productdetail?pid=3352)
For today's trial and errors, we will be finally working on the "Wireless" part of the project. The devices used for this part will be the Xbee module with the Xbee Shield. What is needed to be done is to set one of the modules as a Coordinator and the other as a Router/End Device. That is where the X-CTU software comes into play as it allows us to configure the setting on the Xbee module.

First up, we would like to connect the Xbee module to the PC. mount the Xbee module onto the Xbee Shield and the Xbee Shield to the Aduino UNO. Take precaution that you will need to remove the ATmega328 from the Arduino UNO. Best advice is to use a screwdriver and slowly pry it off the device. Next, make sure the 2-pin caps on the Xbee Shield are capping the USB side of the 2 out of the 3 pins. Now comes the part where one module receives while the other transmits.

On the X-CTU, under the 'PC settings' tab, set the Baud, Flow Control, Data Bits, Parity and Stop Bits similar to the settings on COM5 (The COM which your Arduino is connected to). Click the 'Test/Query' to see if the componens can communicate and are linked. Sometimes, the outcome would fail. So make sure to check the ATmega328 is out, the caps are capping the right pins, all connections are connected properly and for safe measure, press the 'reset' button on the Arduino UNO. Once successful, click the 'Modem Configuration' tab and under the 'Modem Parameter & Firmware', click 'read'. This will all the XCTU to read what modem is being used currently. Ours would be XB24-B.

Set the 'Function Set' to Coordinator for one of the module and Router/End Device for the other. Here, we are free to change the network settings to however we see fit.