Friday, September 28, 2018

WEEK 10 (FYP 2) WORKSHOP ON ABSTRACT WRITING, POSTER PREPARATION AND PRESENTATION

Activity: Briefing Week

As mention last week, the brefing for the 
Abstract Writing, Poster Preparation And Presentation was extand to this week. This is another briefing week after come back from Mid Semester Break. This week briefing about the Abstract Writing, Poster Preparation And Presentation. The speaker for this week is Dr Helmy Hakimie Mohd Rozlan. The details are below;

Date: 28/9/2018
Venue: TTL 2
Time: 3:00PM - 5:00PM

1. Writing an abstract. 
The abstract need to write only 1 paragraph containing words around the range of 200-300 words in only a page. Write on the summary of;
- Problem statement
- Objectives and Motivation
- Methodology and Approach used
- Results or Findings of the project
- Conclusion

2. Poster Presentation
We also had been brief on the poster presentation where Dr. Helmy give us the format of the poster. We can get this format from http://fyp.bmi.unikl.edu.my/guidelines.php



Title, Name, Programme
- Write on the title of our project as well as our name and programme that we're currently take

Objective
- Write only 2 to 3 objectives in a point form.
- Based on the FYP 1 objectives last semester.
- Must start the word with "To ...... "

Project Description
- Briefly explained on the intro and concept of our project.
- Must be written in sentences.
- Write also on the expected outcome of the project.
- It is advisable to keep it short, simple and precise instead of long and lengthy without much input.

Methodology
- Picture of block diagram without any explanation.
- The explanation needs to be presented during presentation day.

Flowchart
- Flowchart of the whole process of the FYP project.
- No sentence need to be included as this is to be explained during the presentation day.

Results
- In table or graph where there are only figures without sentences.
- Must be explained during the presentation day.
- Reflect on the discussion and analysis of the project.

Conclusion
- Reflect on the objectives.
- State whether the objectives are achieved or not and elaborate on it.
- Write on the application of our project what future enhancement that can be done for the project.

References
- Write it based on the APA format and in point form.
- State most references for project based on both FYP 1 and FYP 2.


3. Presentation skills
Dr. Helmy had also give us some info on how to be a better presenter. Few things that we need to take into consideration is:

Practice in front of the mirror
Arrive early during presentation day
Emphasize on the body language while presenting
Show the confidence during presenting
Make eye contact with the presenter



The briefing with Dr Helmy

Wednesday, September 19, 2018

WEEK 9 (FYP 2)

Activity: Proceed Testing the Respiration Rate

After trying to use others type of temperature sensor (LM35 and DHT22) we proceed to testing the thermistor again. So, the respiration rate was measured based on the coding that have been set. 


#include <LiquidCrystal.h>
enum respState 
{
    Inhaling,
    Exhaling
};
unsigned long prevRespTime = 0;
unsigned long currRespTime = 0;
respState currentRespState;
int movingAvgRespRate = 0;
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() 
{
  lcd.begin(16, 2);
    Serial.begin(9600);
    pinMode(9,OUTPUT); //buzzer
}


void loop()
{
    //delay(500);  
    // don't need to delay because we'll only fire once per inhalation and once per exhalation
    int sensorValue = analogRead(A0);

    if (sensorValue > 510 && currentRespState == Exhaling)
    {
        currentRespState = Inhaling;
        prevRespTime = currRespTime;  // save time from last cycle
        currRespTime = millis();

        float period_respiration = currRespTime - prevRespTime;
        float breathrate = 60000 / period_respiration;
        Serial.print("Inhaling \tRespirations per minute: ");
        Serial.println(breathrate);
        lcd.setCursor(0, 1);
        lcd.print("RPM");
        lcd.print(breathrate);

         if (breathrate>1 && breathrate<9)
        {
          digitalWrite(9,HIGH);
          delay(2000);
          digitalWrite(9,LOW);
          delay(200);
        }
        if (breathrate>60 && breathrate<100)
        {
          digitalWrite(9,HIGH);
          delay(1000);
          digitalWrite(9,LOW);
          delay(200);
        }
        else if (breathrate>101 && breathrate<500 )
        {
           digitalWrite(9,HIGH);
          delay(500);
          digitalWrite(9,LOW);
          delay(200);
        }
        else
        {
          digitalWrite(9,LOW);
        }
        
      
    }
    else if (currentRespState == Inhaling && sensorValue < 490)
    {
        currentRespState = Exhaling;
        Serial.println("Exhaling");
        lcd.setCursor(0, 0);
        lcd.print("Exhaling       ");
        
    }

}


