Thursday, July 2, 2020

WEEK 17- Check Plagiarism of FYP Report.

OBJECTIVE:

- To check my plagiarism of my FYP report.

CONTENT & PROCEDURE:

- First, I need to submit my FYP report to my supervisor Dr. Mohd Zaki Bin Ayob to see if it needs to be improved.
- Next, Dr. Zaki will check the plagiarism of this report through the fyp portal.
- The result of plagiarism must be below 20%.

RESULT/ ANALYSIS:


- Alhamdulillah, for plagiarism of my report only 16 %.
- Next, i will proceed to send my report to printing company and submit my report at FYP portal UniKL BMI.

CONCLUSION:

Dr. Mohd Zaki Bin Ayob


- As a conclusion, alhamdulillah in this semester I was able to succeed in my FYP project. I would like to special thank to my supervisor Dr. Mohd Zaki bin Ayob for his guidance, advice and his patience from the beginning of this project. I would also like to apologize to Dr. Zaki  if I made a mistake in making this project. I am also very lucky to have a supervisor like Dr. Zaki helped me from the start until I succeeded in this project .I also want to thank Dr Nabila and Mr Ku Halim who helped and gave me permission to test my project and get the results at Pusat Pembiakan Kambing Bebiri Pokok Sena Kedah.



WEEK 16- Video of Result for FYP presentation

OBJECTIVE:

- To show my video of result from my project.

CONTENT & PROCEDURE:

- This video i will put in the result section of my slide.
- Contain of video:
  • The component use for this project.
  • The project test works.
  • Result receive image via email.
  • Type behavior of goat.
  • Result captured image produce from Sound sensor and PIR sensor.
The video can see at this link at Youtube:





WEEK 15- Preparation for slide presentation

OBJECTIVE:

- To make a preparation of slide presentation for FYP presentation.

CONTENT & PROCEDURE:

- For the FYP presentation will be conduct on 2 July 2020.
- For the presentation, all student need to make a video presentation duration 10 minutes.
- Slideshows should contain the following:


-Tips for FYP presentation
  • Try to minimize words in our presentation as possible as we can.
  • Maximize our verbal communication.
  • Not to mention any advantage of our system, instead we can say that is limitation of our project and we will try to accomplish it in our future work.
  • Our whole concentration should be to the audience not the slides.
  • Before any of the audience say ' I have a question' best approve is you should ask 'Any question'.
  • Take up to 5 seconds break at each slide even after you are finished.
  • Try to mention the chief guest in your audience while presenting.
  • Say something good in favor of audience when you have finished the presentation.  

- For my slide presentation, i will record by using Screen O-Matic.
- For result part, i will make a short video of my project functioning and also include video of goat behaviour. 


CONCLUSION:

As a conclusion, first i need to plan the structure of my slide presentation. After that i will show my slide to my supervisor to check if the slide need to improve.  

Tuesday, June 30, 2020

WEEK 14- Flow chart and Blog Diagram of project

OBJECTIVE:

- To review my flowchart and blog diagram of project.

CONTENT & PROCEDURE:

-      First the project starts with running the coding at python. The Sound sensor and PIR sensor detect if something suspicious occur in the barn. If Sound sensor detects loud noise around 95- 112 dB or PIR sensor detects movement within 4 meters, it will send signal to Raspberry pi and Pi camera to capture the image of the situation. Then, the user will get alert message that contain image captured by Pi camera from email.  

Description:

Input

To determine the situation of the animal in danger, we use the Sound Sensor and PIR Sensor.  The sound sensor is one type of module used to notice the sound. Generally, this module is used to detect the intensity of sound. PIR sensor is electronic sensor that measures infrared (IR) light radiating from objects in its field of view. They are most often used in PIR-based motion detectors. Sound sensor function is to detect a loud noise made by a goat when something happens while PIR sensor is to detect motion if there is an intruder. For application both sensor in this project to detect and measure the rate of sound and movement occurring at the barn.

 

Process

This system using Raspberry Pi 3b+ with Pi camera. The Raspberry Pi is a very cheap computer that runs Linux, but it also provides a set of GPIO (general purpose input/output) pins that allow you to control electronic components for physical computing and explore the Internet of Things (IoT). The function of Raspberry Pi in this project to sending image in jpeg file to email user that generate from Pi camera if Sound sensor and PIR sensor produce high signal.

