Welcome to installment number twenty two of the Design Challenges Project Summary series here at Element14. For those of you who are new to my content, in this series I will pick a single Design Challenge project from the current challenge (Pi IoT Smarter Spaces) and write a short summary of the project to date. Over the course of each challenge, I try to revisit each project that I cover at least once, and I am sure that some project summaries will get more than one update if they themselves are updated frequently. Unfortunately, projects that stall out, or get abandoned, will not receive any updates. Some project creators like to keep their own project summary going, and this series is not meant to overshadow those post, but to highlight each project from an outsider's perspective.
The subject of this installment is project Smart Competition Home by Caterina Lazaro (clazarom). While smart homes are quickly becoming a dime a dozen these days, Caterina has devised a cool twist to make hers stand out. In the project’s introduction post, she says that not only will she integrate sensors, and control capabilities into her smarthome, but she will be implementing a competition into the system that pits the home’s residents against each other in friendly competition. The competition will be exercise based, with each resident of the home tracking their workouts via their mobile devices, and then points will be given to those with the highest statistics. “For this IoT challenge, we are also proposing a fun version of this IoT smart-house, where current inhabitants are not only treated as part of the system, but will also compete to be the number one,” she said.
A will act as the home’s central node, which will handle all of the data retention duties as well as a command center for all subsequent nodes in the system. Caterina says that she will install a GUI onto this central node to handle local administration, and for remote access will be provided by a webserver running on the Pi as well. Other nodes will be Raspberry Pi based as well, and will use WiFi dongles to handle communications back to the central node. Environmental conditions will be monitored by several different sensors, as well as a couple of security features such as a door sensor, and an alarm button. While initially this project looked very ambitious, I am not convinced that Caterina will be able to pull it off fairly easily.
The key to any successful project is planning, followed by execution. The project’s first update (second post) took care of the first part of that equation by laying out a clear, and detailed attack plan, followed by a full schedule in which each step will take place. As someone who holds a Bachelor's Degree in Business Administration, and studied project management quite a bit, I truly appreciate the careful thought that Caterina has put into this project, especially the way she mapped out each facet of the smart home system. If she sticks to the schedule that has been laid out, the project’s core functionality will be complete by week seven, and she can begin implementing additional functionality to the project of which three “extra” features have been planned.
The project’s second update (post number three), introduced newcomers to MQTT (Message Queue Telemetry Transport), and gave the rest of us a refresher course on how to setup device connectivity between nodes. Starting with the installation of Mosquitto Broker in the central node, Caterina walked us through the install, configuration, and testing steps to get everything running, and included all of the commands needed as well as some commands that are useful once MQTT is up and running. She then briefly mentioned the use of Paho to setup the MQTT clients on the various devices that will be implemented in this project. Head over to the link above to see the full tutorial.
In her next update installment, Caterina began work on implementing the sensor array that will be utilized in her smart competiton home. The sensor node is based on a Raspberry Pi Model B, and will be used to fetch data from the sensors connected to the system. For now, the sensor array will be limited environmental metrics such as temperature, barometric pressure, and humidity, while a door sensor, and an alarm button will also be connected to this node. As data is being gathered, this node will push the data back to the central node using MQTT. Another MQTT client will be installed on a smartphone which will also push data back to the central node. Python and Java will be the languages of choice when coding for the sensors and smartphone.
This update is quite long, and includes everything from the basic communication layout between the clients and central node, as well as descriptions of each sensor, and the source code that was used to address them. As of this update, Caterina says that the smart home aspect of the project is fully functional. “We have set up a simple, yet complete functional infrastructure for our smart home,” she said. “This system only reads some environmental and house state data, which can be viewed in the Central Node of the house, or with an App in the smart phone. In this post, she also made all of the code available on Github, which can be found here. Head over to the post link above to check out this very informative update, and to view a video of the system in action.
Updated: 12, September 2016
With so much work being done in the last update, the Central Node was falling a bit behind, and was due for an upgrade to something that was a bit more user friendly. In update number five, Caterina began work on integrating the , as well as building out the User Interface. Getting the touchscreen working was simply a matter of following the official instructions on the touchscreen’s product page. The GUI was built using Python and the GTK library, and all of Caterina’s code can be found on her Github for this project, which I linked to earlier in this summary. The post finished up with a short tutorial on setting up a MySQL database on the Raspberry Pi 3, and then getting an Apache web server up and running to make the central node accessible from any connected device.
Update number six was a general overview post that served to help readers better understand upcoming competition portions of the project. “The innovation part of this project is the competition system: we want to engage the residents of the house in a competing environment to promote a healthier way of life,” she said. “It can later be expanded for more fun type of activities. For now, the only challenge presented to the roommates is the amount of km walked/run/biked during a month.”
Work continued on the competition system in update number seven, with Caterina focusing on the distance tracking system. One of the competition metrics that will be tracked by the system is the distance each participant walks each week. In the past this would have been hard to accomplish, but thanks to smartphones being so prevalent, it is now easier to do than ever before. Caterina chose to create an Android app that utilizes the GPS unit in each participant's phone, and had the foresight to realize that this method alone had a flaw. Users could simply record their distance traveled by vehicle, which would be very unfair to others who are participating in the challenge. To fix this issue, she combined speed and footstep data from the phone to limit what movement gets tracked. Wrapping this post up, she shared a small tutorial on how to store the collected data in a SQL database, and as you can see from the video above, it works fairly well.
Progress on the competition system continued in update number eight where Caterina detailed the process she uses send the distance data from the smartphone to the central node for processing. The communication is handled over the web via an HTTP_POST, with a confirmation check at the end to ensure that the data has been received and stored on the Raspberry Pi 3. The message sent to the serve “will contain a String with a JSON Array format this way, I can send several samples (several rows in the database), each of them with a key: value format. As a result, when the server receives the HTTP_POST, it will be easy to extract and identify each value,” Caterina said. She does note that this method of sending data from the client to the server is inherently insecure, and is wide open for sniffing, and manipulation for now with encryption coming at a later date.
With work complete on the app side of the competition module, Caterina shifted focus onto using the distance data that is collected, and integrating it into the central node’s UI. “Most of the information will be stored from the Competition service,” she said. “Then, the Python main program will retrieve that information and display the competition in its main GUI. It will also determine who is the monthly winner at the end of each period.” I won’t go into all of the details on how she accomplished this, so you will have to head over to the post to get up to speed.
Update number ten finished out the competition portion of the project with Caterina showing us how she configured the server to send the competition’s status back to the competition app on each participant’s smartphone. This functionality not only serves as a way to see how the user stacks up against the competition, but functions to serve as motivation to push harder to gain a better standing in the results. As I mentioned earlier, this post wraps up almost all of the competition portion of this project, and I have to say that this is a very unique aspect to the traditional smart home. I really to see more metrics added into the competition system in the future, and for this to become a stand-alone package that anyone can install on their home server to create their own healthy competitions with their family.
The project’s eleventh and final update was centered around the User’s node that would display data from the central node on the user’s smartphone. The user node “Will include the smart-house functionalities to that of the competition system. This way, any resident will be able to check the smart house information while connected to the WiFi and switch to Competition mode when leaving to gain some miles,” Caterina said. As always, Caterina has included the source code needed to get this portion of the project up and running, so head over to the full post to check it out.
Wrapping things up, Caterina posted a final two post on the 30th of August. The first post was a full recap of system and how everything is connected, while a final post was dedicated to a look back at the project as a whole, and what will happen after the challenge is over. Both post are well worth a read, and I for one, can not wait to see what the future holds for project Smart Competition Home.
That is going to wrap up my project summary coverage of project Smart Competition Home. I really enjoyed this project, and it’s fresh approach to making a smart home even smarter. The competition aspect of it simply blew me away, and really gave me a new outlook on what a smart home can truly be. Instead of just a bunch of sensors, and relays, a smart home can include competitions, games, entertainment, and anything else we can dream up. I want to offer a huge thanks to Caterina for working so hard on this project, and for demonstrating such amazing out-of-the-box thinking. If you have not yet read through the whole project, I highly suggest doing so by visiting its blog page. Tune in next week for another Design Challenge Project Summary here at Element14. I will be back next week with another Design Challenge Weekly Project Summary. Until then, Hack The World, and Make Awesome!