Measure the Respiration Rate 

The measurement of the respiration rate was based on what value of the temperature sensor recorded. After knowing how the temperature was recorded, Arduino can process the data to measure respiration rate. When exhalation the temperature increase while inhalation the temperature decrease. From the value of the temperature measurement, the Arduino convert temperature value to the digital value so that the controller can calculate the respiration rate. The calculation for the respiration rate depends on the coding. 


The sensor value (temperature sensor) in digital was set up for exhalation

The sensor value (temperature sensor) in digital was set up for inhalation

The calculation to measure respiration rate.

The result for the respiration rate cannot be measured accurately. This is because of the temperature sensor that has been used is not suitable and not to be used to measure accurate breathing. But, there is some result from the testing might be the right value for the respiration rate because the normal respiration rate for an adult is 12-20breath per minute.

The result measured that get normal respiration rate.

The normal respiration rate (RPM 13) result display in the LCD

The result measured that get abnormal respiration rate

The abnormal respiration rate (RPM 38) result display in the LCD

The RPM:13.42 respirations per minute can be the normal result for the respiration rate while RPM:38.10 respirations per minute can be the abnormal respiration rate. Other than that must be the wrong result because of the wrong calculation that has been processed with wrong temperature changes by the microcontroller. When there is an abnormal result, the coding was set up for the buzzer to ringing. 







Thursday, September 13, 2018

WEEK 8 (FYP 2)

Activity: Testing other type of Temperature Sensor

After testing the thermistor temperature sensor, the measurement is not very accurate and what we want. After discuss with my supervisor and asking other lecturer for help, they suggest to try another type of temperature sensor to see if there is another temperature sensor that more accurate. The temperature suggested are LM35 and DHT 22. So, after that, i search about the LM35 and DHT 22. So, here the features for those temperature sensor. 

LM35



The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly-proportional to the Centigrade temperature. The LM35 device has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from the output to obtain convenient Centigrade scaling. The LM35 device does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature range. Lower cost is assured by trimming and calibration at the wafer level

DHT 22


The DHT sensors are made of two parts, a capacitive humidity sensor and a thermistor There is also a very basic chip inside that does some analog to digital conversion and spits out a digital signal with the temperature and humidity. The digital signal is fairly easy to read using any microcontroller.
  • Low cost
  • 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 0-100% humidity readings with 2-5% accuracy
  • Good for -40 to 80°C temperature readings ±0.5°C accuracy
  • No more than 0.5 Hz sampling rate (once every 2 seconds)
  • Body size 15.1mm x 25mm x 7.7mm
  • 4 pins with 0.1" spacing


Activity: Test the another type of temperature sensor

This week is actually a briefing week, but the briefing was extend as the FYP committee has a unavoidable problems. So this week i test the another temperature sensor which is LM35 and DHT22.

After bought the LM35 and DHT22 i do a research about the circuit and the coding. Different type of temperature sensor has a different circuit diagram and coding. 

So, when i test, the temperature changes are slow than thermistor. The LM35 has a very low accuracy for for detection of the temperature changes. While for the DHT22, the detection not so fast than the NTC thermistor. So, after try testing with my supervisor, it approve that the DHT are slower than NTC. The final choose is the use back the NTC thermistor for the temperature sensor. 


Circuit for LM35

Burn in a Arduino Software


#include<LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int sensor=A1; // Assigning analog pin A1 to variable 'sensor'

