James Coates

Computer Science student. Sydney, Australia.


← Back to projects

Smart Door Lock, a Voice-Controlled IoT Project

· James Coates

The Smart Door Lock was a home-made IoT door lock I built in high school. It combined voice recognition with smartphone control so a spoken passphrase or a tap on my phone could release the lock. I don't use it these days, but it was one of the first projects where I had to make hardware, software and security decisions all fit together, and I learnt a lot from it.


What It Did

The idea was to replace a key with something more convenient without pretending convenience and security are the same thing. I designed the physical locking side as well as the software that sat behind it.


How It Worked

Hardware

A Raspberry Pi was the brain of the system. It handled the audio input, ran the passphrase check and switched the lock through a GPIO relay. Running the speech side locally on the Pi kept the important decisions on the device instead of depending on a remote server.

A microphone captured audio for the voice side, and the relay meant the Pi only ever switched a signal rather than powering the lock directly. I also planned for the obvious failure cases, like keeping a physical key as a manual override in case the power or the Pi went down.

Software

The core logic was written in Python, using speech recognition libraries to turn audio into text and then compare it against the stored passphrase. Getting a recent enough Python onto the Pi meant compiling 3.11 from source, which I wrote up in Compiling Python 3.11 from Source on a Raspberry Pi.

The service ran headless under tmux so it kept going after SSH disconnected, and a cron job started it again on boot. Small Bash scripts handled routine maintenance.


Security Considerations

A door lock is security-critical by definition, so a lot of the project was spent thinking about how it could be attacked rather than just how it should work.

Working through these properly is a big part of why I ended up studying security engineering.


Development Process


Technology Stack

Hardware

Software


What I Took Away From It

The lock worked well enough to prove the idea, and building it taught me far more than reading about IoT security would have.

It's retired now, but a lot of what I do in my home lab and at university traces back to this project.

Project link: https://github.com/nexuspcs/IST-Smart-Door-Lock


← Back to projects