![]() |
| Dr. Mohd Zaki Bin Ayob |
Thursday, July 2, 2020
WEEK 17- Check Plagiarism of FYP Report.
WEEK 16- Video of Result for FYP presentation
- 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.
WEEK 15- Preparation for slide 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.
Tuesday, June 30, 2020
WEEK 14- Flow chart and Blog Diagram of project
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.
Monday, June 29, 2020
WEEK 13- Second day Test Project at Pusat Pembiakan Bebiri Pokok Sena
|
| Figure 1: View of project setup |
![]() |
| Figure 2: Goat behavior when be caught |
![]() |
| Figure 3: Goat behavior when sick |
![]() |
| Figure 4: Goat behavior in the morning |
Monday, June 22, 2020
WEEK 12- Test project at Pusat Pembiakan Kambing Biri-Biri at Pokok Sena
![]() |
| Figure 1: Progress setup of project |
![]() |
| Figure 2: Sound meter apps |
![]() |
| Figure 3: The PIR sensor detect motion produced from human. |
- Second Result detected by sound.
![]() |
| 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 |
Saturday, June 20, 2020
WEEK 11- Test project at Home
![]() |
| Figure 1: View setup position of project |
Thursday, May 28, 2020
WEEK 10- Upgrade project by adding PIR sensor
![]() |
| Figure 1: The process of replacing Raspberry Pi fan with PIR Sensor |
![]() |
| Figure 2: The configuration of PIR sensor. |
![]() |
Figure 3: Add the input pin for PIR sensor in coding |
![]() |
Figure 4: Add coding for input PIR sensor at While loop. |
![]() |
| Figure 6: The result of PIR Sensor when the coding is running. |
![]() |
| Figure 7: The result of connection PIR Sensor with Raspberry PI |
Monday, May 11, 2020
WEEK 9- Build a project model
Monday, April 6, 2020
WEEK 8- Design casing for project
OBJECTIVES:
-To make a design casing for my project.
CONTENT/ PROCEDURE:
RESULT & ANALYSIS:
Overview design 3D model for project by using Autocad:
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
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:
- Login to your Gmail account by entering your login credentials.
- Click on your profile picture and then click on “Google account”.
- Under “Sign-in and Security” click “Connected apps and sites”.
- Click “Allow less secure apps” to turn it on.
Connect the Sound Sensor to the Raspberry Pi
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.
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
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
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
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
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.











































