Time is up! And I am not done yet. So I have to pack my stuff and present what I have achieved in the past 16 weeks.


Smart Key Hooks


What are smart key hooks? Or what are key hooks anyway?

Basically they are a place to hang your keys like this:


But for me it is a little more. By looking at it I know who's at home and who not and it is used to exchange important messages between family members:


(The mess is just utensils you want to reach from the doorstep.)

As is it works perfectly, is accepted by the users, has a intuitive user interface and is highly robust to operating errors by the user. Why does it need to be enchanted then? For integration into a SmartHome system and to make it's functions available online. For the challenge I'v decided to concentrate on on the later.


Planed Features

In Smart Key Hooks - Prelude I proposed the following enchantments:

  1. No user interaction necessary besides hanging the keys
  2. RGB-LEDs to display status of the absent persons (i. E. "will come back soon", "away until next day", "at work" ...)
  3. RESTful / IFTTT / Tasker (android) interface

The first feature is needed for user acceptance where the others really add functionality. 3) Provides local, physical functionality to the network and 2) adds information from the "Cloud" back to the physical interface. These are very high-level descriptions of the enchantments which, of course had to be concretised during the challenge.


Optional Features

Since I had no clue how long It could me take to implement the basic features or if I can implement them at all I specified a part of the functionality I would like to have as optional, hoping that everything runs smooth and I will be able to implement them as well.

  1. leaving speech messages which get played when the person respective the key returns
  2. Detection of a specific key ring independent of the hook it was hanged on
  3. Placing "ToDo" lists (on paper) on the board and sending "accepted" messages to listeners when it was removed

Item 1) is a huge enchantment which does not only add a lot of hardware (microphone, speaker, button, memory,...) but also the infrastructure for handling audio and adding a new interface, etc. In 3) I would integrate the second function which the physical hooks serve into the smart version. Detecting the changes on the messages and link push notifications to them. Item 2) was optional because I did not know if there is a feasible solution for identifying the individual key rings. The presence of any key ring could always be detected by a simple switch leaving it to the user to select the correct hook.




While testing various methods to detect and identify key rings which are placed on a hook (Identifying Keys) I found one solution which satisfies the optional feature 2).