Output

In this project, phone is our output that receive image from email if the sensor detects suspicious situation occur at the barn.  

  

CONCLUSION:
- As a conclusion, this flowchart and blog diagram review about how my project works.



Monday, June 29, 2020

WEEK 13- Second day Test Project at Pusat Pembiakan Bebiri Pokok Sena

OBJECTIVES:

- To adjust the actual sensitivity sensor of my project.
- To make observation of  goat behavior. 

CONTENT & PROCEDURES:

- First, setup the project at walkway in the middle at the barn.

 
Figure 1: View of project setup

- Next, run the coding of project at Python software and see it result.
- If the result does not match the expected result, adjust the sensitivity of both sensors.
- After that, by using Sound meter to measure the level of noise produce from goat in the morning and evening at the barn.
- Then, make a observation of goat behavior when be caught, sick and hungry.  



RESULT @ ANALYSIS:

- For Sound sensor sensitivity we set above 95 dB while the PIR sensor sensitivity within 4 meters.

Figure 2: Goat behavior when be caught


- Next, for my observation of goat behavior when be caught, the goat be aggressive and make loud noise around 95- 102 dB. 

Figure 3: Goat behavior when sick


- For the second behavior when the goat is sick, the goat do not make any sound, look less active and skinny.


Figure 4: Goat behavior in the morning

- In the morning, the goat seem very active and make loud noise around 98- 112 dB. This is because, in this situation they are very hungry at that time.   
- In the evening, the goat behavior is still active but produce less noise compare in the morning. In this time, they can produce noise around 85- 89 dB.


CONCLUSION:
- As a conclusion, my project working well and get good result. Next, i also know the type of goat behavior in the different time and situation. 

Monday, June 22, 2020

WEEK 12- Test project at Pusat Pembiakan Kambing Biri-Biri at Pokok Sena

OBJECTIVE:

-To test and get primary result of project.
-To get readings of sound produced by the goats.

CONTENT/ PROCEDURE:

- First, setup the project at the barn with the right location to get a better image.
- Then setting the sensitivity of sensor.

Figure 1: Progress setup of project

- Next, run the coding at python and see it result.
- Next step, try to measure the reading of sound produce by goat with using Sound meter app on the phone. 

Figure 2: Sound meter apps


RESULT & ANALYSIS:

-First result motion detected.
-In this situation, we tried to make a move in the lane to see the result of the PIR sensor.

Figure 3: The PIR sensor detect motion produced from human.

- Second Result detected by sound.
- In this situation, the worker catches the goat to see the result of the sound sensor if the goat produces a loud noise when in danger.

Figure 4: The sound sensor detected loud noise produced from goat.

- Next, the result reading from sound meter.  

Figure 5: The reading of sound meter when the goat in danger situation is 105 db


Figure 6: The reading of sound meter when the goat in steady situation is 85 db


CONCLUSION:
- As a conclusion, my project work well but i need to adjust the sound sensor to get the right sensitivity because most of the result is detected by PIR sensor. So for the next week, i will test again my project at the barn and also take a reading of sound produce by goat because the farmer inform that the goat had a difference behaviour at difference time. They explain to me, in the morning the goat make a loudly noise because they are hungry. So, i will take the reading from sound meter in the morning to see the result at that time. 

Saturday, June 20, 2020

WEEK 11- Test project at Home

OBJECTIVE:

- To test and see the result of project.

CONTENT/ PROCEDURE:

- First setup the project connection and setting it position to get a good view.

Figure 1: View setup position of project

- After that, run the coding and see it result. 


RESULT & ANALYSIS:

Result 1

Figure 2: Images generated from sound sensors

 

Result 2

Figure 3: Image generated from motion sensor




CONCLUSION:

As a conclusion, my project is functioning well and it get good result similar like expected result. For the next week, i will test my project at the Pusat Peternakan Kambing Biri-Biri Pokok Sena to adjust the sound produce from goat for sound sensor. 

Thursday, May 28, 2020

WEEK 10- Upgrade project by adding PIR sensor

