Saturday, March 31, 2018

week 10

Title:  Assemble the hardware
Objective:  To assemble the component into the prototype 

Analysis/Discussion: for this week progress, after the component has been tested I proceed with the prototype. I have built the structure of my land mower based on the prospect I have made. The process includes compiling component into the prototype.
The picture  above shows the structure of my prototype 

After assembling all component into the  prototype  i test again the component to make sure the prototype it's working.

this the video my prototype.

Conclusion: as a conclusion, for this week make the prototype is achieved. 

Saturday, March 24, 2018

week 9

Title:  create a program land mower  in arduino 
Objective:  To make the real program for the land mower 

Analysis/Discussion: for this week, I create the program for my product using Arduino.



#define trigPin 13
#define echoPin 12
#define led 8
#define led2 9
#define led3 100
#define led4 11

int i=0;// motor one
int enA = 6;
int in1 = 5;
int in2 = 4;
// motor two
int enB = 3;
int in3 = 2;
int in4 = 7;

  
void setup() {
  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(led, OUTPUT); // indicates no obstacle (>40cm)
  pinMode(led2, OUTPUT); // indicates obstacle present (<40cm)
 // pinMode(led3, OUTPUT); //dummy utk turn right
 // pinMode(led4, OUTPUT); //dummy utk turn left
  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
   
}

void loop() 
{ 
  long duration, distance;
  digitalWrite(trigPin, LOW);  // Added this line
  delayMicroseconds(2); // Added this line
  digitalWrite(trigPin, HIGH);
//  delayMicroseconds(1000); - Removed this line
  delayMicroseconds(10); // Added this line
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;

  Serial.print(distance);
  Serial.println(" cm");
  Serial.print("I = ");
  Serial.println(i);
  Serial.println();
    
  if (distance > 40 && (i==0 || i==1)) // indicates no obstacle (>40cm)
  {  
    digitalWrite(led, HIGH); // When the Red condition is met, the Green LED should turn off
    digitalWrite(led2, LOW);
//    digitalWrite(led3, HIGH);
//    digitalWrite(led4, HIGH);
  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);
  analogWrite(enA, 255);  
  digitalWrite(in3, HIGH);
  digitalWrite(in4, LOW);
  analogWrite(enB, 255);

  }

    else if (distance < 40 && i == 1)
  {
    digitalWrite(led, LOW); // LED 1(no obstacle) OFF 
    digitalWrite(led2, HIGH); // LED 2(obstacle) ON 
    //Make 180 turn to right 
//    digitalWrite(led3, HIGH);
//    digitalWrite(led4, LOW); //dummy utk turn left
    motorLeft();
    delay(6350); //delay kne buat bg ckup masa utk motor buat pusingan
    i = 0;
  }
  
  else if (distance < 40 && i == 0) 
  {
    digitalWrite(led, LOW); // LED 1(no obstacle) OFF 
    digitalWrite(led2, HIGH); // LED 2(obstacle) ON 
    //Make 180 turn to left 
//    digitalWrite(led3, LOW);
//    digitalWrite(led4, HIGH); //dummy utk turn left
    motorRight();
    delay(6350); //delay kne buat bg ckup masa utk motor buat pusingan
    i = 1;
  }
  
  delay(10);
}

void motorLeft ()
{
  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);
  analogWrite(enA, 255);  
  digitalWrite(in3, LOW);
  digitalWrite(in4, LOW);
  analogWrite(enB, 255);
  
}

void motorRight ()
{
  digitalWrite(in1, LOW);
  digitalWrite(in2, LOW);
  analogWrite(enA, 255);  
  digitalWrite(in3, HIGH);
  digitalWrite(in4, LOW);
  analogWrite(enB, 255); 
  

}




Conclusion: as a conclusion, this week i focus for the program and the program its already test in hardware also working well but not calibrate in prototype. 

Saturday, March 17, 2018

week 8

Title:  test the hardware 
Objective:  To test the hardware whether it's working well or not.

Analysis/Discussion: for this week, I want to the hardware such as motor dc 12v 60 rpm, motor driver L298n and solar charger controller, furthermore this week I got solar panel I order last week 



Conclusion: as a conclusion, the motor i make a refund and buy another 2 motor dc same rpm for my backup, and solar charger controller i buy for because of that  solar charger might have a problem     

Friday, March 9, 2018

week 7

Title:  survey other components  and Test sensor 


Objective:  buy another component and test the sensor either its working well or not.

Analysis/Discussion: for this week, I go to Jalan Pasar again, to buy another component which is solar panel 12v 10W, motor 12 30rpm, battery 12v 7.2ah 




furthermore, this week also do some test for ultrasonic sensor, to check either that sensor working well or not.



Conclusion: as a conclusion, all the component has been bought except solar panel because too expensive and over budget so I decide to buy online. After that for the test, the result of testing is working well and the sensor is very accurate.

Friday, March 2, 2018

week 6

Title: Briefing FYP 2  and Flowchart 

Objective:  To know how to write chapter 4 chapter 5 and to finalize the flow chart.


Analysis/Discussion: For this week, I go the second briefing they teach how to write chapter 4 (Result and discussion )  and chapter 5 ( conclusion and recommendation )


Chapter 4

  • 4.1 introduction 
  • 4.2 Result 
  • 4.3 Discussion 
chapter 5 
  • 5.1 Introduction 
  • 5.2 Conclusion 
  • 5.3 Recommendation
furthermore, i need to finalize the flow chart so that I know the process for my project. so i used the previous semester flowchart in my proposal.
For this project, the flowchart is used to make an easy way to understand the flow of the project. When the power supply is given the system is turned ON and the prototype will move forward after that if any obstacle  the prototype will move left or right at 180 degrees, after that the prototype move forward again and follow the pattern Until the process is finished the program will turn OFF


Conclusion:  As a conclusion, I decided to finalize the  flowchart, so that how the process for my project and how to write the report chapter 4 and chapter 5