Sunteți pe pagina 1din 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/314105271

Smart dog feeder design using wireless communication, MQTT and Android
client

Conference Paper · October 2016


DOI: 10.1109/IC3INA.2016.7863048

CITATIONS READS

2 1,534

3 authors, including:

Kanisius Karyono Hargyo Nugroho


University Multimedia Nusantara University Multimedia Nusantara
13 PUBLICATIONS   25 CITATIONS    12 PUBLICATIONS   22 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

UMN Smart Room View project

Mobile Indoor Robot Guidance View project

All content following this page was uploaded by Hargyo Nugroho on 10 January 2018.

The user has requested enhancement of the downloaded file.


2016 International Conference on Computer, Control, Informatics and its Applications

Smart Dog Feeder Design Using Wireless


Communication, MQTT and Android Client
Vania 1 , Kanisius Karyono2, Hargyo Tri Nugroho I. 3
Computer Engineering
Universitas Multimedia Nusantara
Tangerang, Indonesia
1
vania@student.umn.ac.id
2
karyono@umn.ac.id
3
hargyo@umn.ac.id

Abstract— Regular feeding is one of the problems in dog’s author wants to make feeding process more efficient for the
maintenance. Owners often forget to feed their pets because of user.
their work. Smart Dog Feeder is the answer to these problems.
This device can provide regular feeding without disrupting The Internet of Things concept has given ideas for the
owner’s work. Owners can monitor feeding process with their author [2]. Internet era can help every work to be eassier than
Android smartphone virtually. Smart Dog Feeder can give it should. Making a dog feeder to be smart can be done by
authentication with RFID, set feeding time and portion per adding the Internet of Things concept. Dog feeder can be
serving through Android smartphone, send feeding report (eaten smart with adding some new technologies and makes it able to
or partially eaten), and dog arrival when the feeding time has interacts with other devices. Therefore, the authors wants to
arrived. Every setting about feeding time, portion, stock and make a smart dog feeder to solve this problem.
waiting time will be set on Android with minimum requirement
of Jelly Bean version, SDK 18 and has been installed with Smart Dog Feeder is designed with RFID to authenticate
Appliance Hub application. Smart Dog Feeder has stock dog’s tag, so that any other dog cannot access the device. It
information, feed schedule, waiting time and owner’s name from can set feeding time and portion per serving through Android
server uses MQTT protocol. All information will be sent in JSON smartphone, send feeding report (eaten or partially eaten), and
format and will be processed by Smart Dog Feeder, Android and dog arrival when the feeding time has arrived. Smart Dog
server. Smart Dog Feeder will save the schedule and set RTC Feeder has stock information, feed schedule, waiting time and
alarm which will interrupt when the feed time has arrived. owner’s name from server uses MQTT protocol. All
Authentication process is done by checking RFID tag which is information will be sent in JSON format and will be processed
attached on dog collar. Food will be served based on user’s by Smart Dog Feeder, Android and server. Smart Dog Feeder
setting and be measured by load cell. Experiment is done by will save the schedule and set an alarm which will interrupt
seeing punctuality, portion congruence, delivery of settings and when the feed time has arrived. It also has a load cell sensor to
notification within devices. The result of experiment is Smart Dog measure serving size based on user’s setting.
Feeder can receive messages from server and do feeding at the
right time. Next development can be done by adding other This Smart Dog Feeder will be very useful for dog owners
devices in Appliance Hub system. who have a busy schedule and often leaves home. The owners
do not have to worry about leaving their dogs at home and can
Keywords— Android; Appliance Hub; Arduino UNO; monitor their diets through his smartphone.
Internet of Things; JSON; MQTT; NodeMCU; Smart Dog
Feeder; A. Previous Related Researches
There are few previous researches that have been done
I. INTRODUCTION about automatic feeder, such as Programmable Pet Feeder [3]
Dog is the most common pet that people owned. and Smart Pet Care System [4]. They are not exactly
Nowadays dog is also one of family member to the owner. So, addressed to feed dog but pet in general. Programmable Pet
dog’s healthiness is important. Regular feeding is the most Feeder is feeding automatically using microchip PIC18F4520
important thing, but it also one of the problems in dog’s microcontroller. A stepper motor is used to control the speed
maintenance. Owners often forget to feed their pets because of and positioning and a DC motor to dispense food. The food
their work. A dog feeder can be the answer to these problems. dispenser is named Turn-Table which divides into 4 sections
and can dispense different kind of foods. Buzzer is used to
Now there are some dog feeder that are created. But the alert when feeding time was arrived and the meal is served.
author sees that there are some features that still can be added User can set the schedule for each section using the LCD and
to the feeder tools. One of the feeders the author found still input their desired timing.
has to be set manually [1]. It also has an alarm system, but
users also have to set manually on the devices. Therefore, the Smart Pet Care System consists of an automatic feeder, an
automatic pooping pad, a camera with Raspberry Pi, and an
application for smartphone. Automatic feeder has 3 layers to

