Sunday, 28 October 2018

Sem 7 : week 6 & 7

Hai everyone..

i'm just want to highlight for both week for week 6 and week 7 .. i am going to meet Sir Zubir and we are disscusing about the coding for each sensor and compile all the three coding for three sensor.

There is the coding for 3 sensor which temperature, turbidity and the PH sensor .


#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 5

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
 float Celcius=0;
 float Fahrenheit=0;
// Assign the unique addresses of your 1-Wire temp sensors.
// See the tutorial on how to obtain these addresses:
// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

DeviceAddress insideThermometer = { 0x28, 0xFF, 0xA7, 0x03, 0x81, 0x17, 0x05, 0xD6 };

int sensorPin = A0;
float volt;
float ntu;

//////////////////////////////////////////////
#define SensorPin A1                               //pH meter Analog output to Arduino Analog Input 0

unsigned long int avgValue;                 //Store the average value of the sensor feedback
float b;
int buf[10],temp;
 float phValue;

///////////////////////////////////////////////



void setup() {
  pinMode(13,OUTPUT);
  Serial.begin(9600);
  Serial.println("Ready");
  sensors.begin();
  //lcd.begin();

  // Turn on the blacklight and print a message.
  //lcd.backlight();
}

void loop() {
   turbidity();
   ph_sensor();
   temp_A();
  delay(500);
}

void turbidity()
{
  int sensorValue = analogRead(A0);// read the input on analog pin 0:
  float voltage = sensorValue * (5.0 / 1024.0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  Serial.println(voltage); // print out the value you read:




void ph_sensor(){
  for(int i=0;i<10;i++){                        //Get 10 sample value from the sensor for smooth the value
    buf[i]=analogRead(A1);
    delay(10);
  }
  for(int i=0;i<9;i++){                         //sort the analog from small to large
    for(int j=i+1;j<10;j++){
      if(buf[i]>buf[j]){
        temp=buf[i];
        buf[i]=buf[j];
        buf[j]=temp;
      }
    }
  }
  //Serial.println(temp);
  avgValue=0;
  for(int i=2;i<8;i++) avgValue+=buf[i];                       //take the average value of 6 center sampl
  avgValue=avgValue/6;                                 
  Serial.print("Average Analog Reading: ");
  Serial.println(avgValue);

  float VoltageValue=(float)avgValue*5.0/1024;               //convert the analog into volt
  Serial.print("Input Voltage:");
  Serial.println(VoltageValue);
  // float phValue;
   phValue=(VoltageValue-3.77)/-0.1698;
  Serial.print("    pH:"); 
  Serial.print(phValue,2);
  Serial.println(" ");
}

float round_to_dp( float in_value, int decimal_place )
{
  float multiplier = powf( 10.0f, decimal_place );
  in_value = roundf( in_value * multiplier ) / multiplier;
  return in_value;
}

void temp_A()
{
  sensors.requestTemperatures();
  Celcius=sensors.getTempCByIndex(0);
  Fahrenheit=sensors.toFahrenheit(Celcius);
  Serial.print(" C  ");
  Serial.print(Celcius);
}





The output from the coding .


So, settle my task about the coding . Thanks to Sir Zubir because always help me in develop my project.

# next week is mid semester break .

Saturday, 27 October 2018

Sem 7 : week 5



WEEK 5
OBJECTIVE              : To enlighten students on Final Year Project 2.

CONTENT                 :
  • FYP 2 2nd Briefing
    • Time: 3:00 – 5:00 p.m.
    • Date: 15/8/2018
    • Venue: TTL 2
    • Speaker: Ms. Najiyah Binti Salleh (NSA)


RESULT/ANALYSIS:
·         The speaker thoroughly explained on about the chapter 4 and 5 for the FYP report. Give the information on what needs to be including in the report. Give the explanations on the point that has high mark. Miss Najiyah also explain on how to write a good conclusion.

CONCLUSION         :
These briefings provide the information on FYP report.
This briefing provides guideline for writing the discussion and conclusion.



Sem 7 : Week 4


This is week 4 already .. My progress is i meet my SV to calibrate each sensor and build a coding for each sensor..


There is my progress for this week ..

void setup() {
  Serial.begin(9600); //Baud rate: 9600
}
void loop() {
  int sensorValue = analogRead(A0);// read the input on analog pin 0:
  float voltage = sensorValue * (5.0 / 1024.0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  Serial.println(voltage); // print out the value you read:
  delay(500);
}

🔺 this is coding for turbidity sensor .




Testing of Arduino Uno 





Calibrate of temperature sensor .

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 5

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// Assign the unique addresses of your 1-Wire temp sensors.
// See the tutorial on how to obtain these addresses:
// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

DeviceAddress insideThermometer = { 0x28, 0xFF, 0xA7, 0x03, 0x81, 0x17, 0x05, 0xD6 };


void setup(void)
{
  // start serial port
  Serial.begin(9600);
  // Start up the library
  sensors.begin();
  // set the resolution to 10 bit (good enough?)
  sensors.setResolution(insideThermometer, 10);
  
}

void printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
  if (tempC == -127.00) {
    Serial.print("Error getting temperature");
  } else {
    Serial.print("C: ");
    Serial.print(tempC);
    Serial.print(" F: ");
    Serial.print(DallasTemperature::toFahrenheit(tempC));
  }
}

void loop(void)
{
  delay(2000);
  Serial.print("Getting temperatures...\n\r");
  sensors.requestTemperatures();

  Serial.print("Inside temperature is: ");
  printTemperature(insideThermometer);
  Serial.print("\n\r\n\r");
🔺 Coding for temperature Sensor..



Thats all my update for this week.. thank you.

Sem 7 : week 3




WEEK 3
OBJECTIVE              : To enlighten students on Final Year Project 2.

CONTENT                 :
  • FYP 2 1st Briefing
    • Time: 3:00 – 5:00 p.m.
    • Date: 1/8/2018
    • Venue: TTL 2
    • Speaker: Dr. Kanendra Naidu Vijyakumar (KNV)


RESULT/ANALYSIS:
·         The speaker thoroughly explained on about the final year project. Give a hand-out about the schedule for the whole semester. Briefing about the schedule for the FYP2 meeting for the whole semester. Give the deadline for the submission of the report and hardcover.

CONCLUSION         :
These briefings provide the information on FYP2 and highlight the important date.


Sem 7 : Week 2


This is week 2 .. ( 23/7/2018 - 27/7/2018 )



  Hai everyone ... I already buy the component for my Fyp .
 Some of components i bought  from Jalan Pasar and some from online store which is Lazada and Zalora.


For this week , i just review each component that i already buy for my FYP.



1. Arduino Uno ( RM 50 )

2.Wifi Module ( Rm 20)

3.Temperature Sensor ( Rm 20 )

4.PH sensor ( RM 200 )

5.Turbidity Sensor ( RM 60 )



As conclusion , all the components that i need for FYP already have so my next task is calibrate each sensor  and try to build coding for sensor .

SEM 7 : week 1


Welcome July ..

FYP !! FYP !!



Now sem 7 are begin , week 1 ( 16/7/2018 to 20/7/2018 ) .. This week are free FYP activities  then my activities for week 1 is meet FYP supervisors which is Sir Zubir .. 

In this week , i discuss with my SV  to buy the list of component FYP .. 

The list component need to buy after discuss with my SV is 

1. Arduino 
   2.PH Sensor 
3.Turbidity Sensor
4.Temperature Sensor
5.Wifi module 
So i need to survey the price at Jalan Pasar and online store so i can compare the price then after all the components i have then i need to start my project.