Date: 16 April 2020

OBJECTIVES:

- To upgrade and add value of this project. 

CONTENT/ PROCEDURE:

-  First, I need to replacing the raspberry Pi fan with PIR sensor because want to use the it voltage supply 5 volts pin.



Figure 1: The process of replacing Raspberry Pi fan with PIR Sensor


- After done connecting pin PIR sensor with GPIO Raspberry Pi, then adjust it sensitivity and time delay.

Figure 2: The configuration of PIR sensor.

- Next, I need to improve my project encoding by using python for PIR sensors to work. 



Figure 3: Add the input pin for PIR sensor in coding



Figure 4: Add coding for input PIR sensor at While loop.



RESULT & ANALYSIS:

- Run the coding at python to see it result of PIR Sensor.



Figure 6: The result of PIR Sensor when the coding is running.




Figure 7: The result of connection PIR Sensor with Raspberry PI



CONCLUSION:

- As a conclusion, PIR sensor successfully function in this project. For the next step, i will test this project at my home to see it result before testing at the barn. 
 



Monday, May 11, 2020

WEEK 9- Build a project model

Date: 9 April 2020

OBJECTIVES:

- To make a model of project according to the proposed description.

CONTENT/ PROCEDURE:

First, build casing of raspberry Pi:


Second, build casing for Pi camera:


After that, combine all part of component to be one model of project.


RESULT & ANALYSIS:

This is result of my project model:







CONCLUSION:

As a conclusion, i have complete build my project model. After this, i want upgrade my project with adding PIR sensor to detect motion if intruder detected. 

Monday, April 6, 2020

WEEK 8- Design casing for project

Date: 1 April 2020

OBJECTIVES:

-To make a design casing for my project.  

CONTENT/ PROCEDURE:


For the design, my plan is combine casing of Pi camera, Raspberry pi and flexible tripod to be one model. To overview my project model, i use Auto cad to draw my model in 3D. Purpose i use flexible tripod for my model is to put it in a high place in the barn. 

 Daisen tech Octopus Style Portable and adjustable Tripod Stand ...

Parts to be purchased for design models:

Casing Raspberry Pi (RM 19.20)
Casing Pi camera (RM 10.85)


Flexible tripod (RM 21.03)


RESULT & ANALYSIS:

Overview design 3D model for project by using Autocad:

CONCLUSION:

As a conclusion, i had order online all the item. After the item received, i will combine it to be one model then go to test this project at the barn to see and get it result.

Sunday, April 5, 2020

WEEK 7- Test coding project with component

Date: 25 March 2020

OBJECTIVE:

- To test the coding with component and see it result.

CONTENT/ PROCEDURE:

Adjust Default Settings in Your Gmail

By default, Google does not allow you to send emails containing Python code. To update this default setting, turn on “Allow less secure apps” in your account settings with the following steps:

  1. Login to your Gmail account by entering your login credentials.
  2. Click on your profile picture and then click on “Google account”.
  3. Under “Sign-in and Security” click “Connected apps and sites”.
  4. Click “Allow less secure apps” to turn it on.


Connect the Sound Sensor to the Raspberry Pi


Connect the VCC and GND pins of the motion sensor to the 5V and GND of the Raspberry Pi, then connect the OUT pin of the sound sensor to GPIO17. Make sure that you connected the camera to the Raspberry Pi and have turned on on the camera from the interfacing options.



Before running the code, make sure the sender and receiver email addresses and the password of the email sender are all entered.
The code will read the output from the sensor and, upon detecting sound, will capture an image and save it on the database folder.
When you run the code for the first time, it will automatically create the folder. Once the camera captures an image, the image will be attached in the email and sent to the sender’s address.

RESULT & ANALYSIS:

After run the code, we can see that "No intruders" has been display at python because it did not receive any signal from sound sensor.


Next, if we make a sound, it will give an interrupt signal to sound sensor and we can see it display "Intruders Detected" then make a process sending Email that contain image generate from Pi camera to our email. 



The image result that sending from Raspberry Pi to email:



CONCLUSION:

As a conclusion, the coding and component is function successfully. Next, i will design the case for my project before going to test at the barn.


WEEK 6- Code Explanation