978-1-5090-2323-3/16/$31.00 2016
c IEEE 191
dispense and distribute the food. It uses Arduino to control the III. MECHANISM DESIGN
feeding mechanism and a weight sensor to measure serving
size. A Raspberry Pi camera is used to monitor automatic A. Smart Dog Feeder
feeder and pooping pad. The Raspberry Pi also acts as server. Fig. 3 shows the block diagram of Smart Dog Feeder.
In the application, user can choose serving size and the Smart Dog Feeder is designated with Arduino Uno
schedule for 3 times feeds. Unfortunately, the application is microcontroller at its core. It is responsible for controlling the
made in Korean language. flow of main program, as well as controlling all the sensors
and the actuators used. The microcontroller is also responsible
for all data exchange (in this case JSON objects) between
Smart Dog Feeder and User’s Smartphone through ESP8266
WiFi module.
ESP8266 WiFi module with NodeMCU firmware
programmed in lua language. NodeMCU does initialization to
get owner, dog food stock, and feeding schedule from the
server [6]. As the feeding time has been scheduled at RTC,
NodeMCU sends report command to the server. Report also
includes feeding process status.

Fig. 1 Turn-Table [2]

From two examples about automatic pet feeder, the author


wants to make a feeder which is connected to a system that
completes those two feeder. Programmable Pet Feeder only
has 4 dispensers which means it can only serve 4 times and it
requires the user to set the times at the device. Smart Pet Care
System can be set with a smartphone but the user can’t see the
record of the feeding process. It provides camera but the user
has to watch it to find out what their pet is doing.
Smart Dog Feeder is addressed to feed small to medium
size dog. It has an authentication system using RFID and is
connected to a system called Appliance Hub which is
encrypted with SSL/TLS. User can control Smart Dog Feeder
using the Android application. The application is designed to
set feeding schedule, monitor the processes, update food stock,
and register or unregister the device(s). User can choose the
amount per serving and set how many times the feeder will
serve (once to thrice a day). This application is easy to use
because it’s made in English language.
II. OVERALL SYSTEM DESIGN
Smart Dog Feeder communicates with server through WiFi
module ESP8266 development board, NodeMCU, with Fig. 2 Appliance Hub System
MQTT protocol over SSL/TLS. All data received by ESP8266
will be formatted as JSON object and sent to Arduino to be The components used for Smart Dog Feeder are RC522
processed. ESP8266 also tasked to send data to server from RFID reader and tag, load cell from gold weighing scale,
Arduino. HX711 weighing module, Arduino UNO, servo motor
DF15RSMG, real time clock DS3231, magnetic switch,
As shown in Fig. 2, the communication is also based on LM2596, screw shield, ESP8266 WiFi module, and 12V
MQTT protocol on the client side. Android application sends adaptor.
command in JSON to the server and vice versa. The server
controls every message that received and sent to Smart Dog RFID used for authentication system. The only dog that
Feeder or Android application. Every message has specific can make Smart Dog Feeder work is the dog with RFID tag on
function to be processed and collects in the database [5]. In its neck. Load cell is needed to quantify the dog food. The
this system, the server is built using Node.js script and capacity is 500 grams and runs at 3V. HX711 is used to
MySQL database. Server is also incharges to do authentication amplify the load cell. Arduino UNO is the microcontroler that
and authorization. is used, which processed data and commands.

192
Generally Appliance Hub application consists of 8
activities, which are Sign In Activity, Sign Up Activity, Main
Setting Activity, Appliance Activity, Setting Activity,
Account Setting Activity, Change Password Activity and Edit
Profile Activity. In Appliance Activity, there is one other
activity which is called Add Appliance Activity. In Setting
Activity, there are five activities, which is Feed and Feed
Time Activity, Log Activity, Update Stock Activity and
Unregister Activity. Fig. 5 is the main flow of the application.

Fig. 3 Block Diagram of Smart Dog Feeder

Servo motor is used to rotate the propeller blade used as


dog food pouring mechanism, as seen in Fig. 4. Real time
clock is used to give time to Arduino and set feeding schedule.
Magnetic switch is used to detect the lid on the dog food
container as an “update stock” mechanism. LM3596 is used to
reduce voltage from 12V to 5V as a power source for every
components. ESP8266 WiFi module which is installed with
NodeMCU firmware is used to communicate.

