XMC2Go Design Challenge: WhistleKey – the smart key ring

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
XMC2GO Design Challenge 2014 Italy – Results Report


The aim of the project is to develop a control system with very compact size, able to be inserted in a conventional keychain. If you whistle, or if the key ring stays away from the owner for more than 10 minutes (approximately), the keychain will start flashing (thanks to the two LEDs integrated on the XCM2GO board) and will play a sound in order to facilitate its localization.


Whistle detection

Software
The are two main suitable solutions for the whistle detection are two: autocorrelation and spectrogram analysis. Both methods can be implemented on the XMC2GO. Spectrogram analysis is the most reliable method for the detection of a well-defined whistle, but is also the most hexose in terms of computing power. XMC2GO allows to perform the sampling of the analog signal up to 40 kHz without any problems, and the processor has enough RAM to run the algorithm with a resolution of 40~70 Hz. The most common algorithms for obtaining a signal Fourier transform, a mandatory task in order to analyze the frequency of the whistle to be detected, are the Cooley-Tukey algorithm and the Hartley algorithm; for our purposes, they are equivalent.
Once the frequencies spectrum has been achieved, a pitch detection algorithm shall be run (this algorithm identifies the fundamental frequency of a given sound). The most suitable is the maximum likelihood algorithm, which makes a simple comparison between the spectrum of a sample stored in memory (the original whistle must be stored during programming into the XMC2GO) and the sound picked up by the microphone. This method offers a good compromise between power consumption (in terms of energy and thus battery life), responsiveness (the time the keychain needs to "identify" the master's whistle and play the sound) and reliability (not to play when the microphone picks up sounds different from the original whistle and react when it picks up the right whistle).

Hardware
In order to capture the audio signal is requested a suitably amplified microphone. MAX4466 is an electrolytic microphone featuring small size and offering an excellent amplification (at least for our purposes).


“Removal” detection

Software
The Bluetooth module programming is quite simple since many Open Source libraries suitable for this purpose are already available on the web. Several apps suitable for interfacing with the chosen Bluetooth module are also available (we will later explain in detail what they serve for). Our board will look for nearby Bluetooth devices every 5 minutes (the frequency was chosen to optimize the battery life) and, in case it did not find our phone, it will start a 5 minutes timer after which it will activate both audible and visual alerts. If the need is to develop a minimal WhistleKey, there is no need to install an app on the smartphone: it is enough to program the XCM2GO so that it saves the names of the first N Bluetooth devices discovered during its first power on. Obviously, only our smartphone with the Bluetooth turned on must be in the keychain area. In case it is not possible to be sure of that, we could control the power level of the received signals, in this way, just the device with the strongest signal can be considered (therefore you will need to keep the key ring close to the phone during the initialization phase).
For instance, by using he Nordic Android nRF UART application it will also be possible to remotely control the keychain making it playing a sound on command, checking the residual battery power, or checking other functionalities (the XCM2GO has 5 free pins that can be used to add functionalities to our keychain).

Hardware
In order to detect the if the owner is far from it, we have chosen the BLE nRF8001 Bluetooth module, which is compact, low power consumption, wide range (in the order of meters) and compatible with iPhone and Android smartphones.


Playing acoustic and visual warning

Software
Depending on the chosen buzzer it is advisable to select the tone that features the highest power and set up the playback to be intermittent. LEDs will also be lit intermittently, choosing an interval between 500 and 200 ms (so as to achieve maximum visibility).
Note: it is important that the microphone is muted during playback of the sound wave.

Hardware
For playing the sound wave a speaker or a simple buzzer directly attached to a pin could be used. The latter solution provides a very powerful sound signal and a minimal power absorption. As regards the visual signal, the LEDs integrated on the XMC2GO are more than enough to generate a good brightness.
1148.attach


Power supply

Hardware
The best solution to achieve a WhistleKey very small in size is to use four 1.2V button cells (Varta MBU20 NiMH) to reach a voltage of 4.8V, able both to power without problems the system and to ensure a very compact design. However, this solution is also the one with less autonomy; you can choose various types of batteries with different size and amperage, voltage reference are 1.2, 2.4 and 4.8 V. By using the most compact solution, the achieved autonomy is approximately 20 hours, but it is easily rechargeable via the built-in XMC2GO microUSB. It would also be possible to use a small lithium cell, but it will need a step-up circuit and a dedicated circuit for battery recharging, thus affecting the overall compactness (but it would ensure a high level of autonomy).
0 Likes
0 Replies