SingLock is a pitch-based security system based on ATMEL MEGA1284P microcontroller featuring two password protection stages: one based on a 4-digit numeric personal identification number inputted via the keypad and another based on two pitches inputted via the microphone.

Most security systems we find today are keypad and/or keyboard-based. Speech, rather than button-pressing and/or typing, is however the main means of communications for most people. It is therefore intuitive to have speech as the basis of encryption when considering human usability factors and ease-of-access. Consequently, we developed SingLock. SingLock’s password detection scheme maintains a user’s voice signature so that an eavesdropper who knows both the user’s personal identification number and the passkey pitch cannot easily unlock the system. SingLock’s sound-based security system also does not leave residues, such as heat signatures on a keypad after a button press, that may make the system vulnerable to penetration by outsiders. SingLock hence is relatively more secure than average keypad and/or keyboard-based systems. The minimalist design and the keypad, microphone, and liquid crystal display (LCD) user interface makes the system easy to use for a wide range of users.

High Level Design


Microcontrollers are used widely in contemporary security systems. For our final project, we wanted to build our own microcontroller-based security system with an added human speech-based encryption and decryption scheme by combining our shared interests in both security and signal processing. Given the limited computational power of the ATMEL MEGA1284P microcontroller, we simplified the sound-based component of our system from speech and voice recognition to pitch recognition, based on frequency peaks of the input sound.

Logical Structure

SingLock is comprised of three main components. The first component is the keypad and LCD screen that serves as the main user interface of the system. Using the keypad, the user must follow the instructions provided on the LCD screen in order to lock and unlock the system correctly. The second component is the analog audio input signal processing. We amplify and band-pass filter the microphone input signal in order to remove noise using a single op amp circuit. This preprocessed analog audio input signal is sampled by the Analog-to-Digital Converter (ADC) of the microcontroller for postprocessing. Both the LCD and the set of two LEDs serve as indicators of the system’s lock state. Initially, both the red and green LEDs are lit. When the system is locked correctly, only the red LED is lit. When the system is successfully unlocked, only the green LED is lit. The figure below shows the high-level logical structure of the SingLock system without the keypad and LCD screen.

The user’s sung pitch is recorded by the microphone. The analog acoustic input signal is then amplified and filtered to remove ambient noise. The amplified and filtered signal is then sampled into a digital signal by the ADC of the microcontroller. We then take the FFT of the sampled signal and match peaks to the stored peaks in the passkey in the frequency domain. If a predefined number of stored peaks in the passkey are found in the stored frequency peaks of the microphone input signal, the system unlocks. Otherwise, it remains locked.

SingLock is built on a few fundamental concepts in signal processing, namely sampling theory and frequency domain analysis of audio signals. Sampling is carried out so that the system operates at a reasonable range of frequencies. Peak-matching calculations performed at every attempt to unlock the system is carried out using the Fast Fourier Transform (FFT) algorithm. We review these signal processing fundamentals in the next section.

Mathematical Background

The pitch-based security system relies on matching a predefined set of magnitude peaks in the frequency domain to the frequency peaks of the sampled analog microphone input sound. We sampled the analog microphone input sound at 4kHz, which provided us with up to 2kHz in usable frequency range without aliasing, according to the Shannon-Nyquist Sampling Theorem. An average person can generate acoustic sounds that range from about 100Hz up to about 1200Hz in frequency. Therefore, we selected a sampling rate of 4kHz, which provided us with a reasonable upper frequency limit of 2kHz for the input sound.

Frequency peaks were calculated by taking the Fourier transform of the sampled digital signal and calculating the magnitudes of the Fourier transform coefficients. The Fourier transform of a signal returns a set of coefficients that collectively represent the signal’s energy distribution across a range of frequencies. Because our system is digital, we carry out the Fourier transform operation for discrete signals, known as the Discrete Fourier Transform (DFT). The DFT takes an N-point signal and computes the Fourier transform, returning an array containing N coefficients with each bin representing a frequency range and each coefficient in a bin representing the energy present at the corresponding frequency range. The N-point DFT is defined as follows:

About The Author

Scroll to Top