Smart Home Controller
Taylor Santiago

Raspberry Pi
Photo Credit: Wikipedia.org

Taylor Santiago

HTC 8x
Photo Credit: Ama...
Physical Setup
This project required the following physical items:
•
•
•
•
•
•
•
•
•

Taylor Santiago

Raspberry Pi
SD Car...
Bluetooth Handler
• The Raspberry Pi is setup as a Bluetooth server
• Python script constantly receives messages from the ...
TCP Socket Handler
• Raspberry Pi is setup as a client connected to my personal website
• The Pi polls the website every s...
Metrics Handling
• Metrics are collected by threaded functi0ns that monitor the Raspberry Pi pin values
• When the monitor...
Website Support
• The website is written in PHP – http://tws928.com/smarthome.php
• Once the website is accessed in a brow...
Windows Phone Application
• The windows phone application is written in C# using Visual Studio
• The application is levera...
Project Learnings
• Raspberry Pi setup and usage
• The importance of handling exceptions – when dealing with socket connec...
Possible Project Extensions
• Password encryption
• Multiple user support with parental controls
• It may be worth investi...
Video

http://www.youtube.com/watch?v=ALd-DvJ9pBM

http://www.youtube.com/watch?v=Ik2gXzdcTew

To view these without openi...
Physical Setup Pictures

Raspberry Pi

Taylor Santiago

Breadboard connections

ECE 561
Physical Setup Pictures

Raspberry Pi, breadboard, and USB Hub

Taylor Santiago

Cardboard house with four rooms

ECE 561
Smartphone Application Pictures

Start Screen

Taylor Santiago

After tapping find paired devices

After connecting

After...
Smartphone Application Pictures

User interface for lights control

Taylor Santiago

Metrics screen

ECE 561
Upcoming SlideShare
Loading in …5
×

Taylor Santiago - ECE 561 - Smart Home Controller

513 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
513
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Taylor Santiago - ECE 561 - Smart Home Controller

  1. 1. Smart Home Controller Taylor Santiago Raspberry Pi Photo Credit: Wikipedia.org Taylor Santiago HTC 8x Photo Credit: Amazon.com TCP Operation Photo Credit: Cisco.com ECE 561
  2. 2. Physical Setup This project required the following physical items: • • • • • • • • • Taylor Santiago Raspberry Pi SD Card to boot Debian Unix HTC 8x (Windows Phone OS) Bluetooth Dongle USB Mouse and Keyboard AC Powered USB Hub Breadboard, LEDs, Resistors, and Misc. Wiring HDMI Compatible Monitor Ethernet Cable ECE 561
  3. 3. Bluetooth Handler • The Raspberry Pi is setup as a Bluetooth server • Python script constantly receives messages from the client, the smartphone • Incoming messages are parsed and are then handled by either driving GPIO pins or replying to the client with metrics Taylor Santiago ECE 561
  4. 4. TCP Socket Handler • Raspberry Pi is setup as a client connected to my personal website • The Pi polls the website every second to see if it’s accepting connections • Incoming messages from the server are accepted and handled in a similar manner to the Bluetooth handler Taylor Santiago ECE 561
  5. 5. Metrics Handling • Metrics are collected by threaded functi0ns that monitor the Raspberry Pi pin values • When the monitors witness a change on the pin (light toggled), the light status and usage time metrics are updated • Light metrics are kept in a python dictionary, with values such as ‘status’, ‘time_off’, ‘time_on’, and ‘total_time’ being tracked Taylor Santiago ECE 561
  6. 6. Website Support • The website is written in PHP – http://tws928.com/smarthome.php • Once the website is accessed in a browser, it begins listening for connections • Radio buttons are presented to the user to choose accepted commands to send to the Raspberry Pi • Information on the lights status and percentage of time used is presented to the user Taylor Santiago ECE 561
  7. 7. Windows Phone Application • The windows phone application is written in C# using Visual Studio • The application is leveraged from a Bluetooth template provided by Microsoft • I added the handling of user interactions and encoding and decoding outgoing and incoming messages, respectively Taylor Santiago ECE 561
  8. 8. Project Learnings • Raspberry Pi setup and usage • The importance of handling exceptions – when dealing with socket connecti0ns from multiple sources, it’s crucial to not let communication errors crash your application • PHP and Bluetooth socket programming • Windows phone programming • Python Threading Taylor Santiago ECE 561
  9. 9. Possible Project Extensions • Password encryption • Multiple user support with parental controls • It may be worth investing in a different embedded system, or at least a better USB powered hub. Bluetooth flakiness was an issue • Add semaphore support – lots of shared resources Taylor Santiago ECE 561
  10. 10. Video http://www.youtube.com/watch?v=ALd-DvJ9pBM http://www.youtube.com/watch?v=Ik2gXzdcTew To view these without opening your browser, open this in Slide Show mode Taylor Santiago ECE 561
  11. 11. Physical Setup Pictures Raspberry Pi Taylor Santiago Breadboard connections ECE 561
  12. 12. Physical Setup Pictures Raspberry Pi, breadboard, and USB Hub Taylor Santiago Cardboard house with four rooms ECE 561
  13. 13. Smartphone Application Pictures Start Screen Taylor Santiago After tapping find paired devices After connecting After hitting ‘View Control Options’ ECE 561
  14. 14. Smartphone Application Pictures User interface for lights control Taylor Santiago Metrics screen ECE 561

×