ESP32

Anti Theft System for Bikes using ESP32 and BLE (Bluetooth Low Energy)

Bike Anti Theft System:

Anti Theft System for Bikes using ESP32 and BLE (Bluetooth Low Energy) – Today, we are going to make the most versatile and affordable Bike Anti theft system. There is a reason why did I make this bike anti-theft system.

how to create ble bluetooth low energy bike Anti Theft system using esp32




According to the FBI report on 25th Jan 2024; an average of 175000 bikes are reported stolen in the United States of America every year. More than 3 million bikes are stolen in Europe and about 70,000 bikes are stolen in Pakistan every year.

In every country, thousands of bikes are stolen every day. Because, it’s easier to steal a bike compared to other vehicles. And in some cases, bikes are stolen at gunpoint too.

It doesn’t matter if they steal a bike from the parking or snatch it from you. My designed Bike anti-theft system will work in both cases. Let me practically demonstrate this for you first and then I will explain how to make it.

So, without any further delay, let’s get started!!!

Amazon Links:

ESP32 WiFi + Bluetooth Module (Recommended)

Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.

bike Anti Theft project using esp32

I have arranged this old bike to work on projects related to bikes because it’s going to be a long series. Moreover, eventually, I plan to modify it into an electric bike as well.



You know, to start the bike, simply turn on the Switch, and then fold out the kick-start lever. Put your foot on the lever and tread down sharply.

Now you might be wondering, if thieves don’t have the bike’s key, how do they start the bike so easily? Let me share with you the 4 most common methods that thieves use to steal a bike in no time.

  1. Expert thieves can use any kind of pointed object to open a lock, as you might have seen in movies. However, it requires special skills and a lot of practice to open a lock in less than 2 minutes. Therefore, the majority of thieves do not use this technique. I have personally been trying for the last 30 minutes, but I couldn’t do it. So, that’s when method 2 comes into play.
  2. For this method, no skills are required; even a kid can do it. All you need is some sort of metal object, like a screwdriver. Insert it into the bike’s switch and turn it with force.

Control the bike switch from application to activate Anti Theft

Right now, the switch is useless because the switch’s mechanical system has been completely destroyed. Now, I can use anything to turn ON the switch. I myself used to apply this method whenever I would lose the key. So, this is how thieves can steal your bike in less than 10 seconds.

  1. Method 3 is employed only when the bike won’t start even after shorting the switch. Usually, at this point, thieves run away because they don’t have much time to open the casing and bypass the security system. But let’s imagine they open the casing. Now, you might be wondering what they do with the security system. Well, the thief disconnects the battery wires, which makes the security system useless; this is the case when a cheap anti theft system is installed. Anyway, when the battery wires are disconnected, the bike’s kick-start lever cannot be used to start the bike. So, to start the bike, the thief or another person will have to quickly push the bike. This is similar to what we do when the battery is damaged or completely discharged.
  2. Method #4 is not common, but there are still thousands of cases registered around the world where thieves have snatched bikes at gunpoint. In a situation like this, you have no other option but to hand over the bike to the thief and your bike is gone forever. I don’t know if you are lucky enough to fall under the category of those less than 10% of people who get their stolen bike back after a long, tedious process.

If you don’t want your bike to be stolen by any Tom Dick and Harry so easily. Then you need to spend a few bucks on your bike security. My designed Bike anti theft system is quite affordable and user-friendly. Let me practically demonstrate this for you. And let me also tell you this is the version 1. The upcoming versions will blow your mind. So, consider subscribing if you don’t want to miss my upcoming videos and articles.



esp32 bike Anti Theft system installation

I have installed the Bike Anti-theft system and right now it’s not active. So, I can just go ahead and start the Bike. “For the practical demonstration; watch the video tutorial given at the end of this article”.

Now, I am going to activate the Anti-theft mode and for this I am going to use my designed BLE application.

esp32 bike Anti Theft system using ble

And now let’s try all those 4 methods. I recommend you should watch my video for the practical demonstration.



Method #1 and #2:

Method #1 and #2 are similar because they both involve turning the switch ON. So, it doesn’t matter if the thief uses the actual key, a pointed object, or a screwdriver.

Due to the activated anti-theft mode, the bike won’t start, even if they use the bike’s actual key.

Method #3:

Let’s try bypassing the security system by disconnecting the battery wires.

bike Anti Theft security system control from ble application

The battery wires have been disconnected and the switch is already ON. So, let’s give it a push and see if the Bike is going to start.

It didn’t start because once the anti-theft mode is activated it can’t be reset. They will have to completely remove the controller board and rewire the connection. This might not be possible for majority of the thieves.




Method #4:

Let me de-activate the anti-theft mode to demonstrate the gunpoint situation.

bike Anti Theft ble application

When you stop the bike turn off the switch if possible, handover the key or leave it in the switch, get off the bike and pretend you are afraid and run away. While they start the bike and try to run away, quickly take out your cell phone and open the application, it will automatically connect to the controller and activate the anti-theft mode from a safe distance.

bike Anti Theft system using smart app

The Bike will stop and then they will have no other option except running away.

Now, let’s go through the hardware and programming.

esp32 Anti Theft project for bike

This is my ESP32 WiFi + Bluetooth based development board which I used as an anti-theft system. You can power up this board using 8 to 25V power source and at the output it gives you regulated 5 volts to safely power up the ESP32 board and the 5V SPDT type relay. If you also want to make the same development board then you can read my previous article. In that article, I have explained the circuit diagram, PCB designing, soldering, and lots of other things.



Bike anti theft Programming:

Don’t worry about the libraries; because all these libraries are automatically installed when you install the ESP32 board. For installing the ESP32 board, you can read my getting started article on the ESP32.



During the practical demonstration, you observed that when the anti theft system was activated, it could not be reset without the application. This functionality was made possible by the integration of the EEPROM.

bike Anti Theft application designed in android studio

This is the BLE application, and it is compatible with all types of Low Energy Bluetooth modules, including the ESP32 onboard Bluetooth module, Bluetooth 4, Bluetooth 5, and beyond. It’s impractical to share its APK file with you because in that case, there would be no security at all if everyone used the same commands. Instead, I suggest visiting my Patreon shop and downloading the source code of this BLE application. You can then add your Bluetooth module’s unique address in the application and set a strong password to activate and deactivate the anti-theft mode. This way, nobody would be able to connect to your controller.

If you have any questions, feel free to ask in a comment. So, that’s all for now.



Watch Video Tutorial:

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button