element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi IoT
  • Challenges & Projects
  • Design Challenges
  • Pi IoT
  • More
  • Cancel
Pi IoT
Blog [Pi IoT] Smart Competition Home #1: Introduction
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: clazarom
  • Date Created: 25 May 2016 1:34 PM Date Created
  • Views 1262 views
  • Likes 4 likes
  • Comments 6 comments
  • pi 3
  • piiot
  • iot
  • designchallenge
  • smart home
Related
Recommended

[Pi IoT] Smart Competition Home #1: Introduction

clazarom
clazarom
25 May 2016

Introduction

Smart-homes are one of the most popular applications in IoT. It is very convenient when you can access your house information (and never wonder again whether the door was left open or the kitchen stove is on), and even have some basic automatic features implemented (temperature auto-set, lights off when they are not needed etc).

We implemented a prototype with these temperature and pressure recording system a few weeks ago (just to test if could have a simple MQTT architecture), with only some basic monitoring features. We want to add persistence to the system (a storing database), an actual interface and some remote capabilities. Also, new interesting devices can be included in the platform: a gas detector or a camera to be accesses when out of the home.

But wait... there is more: 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.

The original platform is exercise oriented. We will implement first the simplest case: a running kind of competition. Here, each person will use their phones to track the miles they have run during the week, so the person with a higher number will get more points and a higher position in the general ranking. We can add some extra information, to get some variety: use the accelerometer/gyroscope of the phone or some other wearable devices (a wristband or a heart rate monitor for example).

Implementation

Firstly, we set up the smart home environment. The Raspberry Pi 3 will act as the central node of the implementation. It will be working as the main component of a smarthouse as well as the data collector of all the competition participants. Apart from its processing function, a display and interface will also be implemented, so that this central node can be a user’s access point as well.

Briefly, functions implemented by the central node/Raspberry Pi 3:

  • Main bridge between platform and user. It will host a Graphical User Interface, with its corresponding functions.
  • Smart-home central node, collecting sensors information and showing it on screen.
  • Competition central node, collecting data from users and configuring the general ranking. This ranking will also be displayed.

Features to be included in the Pi:

  • GUI itself
  • Database, to store the incoming data
  • Web server, to provide remote access to the service
  • Corresponding hosts for the smart-home central node and the competition central node.

Apart from the central node, the platform will include the following components:

  • Sensors and a sensor node (Raspberry Pi)
  • Wearable devices and a mobile device to manage it (Smart-phone)

 

Smart-home

We will not only implement the competition game, but also some basic functions of a smarthome: temperature and pressure reading, a door sensor and a simple alarm button. In order to control all these sensors, we can use another Raspberry Pi to work as a sensor node.

In the end, the list of devices in the platform is:

- Central node – Raspberry Pi 3

- Sensors node – Raspberry Pi (with a WiFi dongle)

- Mobile user device – smartphone (with Android OS)

- Temperature sensor – TMP006

Pressure and altitude sensor  MPL3115A2MPL3115A2

- Door sensor – usually closed magnetic switch

- Alarm button – usually open switch

There are two levels of communication in this platform:

1)Fetching data - wired connections.

Our proposed sensors will first connect to a “sensor node”, a Raspberry Pi. Depending on the sensors, they will be:

  • Directly connecting to a GPIO port of the Pi. Such is the case of the door sensor and the alarm buttons (both of them acting as switches). The hardware implementation provides a 1 or 0 input in the GPIO (whether the switch is open or closed)
  • Using the I2C protocol and the corresponding GPIO ports (SDA and SCL).

 

2) Distribution of data - wireless connections.

image

 

 

We will be using WiFi connection to implement the MQTT message protocol. This protocol is based on a client/ broker architecture. Clients are then divided in publishers (generating data) and subscriber (receiving the data they are interested in). The exchange between publishers and subscribers is done via the broker.

In this system, these elements are represented as:

  • Broker - central node: Raspberry Pi 3
  • Publisher - sensors node: Raspberry Pi
  • Subscriber - user mobile device: Smartphone (in our case, Android). There is a secondary subscriber in the broker too (which will be doing the data recording)

 

image

 

With this structure, we were able to received the sensors data in both the broker and the smartphone in a continuous basis.