Fig. 4 Propeller Blade for Pouring Mechanism [7]

The specification of Smart Dog Feeder in this paper are:


1) Maximum capacity of dog food is 1 kg;
2) Dog food that can be used is dry food and has round
shape;
3) Available portions are 1/3 cup (76 grams), 2/3 cup
(150 grams), and 1 cup (227 grams);
4) Smart Dog Feeder designed for small to medium dog
(12 – 30 cm) and feeds one dog;
5) Android devices that can use the application has a Fig. 5 Appliance Hub Application Flowchart
minimum version of JellyBean and SDK 18;
6) Measurement of weight of the food only until digit Main activity in the application is Sign In Activity. If a
unit in gram; user has not registered, they have to register on the Sign Up
page with choosing “Sign Up” option. After sign in or sign up
process is done, user can choose the Account Setting or
B. Appliance Hub Application Appliance menu. If they choose the Account Setting menu,
Appliance Hub application uses Paho Android Service to they can make changes of their profile or password. However,
connect MQTT server. A certificate is needed when the if they choose the Appliance menu, they will see lists of their
Android application is trying to establish a connection with the appliances. User can chooses one of them and gives command
server. Initialization begins when user logs in to the to the appliance. For giving new command to Smart Dog
application and create MQTTAndroidClient. Afterwards, the Feeeder, the user will be in the Feed Activity which contains
communication occurs through publish function to send some EditText to input serving size, how many time(s) they
command and subscribe function to receive messages. want to feed and how long they want to wait to check feeding

193
status (eaten or partially eaten). After that, the user will be servo motor when the serving size has been reached. However,
taken to Feed Time Activity to set feeding schedule based on from the measurement results that have been obtained, it’s
how many time they want to feeding their dog. Server will be revealed that the food often exceeds the desired portion. This
receive the command after user press “Submit” button and will is due to mechanical limitation of the propeller blades. One
forward it to Smar Dog Feeder to be processed. side of the propeller blades, in an ideal situation, can contain
approximately 20 grams. Consequently, to reach a serving size
IV. IMPLEMENTATION
that is not multiples of 20, it will always exceed the desired
A. Measuring Implementation portion.
The first trial was done to ensure the accuracy of the load C. Hardware Implementation
cell. In this research, the author compared the measurement
The implementation of Smart Dog Feeder is shown in Fig.
between load cell and reference scale when used to measure a
7. Fig. 7 shows the schematic of Smart Dog Feeder and Fig. 8
100 grams weight. The load cell read 78 gram and the is the prototype of Smart Dog Feeder. RTC DS3231 SDA pin
reference scale read 100 grams. There was a deviation is located at A4 pin and SCL pin is located at A5 pin because
between them in the amount of 22 grams. they communicate with I2C. ESP8266 board communicates
To perform a calibration, the author compared three other through serial communication. Therefore, ESP8266 TX pin is
amounts in different weight, such as 200 grams, 300 grams, located at RX pin on Arduino and RX pin is located at TX pin.
and 400 grams. The result (as seen in Fig. 6) can be calibrated The MFRC522 RFID pin also has spesific pin location to
with curve fitting process on Matlab. Therefore, the support SPI communication. The servo motor is also located at
measurement of the load cell has to be calculated according to one of the PWM pins on Arduino. Other components can be
formula 4.1. located anywhere. Buzzer is located at digital pin 2, magnetic
sensor is located at pin digital pin 4, and HX711 weighing
        (4.1) module is located at A2 (DT) and A3 (SCK). Pin E+ on
Where: HX711 is connected to red wire on loadcell, pin A+ on HX711
x = load cell measurement in gram is connected to white wire on loadcell, pin A- is connected to
green wire on loadcell, and pin E- is connected to black wire
on loadcell.

Fig. 6 The Differences Between Load Cell and Reference Scale


Measurement
B. Feeding Implementation
Feeding trial was done by testing the entire mechanism, Fig. 7 Smart Dog Feeder Schematic
such as real time clock alarm, RFID reader, servo motor, and
the measurement of load cell until the serving size had been
reached. The result showed that real time clock and servo
motor could work as desired. RFID reader could also detect
the tag that was attached to dog’s collar, but there was a
limitation with reading distance. RFID reader that was used in
this research could only read a maximum distance of 2.5 cm
safely without any error, although the datasheet suggested that
the maximum distance was 3 cm [8].
The measurement of the load cell has been nearly accurate
now than before the calibration was applied. It can stop the