float tempc; //variable to store temperature in degree Celsius

float tempf; //variable to store temperature in Fahreinheit

float vout; //temporary variable to hold sensor reading

void setup()

{

pinMode(sensor,INPUT); // Configuring pin A1 as input

Serial.begin(9600);

lcd.begin(16,2);

delay(500);

}

void loop()

{

vout=analogRead(sensor);

vout=(vout*500)/1023;

tempc=vout; // Storing value in Degree Celsius

tempf=(vout*1.8)+32; // Converting to Fahrenheit

lcd.setCursor(0,0);

lcd.print("in DegreeC= ");

lcd.print(tempc);

lcd.setCursor(0,1);

lcd.print("in Fahrenheit=");

lcd.print(tempf);

delay(1000); //Delay of 1 second for ease of viewing in serial monitor

}


The connection for DHT22 with Arduino


Burn in a Arduino Software


#define DHT11_PIN 4 // ADC0 Define the ANALOG Pin connected to DHT11 Sensor

int temp1[3]; //Temp1, temp2, hum1 & hum2 are the final integer values that you are going to use in your program.

int temp2[3]; // They update every 2 seconds.

int hum1[3];

int hum2[3];

byte read_dht11_dat()

{

byte i = 0;

byte result=0;

for(i=0; i< 8; i++){

while(!(PINC & _BV(DHT11_PIN))); // wait for 50us

delayMicroseconds(30);


if(PINC & _BV(DHT11_PIN))

result |=(1<<(7-i));

while((PINC & _BV(DHT11_PIN))); // wait '1' finish

}

return result;

}

long dht11delay_previousMillis = 0; // will store last time LED was updated

long dht11delay_interval = 1000; // dht11delay_interval at which to blink (milliseconds)
void setup()

{

DDRC |= _BV(DHT11_PIN);

PORTC |= _BV(DHT11_PIN);

Serial.begin(9600);

Serial.println("DHT11 without delay");

Serial.println("Example code by: Nick Athanasoulas");

Serial.println("Ready");

delay(1000);

}

void loop()

{
unsigned long dht11delay_currentMillis = millis();

if(dht11delay_currentMillis - dht11delay_previousMillis > dht11delay_interval) {

// save the last time you blinked the LED

dht11delay_previousMillis = dht11delay_currentMillis;

byte dht11_dat[5];

byte dht11_in;

byte i;

// start condition

// 1. pull-down i/o pin from 18ms

PORTC &= ~_BV(DHT11_PIN);

delay(18);

PORTC |= _BV(DHT11_PIN);

delayMicroseconds(40);

DDRC &= ~_BV(DHT11_PIN);

delayMicroseconds(40);

dht11_in = PINC & _BV(DHT11_PIN);

if(dht11_in){

Serial.println("dht11 start condition 1 not met");

return;

}

delayMicroseconds(80);

dht11_in = PINC & _BV(DHT11_PIN);

if(!dht11_in){

Serial.println("dht11 start condition 2 not met");

return;

}

delayMicroseconds(80);

// now ready for data reception

for (i=0; i<5; i++)

dht11_dat[i] = read_dht11_dat();

DDRC |= _BV(DHT11_PIN);

PORTC |= _BV(DHT11_PIN);

byte dht11_check_sum = dht11_dat[0]+dht11_dat[1]+dht11_dat[2]+dht11_dat[3];

// check check_sum

if(dht11_dat[4]!= dht11_check_sum)

{

Serial.println("DHT11 checksum error");

}

temp1[0]=dht11_dat[2];

temp2[0]=dht11_dat[3];

Serial.print("Temperature: ");

Serial.print(temp1[0]);

Serial.print(".");

Serial.print(temp2[0]);

Serial.print(" C");

Serial.print(" ");

hum1[0]=dht11_dat[0];

hum2[0]=dht11_dat[1];

Serial.print("Humidity: ");

Serial.print(hum1[0]);

Serial.print(".");

Serial.print(hum2[0]);

Serial.println("%");

}

}