A security connection to he broker is still needed. We can crate a certificate authority in the broker, which will be generating certificates for all clients. In order for a connection to be accepted, the request needs to come with the adequate certificate. Distribution of certificates as well as the secure connection itself are the major challenge of this implementation.

As stated before, we will start by adding a data recording system: the main node will also have a database where sensors reading can be stored. In this same node, we can implement a secure web server, to access this stored data even if we are not connected to the home WiFi.

Moreover, we would include some monitoring functions: with a camera at the living room, to be turn on by the user (ideally, when they leave home), we could check what is happening int he house.

Competition game

With a smarthome implemented, we want to increase the reach of the platform. This way, our home users will not feel disconnected even when they leave the apartment. The proposed scenario is built as a runners competition kind of game: using the smart-phone information, our smart home will also define a ranking. They way any user can go up in this ranking is by running/walking more and more miles. As a result, the smart home capabilites will also be extended outside the house itself, to be able to follow our happy runners.

We will have a web server built on the Raspberry Pi(our home central node). Each smartphone device will have an application that:

  • Monitors the user's run distance
  • Sends that information to home, to the central node.

image

 

Furthermore, this central node will implement a simple routine to add the distance and display our inhabitants in decreasing order. This simple routine can further be extended (with some additional code in the phone to) to add some more challenging/original tasks: such as, assigning extra point to people going to certain areas (we will have to include geo location capabilities).

 

The former running game idea can be applied to other games as well: inside and outside the house. The same central node can run simple game application (for example, a detective kind of solve the mystery short challenge). We can build a simple autonomous (which will use some infrarred sensor to avoid collisions) mini car with the Raspberry Pi 2, that will leave its refuge at certain times and needs to be taken back to its original location. Even outside, the maps functionality can be used to motivate the users to visit new placed in their city, do some tourism... It can be targeted for kids (simpler in house games) or adults (as the runners app itself)

 

Conclusion

With this project, we want to implement a basic but fully functional smart house. To add an original feature, on top of the sensors reading and monitoring, we proposed a running competition among the habitants of the house.

This way, the main display of the smart home will show some house keeping data (such as temperature or pressure), but also the current status of the competition.

This same structure can also be applied to other types of games: have some games on the central node, enter a “city rally” discovery game ...

  • Sign in to reply

Top Comments

  • balearicdynamics
    balearicdynamics over 9 years ago +2
    The idea of the competition remind me to the Lewis Carroll's Alice. And I think this project can really make a common home in a wonderland
  • DAB
    DAB over 9 years ago +2
    Since the whole idea is an exploration into ideas and then evaluating the results, there is no wrong place to start. What may not work for one person may be the perfect implementation for another. I think…
  • georgekav
    georgekav over 9 years ago +1
    Quite interesting project indeed. What would be excellent to see in fact, is how do we keep the occupant engaged in this gamification of the home management. Are they still gone play after 3-4 months?…
  • clazarom
    clazarom over 9 years ago in reply to dougw

    True, thanks for pointing the difficulty out. I did not think of that, but a fairer competition should have different levels of difficulty, as you said. I will add some "level of difficulty" feature per participant.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 9 years ago

    Competition definitely adds an extra motivation component for some people.

    To level the playing field so everyone can win, it may be necessary to introduce a handicap system.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clazarom
    clazarom over 9 years ago in reply to georgekav

    A very good point! Keeping the residents engaged and interested is not an easy task: if it is only a matter of running more miles than my roommate every week.... well, it can get boring very fast.

    At first I was thinking of only combining a Run app (like the ones people use to show how many miles they run, what was the route etc.) into the smart home environment. And to push a bit more the healthy life style, presenting a direct competition among roommates. To include some variety, I want to add the extra "go to this particular point" (where the point is an interesting location in Chicago) or some other small challenges.

    Though, at this point, the smart competition home is more a 'what if' kind of exercise.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • georgekav
    georgekav over 9 years ago

    Quite interesting project indeed. What would be excellent to see in fact, is how do we keep the occupant engaged in this gamification of the home management. Are they still gone play after 3-4 months? Smart homes is a relatively costly exercise to be only for short term benefits.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 9 years ago

    Since the whole idea is an exploration into ideas and then evaluating the results, there is no wrong place to start.

     

    What may not work for one person may be the perfect implementation for another.

     

    I think the value of the challenge is to look at the ideas, see what results and then think more on the issues.

     

    DAB

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube