I originally wanted to create a theft prevention device for laptops. Whenever I left my laptop sitting on a desk at the library while I went to the bathroom or got a coffee, I felt a strong sense of paranoia that it might be stolen. I discussed this potential project with a friend, and he told me he couldn't relate to that experience. However, he could relate to the fear of his bike being stolen. This got me thinking, so I decided to research the available bike locks.
I quickly discovered that the options were quite lackluster. Even the most advanced bike locks used Bluetooth instead of Wi-Fi, meaning their range was very limited. I decided to create my own bike lock using Wi-Fi.
Prototypes
I created multiple prototypes over the course of 1 and a half months. The first one was created using an accelerometer paired with an Arduino simply to test the feasibility of this project. Whenever the accelerometer sensed that it had been moved excessively a light would turn on in conjunction with a beeper.
In order to give the lock WIFI capabilities I needed to transition from an ATMega328 on the Arduino to a different microcontroller. I decided to got with the ESP32S3. Alongside this decision I decided to use I2C communication instead of SPI. The electromagnet is the locking mechanism and the microcontroller is connected to an app which notifies the user when the accelerometer has been moved too much (indicating theft).
This is the complete prototype. It featured a camera which allowed the user to watch a video stream from the bike lock remotely. The red LED indicates that the camera is filming. The white LED is turned on in Night Mode so that the camera has enough light to film at night. Just like the previous two iterations it is connected to an app which gives the user a notification if there is a threat of theft.
The app was created using Blynk, an IoT platform. There is a button to turn the bike lock on. This turns the locking mechanism on (the electromagnet) as well as the acceleromater. Bike Status flashes on and off if there is a credible theft risk. Bike Status only flashes when the bike lock is on. The button below these two allows the user to view a live web stream being filmed on the bike lock. I felt like having access to this would put owners at greater ease, increase the possibility of perpetrators being caught, and deter those who want to steal. Finally, the night mode button at the bottom turns the white LED on allowing the camera to film at night.
Schematic and PCB Design
This schematic used an ADXL345 for the accelerometer and an ESP32D instead of an ESP32S3 due to issues finding the correct footprint in KiCad.
The biggest issue in the PCB design was attempting to minimize the size of the PCB so that a battery and electromagnets could be included. The holes created for some of the LEDs are intended for electromagnets.
The type of bike lock I created is very unique and far more effective than the industry standard. As mentioned, most bike locks use Bluetooth meaning the average range is only 10 meters making them almost useless. On the other hand because my bike lock connects to Wi-Fi it can connect to the user anywhere across the globe. For whatever reason even if the user doesn't have access to Wi-Fi and only has their hotspot, the lock still has a range of about 45 meters.
Secondly, the video stream functionality is revolutionary considering that I have never seen it before on a product in this category. This is surprising considering that security cameras are proven to decrease crime by about 50%.