194
application, server, and Smart Dog Feeder cannot be read by
other part.

Fig. 8 The Prototype of Smart Dog Feeder

D. System Implementation
Fig. 10 Communication is encrypted
System implementation consists of application
implementation with responses from the server. All
communication is also listened by Wireshark application to Android application can communicate through MQTT
check the security aspect. Fig. 9 is the main page of feeding protocol by using service provided by Paho Android Service.
setting. Fig. 10 shows that the communication process in the With the service, Appliance Hub application can establish a
application is encrypted and cannot be read. The complete connection to the server with "connect" function. However,
implementation can be seen at author’s report [9]. SSL protocol is used for the communication between server
and client to ensure good security. For that purpose, a
certificate is needed when the Android application is trying to
establish a connection with the server. The certificate cannot
be used directly by the Android because the nature of Java
language, which typically does not support .pem file that is
used by the server. Because of this, the certificate has to be
converted into .bks file, which is provided by BountyCastle.
Conversion process is done with keytool command that runs in
terminal. Certificate with .bks format can be used directly in
the application and communicate with the server with SSL.
Smart Dog Feeder is connected to the server with ESP8266
WiFi module. The module comes with NodeMCU
development kit. NodeMCU will run and maintain the
connection with MQTT protocol. This WiFi module also
supports communication with encryption by changing the
mode from mode 0 (which establishes communication without
encryption) to mode 1 (secured communication). NodeMCU
receives message from server and forwards it to Arduino UNO
by serial communication. This message is then processed by
Arduino UNO so that it can run the appropriate function.
In feeding process, load cell measurement test is done to
ensure that the measurement can be used. The result of the test
Fig. 9 Feed Page shows that load cell measurement is inaccurate. However, in a
comparison test between the load cell and a trusted accurate
scale, the difference can be determined so that the
V. CONCLUSION measurements of the load cell can be calibrated to a near
Automatic feeding can be done by connecting Android accurate result
application with server and Smart Dog Feeder through WiFi The portion that is served in the feeding process tends to
communication, and they exchange messages with MQTT exceed the user-inputted number because of a mechanic
protocol. To enforce communication security, TLS/SSL limitation, which is the maximum amount of pet food the
protocol is used so that the communication between Android propeller blade can release per turn (20 gram). There is also a

195
probabilty of food being stuck between the blades, making the [2] Luigi Atzori, Antonio Iera, Giacomo Morabito, “The Internet of Things:
feeding process somewhat inconsistent. In addition to that, the A Survey”, Elsevier, May 2010.
servo sometimes can stop when the blade is in partially [3] Tessema Gelila Berhan, Worku Toyiba Ahemed, Tessema Zelalem
Birhan, “Programmable Pet Feeder”, International Journal of Scientific
opened position. Engineering and Research (IJSER), Nov. 2015.
For future development, Smart Dog Feeder can be made [4] Seungcheon Kim, “Smart Pet Care System Using Internet of Things”,
larger using larger dispenser to store the dog food. The International Journal of Smart Home, 2016.
application can be improved with some new features, such as [5] Michael Aditya Sutiono, “Rancang Bangun Smart Rice Cooker
Menggunakan Protokol Komunikasi Wi-Fi dan Protokol Pertukaran
adding gestures, changing activity into fragment, or adding Pesan MQTT,” Unicersitas Multimedia Nusantara, Tangerang, Skripsi
some new functions for new devices. 2016.
[6] Christian Orvin, “Perancangan Smart Medicine Dispenser Menggunakan
ACKNOWLEDGMENT Komunikasi WiFi dan Client Berbasis Android,” Universitas
The author would like to thank Kanisius Karyono and Multimedia Nusantara, Tangerang, Skripsi 2016.
Hargyo Tri Nugroho for their help and support for this final [7] Even Yehudah Ofer Landau, "Dry Food Dispensing System," US
project, and also Handrey Alex and Michael Sutiono for their 6,964,355 B2, Nov. 15, 2005.
comments and suggestions for this work. [8] NXP Semiconductors N.V, “MFRC522 Standard performance MIFARE
and NTAG frontend”, Apr 2016
REFERENCES [9] Vania, “Perancangan Smart Dog Feeder Menggunakan Protokol
Komunikasi WiFidan MQTT Serta Client Berbasis Android,”
Universitas Multimedia Nusantara, Tangerang, Skripsi 2016.
[1] Radio System Corporation. Healthy Pet Simply Feed Automatic Feeder.
[Online]. http://store.petsafe.net/healthy-pet-simply-feed-automatic-
feeder

196
View publication stats

S-ar putea să vă placă și