Friday, September 27, 2019

Week 9 - Arduino Coding Upload and Blynk Setting (Troubleshooting Week)

Belowis the coding use in arduino for the sorting and monitoring purposes:

#include <Servo.h>

Servo myservo1;  // create servo object to control a servo


#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = "rPCNUbMxbzdkCQ5ERfCUj-83Jj5eGouh";
char ssid[] = "Wifi_Project";
char pass[] = "1a2b3c4d5e";
#define ESP8266_BAUD 115200
ESP8266 wifi(&Serial);

#define trigPin1 2
#define echoPin1 3

#define trigPin2 4
#define echoPin2 5

int ir,metal;

long duration, distance, Sensor1,Sensor2;

void setup() {

   myservo1.attach(9);
      myservo1.write(90);
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
pinMode(A0,INPUT);
 Serial.begin(ESP8266_BAUD);
 //Serial.begin(9600);
 delay(10);
 Blynk.begin(auth, wifi, ssid, pass);

}

void loop() {
 Blynk.run();

ir = digitalRead(A0);
metal=digitalRead(A1);

SonarSensor(trigPin1, echoPin1);
Sensor1 = distance;
Serial.print("Sensor Metal: ");
Serial.println(Sensor1);

SonarSensor(trigPin2, echoPin2);
Sensor2 = distance;
Serial.print("Sensor Non Metal: ");
Serial.println(Sensor2);

Serial.print("IR: ");
Serial.println(ir);

Serial.print("Metal: ");
Serial.println(metal);

Blynk.virtualWrite(0,Sensor1);
Blynk.virtualWrite(1,Sensor2);

if(metal == 0 && ir == 1) //no object
{
    myservo1.write(90);
}

if(metal == 1 && ir == 0) //metal
{
    myservo1.write(50);
}

if(metal == 0 && ir == 0) //non metal
{
    myservo1.write(130);
}

delay(1000);

}

void SonarSensor(int trigPin,int echoPin)
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;

}

The project is success even though the servo motor is a bit loose and needed to be glue.


Lastly is the blynk apps display, the project will not move if not linked to the apps/wifi.


Monday, September 16, 2019

Week 8 - Circuit, wiring installation, software arduino coding upload and syncing with Blynk

On this week, most of critical part is done, first is installing the servo motor to the body as in picture below:


after that the wiring continues until the sensor and arduino is attached with the body until it became as below picture but it is not fully attach as I only use double sided in case of troubleshooting:




Friday, September 6, 2019

Week 7 - Fabricated the project body with external parties

As from the previous week, the project body is sent for fabrication during semester break.It is made at furniture store as the body of this prototype is made from wood. The measurement should be, 40W x 36D x 42H. Below is the drawing of the project body:

By the end of week the project fabricated is done and wiring is also done, below are the picture of the body:

Thursday, August 29, 2019

Week 6 - Actual circuit construction (Metal and Ultrasonic sensor)

As the main circuit is already constructed and waiting to be installed, I continue to construct the other 2 sensor which is the ultrasonic and metal sensor, this metal sensor is different from the original planned, but the shop mention that the function is the same as the previous sensor and it has longer life span.

While doing and studying the circuit function and all, I am searching for any wood shop around PJ area to fabricate my project body. It is to make sure that the price is affordable and as budget. The body dimension should be 40W x 36D x 42H in cm.

NOTE: This is an early stages of circuit construction and not fully measure to the project body or mainframe.

Friday, August 23, 2019

Week 5 - Workshop on Chapter 4, 5 and Abstract in Thesis Writing

This workshop is conducted at TTL2 by Dr. Imran, basically he explain about result and discussion to be put and analyse in the report writing. Below are the slide during the session.

Friday, August 16, 2019

Week 4 - Actual Circuit Construction (Arduino, Servo Motor and Voltage Regulator)

During this week, the actual circuit is constructed and the focus was to connect the LM 7596, Arduino UNO and the servo motor. Below are the picture of servo wire construction on going but not yet install at the project body as it is not begin yet;






Note that the circuit is not running yet due to incomplete circuit construction as it will be done when the project body is fabricated. This is an early stages of circuit construction and not fully measure to the project body or mainframe.

Thursday, August 8, 2019

Week 3 - Circuit construction finalize in Proteus

During this week, the circuit from FYP1 will be used and it is finalize, but it is not functioning even after converting the coding into HEX file, it shows error as the functioning wifi is not in the software so it cannot function unless working wifi is available in PROTEUS. So the project will be constructed without simulation.

Below is the recap on the circuit

At the same time, some of the part is bougt, which is the
  • Arduino UNO
  • Servo Motor
  • Wifi Module
  • Ultrasonic sensor
The metal sensor is not bought yet as the one to be use is out of stock, as this project is not using IR sensor as mention in FYP1. Below are metal sensor thought to be use but out of stock :