Copy This-Iot Based Monitoring System With Feeder Controller
Copy This-Iot Based Monitoring System With Feeder Controller
NAME REGISTRATION NO
ZAIREE IZZUL HAIKAL BIN 08DEP20F2021
ZAIFUL AMRIL
SESI 2 2021/2022
POLITEKNIK
NAME REGISTRATION NO
ZAIREE IZZUL HAIKAL BIN ZAIFUL 08DEP20F2021
AMRIL
SESI 2 2022/2023
CONFIRMATION OF THE PROJECT
The project report titled "IOT BASED MONITORING SYSTEM WITH FEEDER
Checked by:
Supervisor’s name : ENCIK ABU BAKAR HAFIZ BIN KAHAR
Supervisor’s signature :
Date :
Verified by:
Project Coordinator name :
Signature of Coordinator :
Date :
i
“I acknowledge this work is my own work except the excerpts I have already
explained to our source”
1. Signature :
ii
DECLARATION OF ORIGINALITY AND OWNERSHIP
TITLE : DESIGN FINGERS EXERGAME TO IMPROVE FINE
MOTOR SKILL FOR AUTISTIC CHILDREN USING
ARDUINO
SESSION: SESI 1 2022/2023
2. I acknowledge that 'The Project above' and the intellectual property therein is the
result of our original creation /creations without taking or impersonating any
intellectual property from the other parties.
iii
ACKNOWLEDGEMENTS
I have taken efforts in this Project. However, it would not have been possible
without the kind support and help of many individuals and organizations. I would like
Organization Guide) for their guidance and constant supervision as well as for
providing necessary information regarding the Project & also for their support in
(Organization Name) for their kind co-operation and encouragement which help me in
completion of this Project. I would like to express my special gratitude and thanks to
iv
ABSTRACT
Pet is good accompany partner to human. It helps to reduce the stress from
living life style and as a precaution to keep away burglars. Nowadays, pet treats as one
part of the family member. Therefore, healthy level of the pet need to consider and
focus on balance diet. Different size of the pet will have different amount on
consuming and different nutrient needed. From the survey, the obesity problem among
LI the pet is happened due to pet owner is busy with work. In additional to that, pet
doesn’t have ability to get the food itself, and it has to depend on the pet owner to feed
them. Therefore, Controlled Pet Feeder is created and used to solve the problems
feeding the pet on time with required portion. Controlled pet feeder is started popular
among the choices of pet owner used to replace the traditional feeding method. The
product brings convenience to pet owner by setting the feeding time and portion of the
food, which it helps to make sure the pet receives the required diet through a day. The
controlled pet feeder trains the pet how to consume food properly and consume at
certain time.
v
ABSTRAK
Haiwan peliharaan adalah teman yang baik untuk menemani manusia. Ia
membantu mengurangkan tekanan daripada menjalani gaya hidup dan sebagai langkah
berjaga-jaga untuk menjauhkan pencuri. Pada masa kini, perlakuan haiwan peliharaan
sebagai sebahagian daripada ahli keluarga. Oleh itu, tahap kesihatan haiwan peliharaan
perlu mengambil kira dan memberi tumpuan kepada diet seimbang. Saiz haiwan
peliharaan yang berbeza akan mempunyai jumlah yang berbeza pada pengambilan dan
nutrien yang berbeza diperlukan. Daripada tinjauan, masalah obesiti dalam kalangan
LI haiwan peliharaan berlaku disebabkan pemilik haiwan peliharaan sibuk dengan
kerja. Selain itu, haiwan peliharaan tidak mempunyai keupayaan untuk mendapatkan
makanan itu sendiri, dan ia perlu bergantung kepada pemilik haiwan untuk
memberinya makan. Oleh itu, Feeder Binatang Terkawal dicipta dan digunakan untuk
menyelesaikan masalah memberi makan haiwan peliharaan tepat pada masanya
dengan bahagian yang diperlukan. Pengumpan haiwan peliharaan terkawal mula
popular di kalangan pilihan pemilik haiwan peliharaan yang digunakan untuk
menggantikan kaedah pemakanan tradisional. Produk ini memberikan kemudahan
kepada pemilik haiwan peliharaan dengan menetapkan masa penyusuan dan bahagian
makanan, yang membantu memastikan haiwan peliharaan menerima diet yang
diperlukan sepanjang hari. Pengumpan haiwan peliharaan terkawal melatih haiwan
peliharaan cara mengambil makanan dengan betul dan mengambil pada masa tertentu.
TABLE OF CONTENTS
CONFIRMATION OF THE PROJECT i
DECLARATION OF ORIGINALITY AND OWNERSHIP iii
ACKNOWLEDGEMENTS iv
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS vii
CHAPTER 1 1
1 INTRODUCTION 1
1.1 Introduction 1
1.2 Background Research 1
1.3 Problem Statement 2
1.4 Research Objectives 2
1.5 Scope of Research 3
1.6 Project Significance 3
1.7 Chapter Summary 3
CHAPTER 2 4
2 LITERATURE REVIEW 4
2.1 Introduction 4
2.2 LITERATURE REVIEW 1 4
2.3 LITERATURE REVIEW 2 5
2.4 LITERATURE REVIEW 3 6
2.5 LITERATURE REVIEW 4 7
2.6 Chapter Summary 9
CHAPTER 3 10
3 RESEARCH METHODOLOGY 10
3.1 Introduction 10
3.2 Project Design and Overview. 10
3.2.1 Block Diagram of the Project 11
3.2.2 Flowchart of the Project 2 12
3.3 Project Hardware 13
3.3.1 Schematic Circuit 14
3.3.2 Description of Main Component 15
3.3.2.1 Arduino 15
3.3.2.2 Servo MG995 15
3.3.3 Ultrasonic Sensor 15
3.4 Project Software 16
3.4.1 Flowchart of the System 18
3.4.2 Description of Flowchart 19
3.5 Sustainability Element in The Design Concept 19
CHAPTER 4 21
4 RESULTS AND DISCUSSION 21
4.1 Introduction 21
vii
4.2 Gantt Chart and Activities of the Project during Project 1 22
4.3 Gantt Chart and Activities of the Project during Project 2 23
4.4 Cost and Budgeting 24
CHAPTER 5 25
5 CONCLUSION AND RECOMMENDATIONS 25
5.1 Introduction 25
5.2 Conclusion 25
5.3 Suggestion for Future Work 26
5.4 Project Hardware 28
REFERENCES 29
6 APPENDICES 30
APPENDIX A – DATA SHEET 30
APPENDIX B – PROGRAMMING 31
viii
CHAPTER 1
1 INTRODUCTION
1.1 Introduction
This project was created to allow users to control their pets remotely. User will
be able to monitor and control their pets even when they are not at home thanks to
this project. Users, for example, can give food to their pets just by using a mobile
phone application. This project also includes a GPS system for tracking the
whereabouts of their pets.
Pet feeders are automated devices designed to dispense food to pets at scheduled times.
They can be particularly useful for pet owners who have busy schedules or need to be
away from home for extended periods. To conduct background research for a pet
feeder, you can explore the following aspects:
1. Programmable feeders: These feeders allow pet owners to set specific feeding
schedules and portion sizes. They often feature digital timers and portion
control mechanisms.
2. Smart feeders: These advanced feeders connect to the internet and can be
controlled remotely through a smartphone app. They often offer additional
features like portion control, feeding history tracking, and notifications.
1. Different pets have varying dietary requirements and feeding schedules. It's
important to consider the specific needs of the pet you're designing the feeder
for. Consult veterinarians or pet nutritionists to understand appropriate feeding
times and portion sizes for different animals.
2. Some feeders allow you to program multiple feeding times per day, ensuring
that the pet receives smaller, regular meals instead of a large portion at once.
1
This can be beneficial for pets with specific dietary needs or those prone to
overeating.
1. Pet feeders come with different food storage capacities, ranging from small
hoppers to large containers. Consider the size and type of pet you are targeting
to determine an appropriate storage capacity.
2. Ensure that the feeder's food storage container is airtight and keeps the food
fresh for an extended period. This helps to prevent spoilage and maintain the
nutritional quality of the food.
• The problem that users often face is that they find it difficult to feed their pets. For
example, when they return to their village or go on vacation, they cannot feed their
animals. In addition, they also find it difficult to track their pet's location if their pet
is released from the cage.
• As we see nowadays, we only have a pet feeder that using timing. It only follow the
timer that been set by the owner. If the food bowl still has the food in it, the system
can’t detect it and just keep filling the bowl. So, it will be a waste. Different from
the timer system, my project will use a connection between owner phone and the
pet feeder. Owner just need to use a mobile phone to give their pets food.
• This project will be very helpful to people who have a pets and don’t always be at
home. For example, workers who works 12 hour or and more.
The goal of this project is to teach students how to solve problems utilizing
academic research while also gaining knowledge and skills. This assignment is also
significant for training and increasing the student's capacity to obtain information, do
research, collect data, and finally solve the problem using the processes learned. Aside
from that, the project will produce students who are capable of producing a competent
2
research report in thesis form or technical writing. Furthermore, this programme trains
and produces students who are capable of conducting work with minimum supervision
and are more independent.
More specifically the principle objective of this research are:
1. Design and fabricate the pet feeder with IOT.
2. Apply the right source code for the device to connect with the this
project.
3. To develop project that will help people.
1. This Project is focusing on workers and family to feed their pet easily.
2. The emphasis is for people to control the pet feeder from anywhere.
3. The main controller is using ARDUINO UNO.
This innovation project was developed to help people stay busy and focus on
daily tasks outside and at the same time can care about their pet. The aim of this project
is the development of new and improved innovation of pet cared. The IoT based
monitoring system with pet feeder, as its name suggests, is an innovative solution that
combines IoT (Internet of Things) technology with a monitoring and pet feeder. It aims
to automate and enhance the care of the pets, offering several significant advantages
and benefits.
In summary, IOT based monitoring system with pet feeder will offers a lot of
benefits to the user, including time savings, convenience, space optimization, cost
savings, and enhanced pet care. Its integration of IoT technology into this project can
improve and modernize everyday tasks, ultimately enhancing people's lives while
promoting sustainability.
3
CHAPTER 2
2 LITERATURE REVIEW
2.1 Introduction
This chapter extend the literature reviews that cater the information in
accordance with the objectives of this project. The relevant information and other
extra features were gathered as shown below.
The idea of automatic pet feeder is concerned with a device that feeds food to
pets at certain intervals. The timings are actually programmed into the micro-
controller. Mann (2015) presents a mechanism for feeding pets even when the owners
are absent. For feeding the pets, food has to be loaded first and timings must be set.
The remaining work is done by the microelectronic.
In the system, there are three devices that have been used: Two 4. Buzzer of Timing
Valves, 2 DC Motors, and ATmega8 Microcontroller. The ATmega8 delivers SRAM’s
1K byte, EEPROM’s 512 bytes, and In-System Programmable Flash’s 8K bytes with
capabilities of Read-While-Write. The register contents are saved by the power
downmode but the oscillator is frozen by it which disables every other function of chip
until the next Hardware Reset or Interrupt.
In the standby mode, the resonator or crystal oscillator is functioning which other parts
of the device are not functioning. It enables low consumption of power with a quick
start-up. In the setup, a dc motor of 5v is being used. The function of this motor is
change the direction of flow of current in the motor part. Most of the types of dc motors
produce rotatory motions which motion and force are linearly produced by a linear
motor.
4
The beeper of buzzer is used in the system which is a device used for audio signaling
and it might be piezoelectric, electrochemical, or mechanical. It is explained in the
results that every block has been experimented and integrated later on for making the
desired device. The microcontroller was programmed successfully using the avr
notepad and embedded program c for feeding pets (M, 2015).
(Automatic Pet Monitoring and Feeding System using IoT of Automated Pet
Feeding)
It is quite obvious that pets require special care and treatment. However,
because of the busy routine, it becomes very difficult to care for pets. S.Subaashri, et
al. (2017) present a smart system for pets. The objective of the study is an automatic
feeding and monitoring system for pets using IoT or Internet of Things. The proposed
system is a complete device for the monitoring of every pet activity while making the
pet feel carefree. There are various subdivisions of the project with a unique IR feature.
They include system for pet collar, food feeder for pets, and monitoring of pet door.
The pet feeder is capable of keeping the water and food clean until the pet
wishes to eat. It has a cover for bowl that closes and opens automatically. The presence
of pet is detected by the sensor and the cover is opened which enables only the pet to
access the food. Moreover, the collar has a GPS tag which is used for identifying and
transmitting the steps of a pet. It has been explained that the present technology is not
suitable for providing the best security and indulging delays.
In the hardware kit, Wi-Fi module, Sensors, and Arduino Uno are included.
+5V is supplied to Arduino from the adapter. In the system, Arduino is actually acting
as the gateway and microcontroller. Depending on the IoT concept, details are sent by
Arduino to cloud through the module of Wi-Fi. This data is send to the Phone and
NodeMCU automates it. It is explained that IoT is basically a platform that can be used
for embedding both hardware and software. Furthermore, it is suggested that
mechanism on the basis of SOAF with services of web is the best option for the
management of appliances and diversified devices (S.Subaashri, et al., 2017).
Jigarmasekar, et al. (2018) explains that humans are exposed to such vast scope
of technologies that they couldn’t have even imagined it in the past. IoT or Internet of
Things is an important and rapidly advancing technology. Furthermore, its vision has
only evolved because of the convergence of various methods and technologies such as
Embedded Systems, Commodity Sensors, Machine Learning, Real-Time Analytics,
and Ubiquitous Communication without Wires.
In other words, it can be said that IoT is a mix of several electronic devices. In
the term, the things are actually connected together and they can be realized as the
6
operations of management, tracing, localization, recognition, and so on. It is not false
in the case of management of pets through IoT.
Even though owners of pets are not present, they still can feel the presence of
their pets. Using IoT, it has become easier to depend on Smart Machines which are
capable of adapting while utilizing external stimuli such as animal behavior,
temperature, and so on.
Providing food on a timely basis is the basic responsibility for every pet power.
There are countless cases when the owner is unable to accomplish this task. Under
such conditions, the smart machine presented by authors can understand the difficulty
of situation and remind the owner about it.
There is a functionality of pet monitoring in the device which will notify the
owner about the location of the pet as there are many times when the owner is busy
with something else and cannot keep a watch on the pet. Relying on this aspect, even
notorious pets can be found. There is yet another feature in the device which is referred
as automated calling and it can be beneficial in the cases when there is a threat and the
owner wants to be notified about it.
It can be used when the owner wishes to have visuals of the pet. Authors have
concluded that at present, it has become important for pet owners to take the advantage
of development of technologies. Using such technologies, pet owners can leave the
care of their pets to the automated devices (Jigarmasekar, et al., 2018).
The components of the automatic feeder include LCD display, Wi-Fi module,
T-section of PVC pipe, Acrylic sheets, Arduino UNO, RTC or Real Time Clock, Ky-
40 Rotatory Decoder Encoder, and Continuous Servomotor with MG995. Servo motor
for continuous rotation is being used with digital modulation.
Arduino UNO sends signals to the motor. It can be said that the shape of
AUGER is similar to that of a device used for drilling. Meanwhile, Arduino UNO is
actually a board of microcontroller formed on the basis of ATmega328. It contains
almost everything that is needed for controlling microcontroller. It means that a simple
connection with the computer is required using the cable of USB for feeding the
program and getting started. Arduino IDE is used for programming Arduino UNO. It
is carried out in such a way that date and time for the system can be set which is
highlighted on the screen of LED.
8
2.6 Chapter Summary
This chapter presents the literature review that was used as a source of knowledge
for this project. Literature reviews are useful for methodology studies because they
look at the strengths and flaws of previous research in the same topic. Other than that,
literature reviews aid in the development of a theoretical framework consisting of
research concepts and ideas whose success can be evaluated, as well as providing
information for research relevance and consistency
9
CHAPTER 3
3 RESEARCH METHODOLOGY
3.1 Introduction
The methodology and particular procedures employed in the project research are
described in this section. Both qualitative and experimental methodologies are used in
the methodology. In order to gain a better knowledge of the project, this part also
describes the project's design and the methods that were taken to present an informative
view. This research study is carried out in accordance with methodology and following
analysis of an appropriate method for a successful advancement.
The aim of this project is to design and develop a pet feeder system using the
Blynk IoT platform. The pet feeder system will leverage IoT capabilities to provide
users with enhanced control, convenience, and energy efficiency in their care of their
pets. This overview outlines the key components and features of the project. An
Arduino or ESP8266 board will serve as the main microcontroller, responsible for
gathering sensor data and controlling the system. Sensors such as ultrasonic sensor will
be utilized to detect food level and send notification when the food is low. Motorized
mechanisms or servo motors will be employed to automate the feeder controller.
The Blynk mobile app will be used to provide users with a user-friendly interface
for monitoring and controlling the system. Users can interact with various widgets to
initiate or adjust the timer, receive notifications, and access system settings.
Meanwhile, the Blynk cloud server will handle the communication between the mobile
app and the system, ensuring seamless data exchange and remote control capabilities.
10
3.2.1 Block Diagram of the Project
PET FEEDER
CAMERA
MOBILE PHONE
11
3.2.2 Flowchart of the Project 2
START
MOBILE PHONE
WIFI MODULE
GPS
PET FEEDER CAMERA
ARDUINO
MOTOR
END
12
3.3 Project Hardware
When designing the hardware for a pet feeder, there are several components and
considerations to take into account. Here's a list of key hardware components
commonly used in pet feeders:
1. Food storage container: Choose a container that can hold an appropriate
amount of pet food and keep it fresh. Consider materials that are safe for storing
food, such as BPA-free plastics or stainless steel.
2. Dispensing mechanism: The dispensing mechanism controls the release of food
from the storage container into the feeding bowl. There are various types of
mechanisms to consider, such as gravity-based mechanisms, auger systems,
rotating discs, or conveyor belts.
3. Control system: The control system allows you to program and schedule
feeding times, portion sizes, and other settings. It typically includes a
microcontroller or a single-board computer like Arduino or Raspberry Pi,
which can handle the scheduling logic and communicate with other
components.
4. Sensors: Sensors are used to detect various conditions and trigger actions.
Some common sensors for pet feeders include:
• Food level sensor: This sensor measures the amount of food remaining
in the storage container and can be used to send notifications when the
food is running low.
• Infrared or ultrasonic sensor: These sensors can be used to detect the
presence of the pet near the feeder or to prevent food overflow by
detecting if the food bowl is already filled.
5. User interface: An interface is necessary to set up feeding schedules and adjust
settings. This can be implemented through buttons, a keypad, an LCD display,
or even a touchscreen, depending on the complexity and user-friendliness
desired.
6. Motor or actuator: Depending on the type of dispensing mechanism chosen,
you may need a motor or actuator to control the movement of the food from
the storage container to the feeding bowl.
We need to consider the size, weight, and behavior of the pets you are targeting
when choosing and designing these hardware components. Additionally, always
prioritize the safety of both the pet and the functionality of the feeder throughout
the design process.
13
3.3.1 Schematic Circuit
14
3.3.2 Description of Main Component
3.3.2.1 Arduino
- MG995 servo is a simple, commonly used standard servo for your mechanical needs
such as robotic head, robotic arm. It comes with a stardard 3-pin power and control
cable for easy using and metal gears for high torque. A Me RJ25 Adapter also help
you to connect the servo with Me Baseboard or Makeblock Orion easily.
15
3.4 Project Software
Proteus 8
The Proteus Design Suite is a proprietary software tool suite used primarily for
electronic design automation. The software is used mainly by electronic design
engineers and technicians to create schematics and electronic prints for manufacturing
printed circuit boards.
Schematic Capture
Schematic capture in the Proteus Design Suite is used for both the simulation
of designs and as the design phase of a PCB layout project. It is therefore a core
component and is included with all product configurations.
Microcontroller Simulation
PCB Design
The schematic capture module automatically transfers connectivity data in the form
of a netlist to the PCB Layout module. This knowledge is put to use, together with user-
specified design guidelines and several design automation tools, to help in error-free board
design. The size of the design is constrained by the product configuration, and PCBs with up
to 16 copper layers can be created
Arduino IDE
a) Text Editor
Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file extension .ino. The
editor has features for cutting/pasting and for searching/replacing text. The message
area gives feedback while saving and exporting and also displays errors. The
consoledisplays text output by the Arduino Software (IDE), including complete error
messages and other information. The bottom righthand corner of the window displays
the configured board and serial port. The toolbar buttons allow you to verifyand upload
programs, create, open, and save sketches, and open the serial monitor.
b) Compiler
17
3.4.1 Flowchart of the System
START
MOBILE PHONE
WIFI MODULE
ARDUINO
MOTOR
END
18
3.4.2 Description of Flowchart
Firstly, the flowchart begins with the start symbol, indicating the beginning
of the process. The system initializes, preparing the components and sensors for
operation. The flowchart would include a decision symbol to check if any sensors such
as ultrasonic sensor, are triggered. If no sensors are triggered, the process continues to
the next step. If the sensor triggered, it will send a notification that tell about the level
of the food on the food storage.
The motor that controls the feeder movement is activated to start the feeder
rotation. A timer is used to determine the duration for feeder to open and close.. The
motor controlling the feeder rotation is deactivated, bringing it to a stop. If the laundry
is dry, the process moves to the next step. I The flowchart ends with the stop symbol,
indicating the end of the process.
To incorporate sustainability elements into the design concept of a pet feeder, consider
the following ideas:
19
5. User education and awareness: Include user guides or information materials
that educate pet owners about sustainable pet feeding practices, such as
responsible portion control, selecting sustainable pet food options, and
reducing food waste.
By incorporating these sustainability elements into the design concept of a pet feeder,
we can create a product that not only meets the needs of pet owners but also contributes
to a more environmentally friendly and responsible pet care approach.
20
CHAPTER 4
4.1 Introduction
This project's financial resources are self-funded, with several main and basic
components. All of the components were purchased through online and electronic
shops. Based on the cost projection, it is estimated at RM300.00, with an additional
RM200.00 for the component and other materials. The other listing was RM500.00,
but these prices are variable and volatile. According to the findings of the investigation,
it is feasible and achievable.
21
4.2 Gantt Chart and Activities of the Project during Project 1
22
4.3 Gantt Chart and Activities of the Project during Project 2
23
4.4 Cost and Budgeting
This project involves the cost of purchasing components and materials throughout its
implementation. components involving cost are hardware Arduino, Servo MG995,
Ultrasonic Sensor, ESP8266 Wifi Module, UPS Power Supply, 12V Lead Acid
Battery, GPS Module, SIM800L, 2G SIM card, OLED Display, Small 3V battery,
Wires and camera. All of these components are purchased through online purchase
methods to make it easier as well as save on costs.
7 GPS Module RM 22 1 RM 22
11 Small 3V battery RM 10 2 RM 20
12 Camera RM 25 1 RM 25
Total : RM 303.50
1 Transportation RM 50 - RM 50
2 Postage RM 50 - RM 50
Total : RM 100
24
CHAPTER 5
5.1 Introduction
This chapter presents the results obtained from the data analysis which has been
made through several questionnaire where testimony is given to both users and
Industrial. Apart from that, the whole process of collecting and analyzing data is
discussed properly in order to fully understand the problem occurred and how it is
solved for a successful project and lastly this chapter will conclude all parts of the
project.
5.2 Conclusion
A modular and repairable design promotes longevity and allows for easy
maintenance, reducing unnecessary waste. Mindful packaging choices and clear
instructions on proper disposal or recycling contribute to sustainable practices
throughout the product's lifecycle. Additionally, user education and awareness can
help promote responsible feeding practices and further reduce environmental impact.
25
By embracing these design principles, a pet feeder controller can not only
provide convenience and peace of mind for pet owners but also contribute to a more
sustainable and eco-conscious approach to pet care.
Here are some suggestions for future work and potential improvements in the field of
pet feeders:
These future work suggestions aim to enhance the functionality, usability, and
overall experience of pet feeders while promoting the well-being and health of pets.
By continuing to innovate in these areas, pet feeders can become even more
advanced and tailored to the unique needs of both pets and their owners.
27
5.4 Project Hardware
28
REFERENCES
29
6 APPENDICES
30
APPENDIX B – PROGRAMMING
#include <Servo.h>
// Template ID, Device Name and Auth Token are provided by the
Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID "TMPL6j0JiWd80"
#define BLYNK_TEMPLATE_NAME "Quickstart Template"
#define BLYNK_AUTH_TOKEN "DzCS2qDaeQgrHzqFjet4z-uctNUs6fuw"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
Servo myservo;
int pos = 0;
int mode=0;
int SECURITY=0;
float LDR1=0;
float LDR2=0;
float LIGHTAVG=0;
float VOLTAGE=0;
float ADC1,ADC2,ADC3,ADC4;
float temperature = 25;
float h=0,t=0;
float hx=0,tx=0;
// variable for storing the potentiometer value
int potValue = 0;
int PIRSTAT=0;
int BIT=0;
int ALM1=0,ALM2=0,ALM3=0,ALM4=0;
int Ready=0;
int Ml=0;
String MinS="00";
String HourS="00";
String SecS="00";
int DataIn=0;
String DATA="";
String Temp1x="";
String PHx="";
String Temp2x="";
String Temp1y="";
String PHy="";
String Temp2y="";
String Temp3y="";
String Temp3x="";
String Temp4y="";
String Temp4x="";
String currentTime;
String currentDate;
String TimerGet="00:00:00";
int MODE=0;
int Hour=0;
int Min=0;
int Sec=0;
float CO2;
float FLAME=0;
float LEVEL=0;
int ALM=0;
int Val=100;
32
int Index=0;
float CV=0;
int CKN=0;
float LDRAVG=0;
//-----------------------------------------------------------------
int TDIS=0;
int Rly1=0;
int wait=0;
int Rly2=0;
int Rly3=0;
int Rly4=0;
int Rly5=0;
//-----------------------------------------------------------
BlynkTimer timer;
// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V10)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1
to a variable
Rly1=pinValue;
if (pinValue==1){
}
if (pinValue==0){
BLYNK_WRITE(V11)
{
int pin2Value = param.asInt(); // assigning incoming value from pin
V1 to a variable
Rly2=pin2Value;
33
// process received value
}
BLYNK_WRITE(V12)
{
int pin3Value = param.asInt(); // assigning incoming value from pin
V1 to a variable
Rly3=pin3Value;
BLYNK_WRITE(V13)
{
int pin4Value = param.asInt(); // assigning incoming value from pin
V1 to a variable
Rly4=pin4Value;
BLYNK_WRITE(V14)
{
int pin5Value = param.asInt(); // assigning incoming value from pin
V1 to a variable
Rly5=pin5Value;
void myTimerEvent()
{
//------------------------------------------------------------------
-
static unsigned long timepoint = millis();
34
LDR1 = analogRead(potPin)/ ESPADC * ESPVOLTAGE; // read the voltage
LDR1=100-(LDR1/3299*100);
LDR2 = analogRead(potPin2)/ ESPADC * ESPVOLTAGE; // read the
voltage
LDR2=100-(LDR2/3299*100);
VOLTAGE = analogRead(potPin3)/ ESPADC * ESPVOLTAGE; // read the
voltage
VOLTAGE=(VOLTAGE/3299*100);
//-------------------------------------------------------------
Serial.print(LDR1);
Serial.print("\t");
Serial.println(LDR2);
LIGHTAVG=(LDR1+LDR2/2);
delay(100);
Blynk.virtualWrite(V0,LDR1);
Blynk.virtualWrite(V1,LDR2);
Blynk.virtualWrite(V2,LIGHTAVG);
35
Blynk.virtualWrite(V3,VOLTAGE);
//-------------------------------------------------------------
}
void setup()
{
int i,k;
myservo.attach(18);
delay(1500);
Serial.begin(9600);
void loop()
{
Blynk.run();
timer.run();
37
APPENDIX C – PRODUCT POSTER
38