Date: 18 March 2020

OBJECTIVE:

- To give explanation about my project code.

CONTENT/ PROCEDURE:

First, we add the packages and modules required for this project. The GPIO package helps up to control the GPIO pins of our Raspberry Pi. The Picamera package is used for the Raspberry Pi camera, while the Smtplib package allows us to set up the Gmail server.


        import os
import glob
import picamera
import RPi.GPIO as GPIO
import smtplib
from time import sleep

We need the four modules below to send emails from a Raspberry Pi:

        from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
We need to add the receiver's email and sender's email address and password, as shown below:

sender = 'example@gmail.com' password = 'abcd1234' receiver = 'example@gmail.com'


We can then set the directory path and the file prefix for where the images will be saved:

DIR = './Database/' FILE_PREFIX = 'image'


Then, because we are going to receive the output of the sensor, we declare pin 11 as input. Any GPIO warnings should be ignored.


        GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN)  # Read output from PIR motion sensor
In the send_mail() function, the system will check whether the database directory has already been created or not. If it is not created, one will be created. It will then look for the ID of the images and save the new image with a new ID. Then the most recent image will be attached to the email and sent to the receiver’s address.


        def send_mail():
    print 'Sending E-Mail'
    # Create the directory if not exists
    if not os.path.exists(DIR):
        os.makedirs(DIR)
    # Find the largest ID of existing images.
    # Start new images after this ID value.
    files = sorted(glob.glob(os.path.join(DIR, FILE_PREFIX + '[0-9][0-9][0-9].jpg')))
    count = 0
    
    if len(files) > 0:
        # Grab the count from the last filename.
        count = int(files[-1][-7:-4])+1

    # Save image to file
    filename = os.path.join(DIR, FILE_PREFIX + '%03d.jpg' % count)
    # Capture the face
    with picamera.PiCamera() as camera:
        pic = camera.capture(filename)
    # Sending mail
    msg = MIMEMultipart()
    msg['From'] = sender
    msg['To'] = receiver
    msg['Subject'] = 'Movement Detected'
    
    body = 'Picture is Attached.'
    msg.attach(MIMEText(body, 'plain'))
    attachment = open(filename, 'rb')
    part = MIMEBase('application', 'octet-stream')
    part.set_payload((attachment).read())
    encoders.encode_base64(part)
    part.add_header('Content-Disposition', 'attachment; filename= %s' % filename)
    msg.attach(part)
    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.starttls()
    server.login(sender, password)
    text = msg.as_string()
    server.sendmail(sender, receiver, text)
    server.quit()

In the while loop, it will read the input from pin 11 and, if the input is equal to 1, the send_mail() function will be called to send an email.
while True:
    i = GPIO.input(11)
    if i == 0:  # When output from motion sensor is LOW
        print "No intruders", i
        sleep(0.3)
    elif i == 1:  # When output from motion sensor is HIGH
        print "Intruder detected", i
        send_mail()
CONCLUSION:

As a conclusion from the explanation, i know about my project code function. Next, i need to create email for my project to send email that contain image to my email.

Friday, April 3, 2020

WEEK 5- Test Pi Camera and Sound Sensor

Date: 11 March 2020

OBJECTIVE:

- To test functionality of Pi Camera and Sound Sensor

CONTENT/PROCEDURE:

Test Pi camera:

First we need to connect Pi camera with Raspberry Pi at the port

Raspberry Pi Camera: A high-speed camera at a bargain price ...


Then write the command at terminal ('raspistill -o Dekstop/image.jpg'). The image will save at desktop with format JPG.



Test Sound Sensor:

First connect sound sensor to GPIO Raspberry Pi.

Sound Sensor (Raspberry Pi) : 4 Steps - Instructables

Then, use Python to compile the coding of Sound sensor.


GPIO we use Pin 11 as our output.


RESULT & ANALYSIS:

Result for Pi Camera we can see the image output will be display at desktop:



Result for Sound Sensor:


we can see if the signal high it will print "Detected"


CONCLUSION:

As a conclusion, the test for Pi camera and Sound sensor is in good condition. Next, i will make connection and test for my coding project to send image through email when it get interrupt signal from Sound sensor.