By using 1-Wire EEPROM or ID devices inside a key tag I am able to identify individual key tags and thus key rings regardless on which hook they were placed as. In theory (but I haven't tested) this should work even when more than one key tag hangs on each hook since 1-Wire is a bus system. This is necessary for the clean and unchanged user interface of the Smart Key Hooks.

For the status LEDs I identified two options: use the provided Infineon RGB Shield and time division multiplex the output to multiple LEDs (preferred) or to use WS2812B LEDs on the SAMA5D4. In Using the RGB LED Lighting Shield on SAMA5D4 Xplained I found out that Linux does not support 10-bit I2C addresses and therefore abandoned this option as to time intensive.


Then I turned my attention to the second option which turned out to be a learning experience and not less time consuming. Since there was no library available which allowed interfacing with the WS2812 form Linux or the SAMA5D4 I had to find a solution: using PWM hardware to bit bang the required signal (Generating a Mysterious Signal, Use WS2812B on the SAMA5D4 Xplained and More Datasheet Studying). The code compiles but segfaults when I run it on the board. Unfortunately there is no time left to debug it.

The tasker interface was presented in Smart Key Hooks Client. By replacing the client libraries it should be relatively easy to interface to any HomeAutomation system. Combined with home automation Smart Key Hooks would unfold their full power. Possible application would be to check if doors (e. g. the shed door) are locked when the key is returned or if all windows are closed when the last person leaves. That was my idea when I proposed Smart Key Hooks as my entry in the design completion.

To Help the jury to rate this project I will summarize the all achievements:

Proposed Features:



No user interaction necessary besides hanging the keys

RGB-LEDs to display status

RESTful / IFTTT / Tasker (android) interface

Optional Features:


Leaving speech messages which get played when the person respective the key returns

Detection of a specific key ring independent of the hook it was hanged on

Detecting "ToDo" lists (on paper) on the board



WS2812B using PWM hardware
explanation how to use advanced PWM features on SAMA5D4
101 on logic analyser and debugging hardware
sending encrypted push notifications with pushbullet (or any other push service)
explained basics of 1-wire communication
experiments with "das U-Boot" on SAMA5D4
changing the Infineon RGB Shields firmware to accept 7-bit I2C addresses
identified signal lines which I could used as GPIO




In Enchanted Objects Design Challenge - Detailed Information element14 asked to give an assessment of the enchanted object which I will give in the following paragraph.



It is hard to imagine that normal use could destroy the Smart Key Hooks. Wear-out is not an issue here since no moving parts implement any of the enchantments. The most vulnerable part are the key tags. The prototypes easily can break or lose contact. But they can be easily made more resilient by a steel case and embedding the PCB in resin. A production key tag could look like this:


Since contacts of the 1-Wire bus are exposed (hook and back plane) they are exposed to electrostatic discharge (ESD). The devices I used are all protected to 8 kV (IEC 1000-4-2 Level 4) which is enough under normal circumstances. If you have a nylon carpet then you should think about extra protection (for up to 27 kV).

Therefore I can not see any parts which should need to be replaced due to failure for a very long time.


Cost for the whole solution is quite moderate:

PartApproximate Cost in € (per key tag)
Silicon ID (for key tag)1,00
PCB, Passive Components, Resin0,50
Key Tag Case1,00


That's 2,50 € per key ring where 5 to 10 should be enough for a normal household. Cost for the key rings are between 12,50 and 25 €

The real power of the SAMA5D4 Xpalined is not used therefore the cost for the central component can be significantly reduced by using e. g. the Raspberry PI model B which at the moment sells at around 30 €. Further reduction and WIFI connection (which most people prefer over wired LAN) can be archived by using a ESP8266 module which sell at ebay for around 3 €


PartApproximate Cost in €

MCU / Computer / Base Board

(Raspberry PI B)

WS2812B or similar LEDs 10 pcs.5,00
Passive Components1,00

The system cost is 48,50 to 61 €. Using a ESP8266 it comes down to 21,50 to 34,00 € which is really not bad for a smart home component.


The usage is almost exactly as a with the un-enchanted version. Simply hang the key ring on a hook. Only difference is that you have to hang the hole in key tag (like in the photo above). Tasker is not really easy to use but once configured it does its job perfectly. Over all Smart Key Hooks are an easy to use enchanted object.



The presence of key tags is tracked with a selectable time resolution - the interval in which the 1-Wire bus is probed for new nodes can be configured. Smart Key Hooks track the presence of keys, not people. While the a person and his / her key ring normally would correlate this is the window of opportunity for imposture. Like in the very good video Andy Clark (Workshopshed) posted as a comment to one of my blog posts. The while solution is absolutely accurate in detecting the presence of key tags it can be arbitrary wrong in detecting the presence of persons.



Network security basics as hardening (uninstalling unwanted services, secure configuration for the rest, changing default passwords, etc) and placing a firewall in front of the networked Smart Key Hooks is common practice so that I did not blog about it. A very powerful security measure is reducing the attack surface. This is archived by the fact that the server does not offer anything to the Internet but instead subscribes to a Pushbullet channel. Therefore the firewall allows only connections to (and answers from) the Pushbullet server(s). A hacker would have to attack Pushbullet or inject packages into the communication in order to do any harm to the Smart Key Hooks server. Packet injection is made almost impossible by using https.

An other facet of security is privacy. I do not want Pushbullet or anybody who could listen to the data transfers to learn anything about me and my families presence in the house. To archive this the messages sent are AES encrypted. For a small number of clients a pre shared key is a feasible and easy to implement option. The secure channel to transfer the key for the first time is simply to enter it on the mobile device. This is inconvenient but has to be done only once for every device. Further key changes can be sent as a message to the clients (which, of course, is encrypted by the old key). This is not perfect forward secrecy (see https://en.wikipedia.org/wiki/Forward_secrecy) which means that when one key is compromised all future keys are also known to the enemy, but is IMHO good enough. If you suspect that a key is compromised you always can manually set a new key on every client an be safe again. This is feasible only if you have a small amount of clients to which you have a secure channel (i. e. physical access).

Security is covered in more detail in Smart Key Hooks – The Design.

Use of the Project's Results


As is I would use Smart Key Hooks (after ironing out the last problems) for the following:

  • Check if children meet their "curfew"
  • Send reminders based on "leafing" or "returning" conditions (e. g. "don't forget the milk)
  • Send push messages to all persons at home (like "Can anyone please check if I've turned of the electric iron")


In conjunction with smart home / home automation I'd have a lot of use cases:

  • Alerting family members when the leave that not all windows / doors are closed
  • Remind them to take a umbrella if it is going to rain within the next hours
  • Check if shed / garage is locked when they enter the house
  • Turn off outdoor lightning when they enter the house
  • Turn on / off security systems based on presence
  • Automatically operate blinds when nobody is at home
  • ...

Smart Key Hooks will be the first smart home piece in my home which definitely will get smarter over the next years.


The main project results for me are however the knowledge I gained and the nice people I've met. That alone was worth the effort and is the most valuable take away.



Finally allow me to thank to element14 and the sponsors for hosting the competition. It has been a pleasure to take part. And thanks to all those who helped me or where just fun to talk to although some of them also compete in the same challenge (in no particular order):

Andy Clark (Workshopshed), clem57, shabaz, mcb1, jancumps, DAB, balearicdynamics

I hope to see you all again