1. A Smart Pet Door System using Mobile Computing and Context-Aware Devices
Andrea Lopez1, Roberto Sebastian Loera1, & Dr. Yu Sun2
1 Citrus College 2 Computer Science Department, Cal Poly Pomona
The purpose of this project was to create a smart pet door prototype that
was a cost effective substitution to existing pet doors, with mobile and
intelligent capabilities. This was accomplished using a Raspberry Pi,
which is a microcomputer, a miniature linear servomotor, which provides
linear motion, a wifi dongle, a Bluetooth dongle, an external battery
source, and with mobile/cloud programming done in Android and Node.js
languages. Once a Bluetooth iBeacon, attached to the pets’ collar, is within
a specified distance from the Bluetooth receiver on the Raspberry Pi,
located above the pet door, it automatically sends a command to lift the
door by retracting the server motor arm and taking a picture, using the
attached camera, to be sent to the owner’s mobile phone application. The
application gives the owner the option to save and store the picture, or to
remotely open the door, should there be collar signal interference.
The objective of this pet door project was to stop pet owners from having
to get up or stop what they were doing to let their pet out for a bathroom
break; the pet door also needed to address the concern owners had with
unwanted entrances. To solve these problems, the group created a cost
effective and easy to use smart pet door that opens when the pet, with an
iBeacon collar, comes within specific range. A mobile application was also
to be created to remotely open the door from a distance should the door
not open with the collar due to any interferences. Essentially, the raspberry
pi installed in the pet door would receive the Bluetooth signal from the
iBeacon collar with a blue tooth dongle, causing the pet door to open
through the retraction of an actuator. Simultaneously, the Raspberry pi
would automatically take a picture of the pet moments after the door fully
opened. This photo would be forwarded to the pet owners mobile
application with a selection to save or delete the photo. This project would
also be able to be applied to other scenarios where automated switches
were needed based on the proximity of people or objects.
ABSTRACT
INTRODUCTION
HTTP SERVER
• Allows android application to
access controls through the
internet
• Runs Retract Python Script when
iBeacon is within “open” range
• Runs Extend Pythons Script
once when iBeacon out of range
• Runs code to takes a photo
RESULTS
This research was supported by a U.S. Department of Education Title III
grant PR# P031C110019.
Thank you Dr. Yu Sun for your continued support throughout this project.
Thank you Dr. Marianne Smith and Professor Barbara Juncosa for making
this research opportunity possible.
Thank you Andrew Ferguson for help with the Raspberry pi.
• Gaddis, Tony, Starting out with Java. Pearson Education, 2016.
Paperback
• Hardy, Brian and Phillips, Bill. Android Programming: Big Nerd
Ranch. Big Nerd Ranch, Inc, 2013. Paperback
• Arduino. 2015. Retrieved from http://www.arduino.cc/
• Raspberry Pi Foundation. 2015. Retrieved from
https://www.raspberrypi.org/
RESULTS (continued)
REFERENCES
ACKNOWLEDGMENTS
MATERIALS AND METHODS
Part 1 : Door Mechanism
Step 1 - Research and order equipment that provides the desired motion
Step 2 - Wire and test electronics to ensure electronics would power up
Step 3- Create and test the arduino code and the python script. Testing
done with minicom program
Step 4 - Create and test the HTTP server to handle all desired commands
Step 5 - Attach the door panel and encase electronics
Part 2 Android Application
Step 1 - Create the necessary User Interface
Step 2 - Research the proper codes said buttons
Step 3 - Grant the internet permissions to the applet
Step 4 - Communicate with the server to extend and retract the Actuator
MATERIALS AND METHODS (continued)
! ! ! ! ! ! !
! !
! !
! !
!
!
!
!
!
!
!
!
!
!
!
!
!
!
Raspberry Pi 2 B+
Arduino Uno
Battery
Actuator
PWR
GND
CTRL
Camera
Camera
GND
PWM 9
Door
WIFIBT!!!!!!!!!!
!!!!!Micro
USB
!
!!!!!
USBA
USBB
!!!!!
Wall
Outlet
!!!!!
!!!!!
!
PYTHON SCRIPT
• Sends the letter e
to the arduino
through serial
port
• Sends the letter r
to the arduino
through serial
port
ARDUINO CODE
• e is received; the arduino
sends a 1 second pulse to
actuator, which causes arm
extension
• r is received; the arduino sends
a 2 second pulse to actuator,
which causes arm retraction
ANDROID APPLICATION
• Allows user to open and close the door
• Allows user to save photo
HARDWARE
PROGRAMMING
Figure 1 (left): Diagram of door mechanism. Figure 2 (right): Code excerpt
Figure 8 (left): Mechanism to be inserted into the pet owners’ door
Figure 9 (right): Android application user interface. The buttons command the open and
close function on the mechanism. The photo taken will sent from the mechanism to the
mobile device and displayed in the location of the blue square.
In conclusion, the group was able to successfully construct the mechanism
that would open and close the Smart Pet Door, by sending different
distinct pulses, to be placed inside the door. The server generated by the
Raspberry Pi 2, which also controls the Actuator, is what marries the
hardware mechanisms and the software applet. The app is able to send the
commands to raise and lower the door, while, the option to save the taken
picture is further being developed. Together, this entire project may be one
of the more cost effective and technologically advanced Smart Pet Doors
on the market.
CONCLUSION
Figure 3: Raspberry Pi 2 B+ Figure 4: Arduino Uno,
Figure 5 (below): Raspberry Pi Camera
Figure 6: Firgelli Linear Servo Actuator
Figure 7 (below): 6+ Volt Source