


Table of Contents
Description:
RFID based Bike Anti Theft System– This project was designed specifically for the protection of motorcycles. The RFID module is used in this project to secure the bike. In protecting your bike from theft, this project can be really helpful. This design is based on the RFID module MFRC522, Atmega328 and other components of the electronics. The goal of not using the Arduino board itself is to reduce the overall cost of the venture. This project is very simple and can be planned by anyone after reading this article. This is the PCB design image I’m going to explain in a minute. The wiring is transparent, as you can see.
The Amazon Purchase links are given below:
MFRC522 RFID module and tags: best deal: https://amzn.to/2uv54Wb
atmega328 microcontroller: https://amzn.to/2QXUHSa
terminal block connector: https://amzn.to/2tI98le
Arduino Uno: https://amzn.to/39aq6ZT
Mega 2560: https://amzn.to/2SszMsI
lm7805 Voltage Regulator: https://amzn.to/2ERYoTJ
330-ohm resistors pack: https://amzn.to/2Qj1Igg
female DC power jack socket: https://amzn.to/377Pg9M
470uf capacitors: https://amzn.to/2MrN3xR
5×7 cm Vero board: https://amzn.to/37b7KWO
female headers: https://amzn.to/350w6RE
connection wires: https://amzn.to/2MvOJXd
Super Starter kit for Beginners: https://amzn.to/398dliF
Jumper Wires: https://amzn.to/2SrnBwo
Bread Board: https://amzn.to/2MxV5FM
12v Adaptor: https://amzn.to/2MuOlZk
PCB plate: https://amzn.to/2MuwNMB
Variable Supply: https://amzn.to/39d0KdP
Digital Multimeter: https://amzn.to/34WbVoa
Vero Board / stripboard: https://amzn.to/39nL9Zg
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2PVwexF
Solder wire: https://amzn.to/2QlOvTS
Wire Stripper: https://amzn.to/353tYJa
wirecutter: https://amzn.to/2tV2lFj
PCB small portable drill machine: https://amzn.to/2MvQqnx
DISCLAIMER:
Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!
Then I sent my PCB Gerber files to the company Wellpcb and ordered 50 pcbs. It’s the pcbs.
Properly documented with all the pcbs information. The quality is really great, as you can see. I’m 100% happy with their work.
Download this PCB board: bike anti theft pcb
PCB connections explanation:
Starting with the power supply, this is the terminal block where the 12v and GND are connected. wires. The 1n4007 diode is connected to protect the circuit if the wires are connected in an incorrect manner. The 7804 voltage regulator input pin is connected to the diode’s cathode side. The ground is connected to the 7805 voltage regulator’s middle pin.
A 330-ohm resistor is connected with the output of the regulator, this resistor is connected in series with the led anode side, this is a current limiting resistor, the other leg of the led is connected with the ground. A 10uf capacitor is also connected at the output of the voltage regulator.
A 10k resistor is connected with pin number1 of the atmega328 controller and the other side of the 10k resistor is connected with the 5v. Pin number 7 also connected to the 5v of the controller. Pin number 8 of the controller is connected with the ground. A 16Mhz crystal is connected with pin9 and pin10 of the controller. 22pf capacitors are connected with the 16Mhz crystal.
Pin number11 which is the digital pin5 is connected with the 10k resistor, and the other side of the 10k resistor is connected with the base of 2n2222 NPN transistor, the emitter is connected with the ground, while the collector is connected with the ground pin of the buzzer. This transistor will be used to control this buzzer.
While the positive pin of the buzzer is attached to the 5v. Pin number12, the digital pin6, is used to power a relay. The emitter is connected to the surface while the collector is connected to one side of the relay coil and 12v is connected to the other side of the relay coil. After the calculations, this transistor is chosen. A diode is connected with the relay coils for the back emf protection. At the relay output a terminal block is connected. Digital pins 13 and 9 of the Arduino are connected to the RFID module MFRC522. That’s it, therefore.
All the components are Soldered:
MFRC522 RFID Module:
This is the RFID unit I used in this project for MFRC522. You will know how to read the identity numbers of the RFID tags before using this RFID unit.
RFID based bike anti-theft Programming:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
/* ----------------------------------------------------------------------------- * Pin layout should be as follows: * Signal Pin Pin Pin * Arduino Uno Arduino Mega MFRC522 board * ------------------------------------------------------------ * Reset 9 5 RST * SPI SS 10 53 SDA * SPI MOSI 11 51 MOSI * SPI MISO 12 50 MISO * SPI SCK 13 52 SCK * voltage 3.3v */ #include <SPI.h> #include <MFRC522.h> #define SS_PIN 10 #define RST_PIN 9 MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance. int relay = 6; int flag = 0; int buzzer = 5; int relaystate = 0; void setup() { Serial.begin(9600); // Initialize serial communications with the PC pinMode(7,OUTPUT); pinMode(relay, OUTPUT); digitalWrite(relay, HIGH); pinMode(buzzer, OUTPUT); digitalWrite(buzzer, LOW); digitalWrite(7,LOW); SPI.begin(); // Init SPI bus mfrc522.PCD_Init(); // Init MFRC522 card //Serial.println("Scan a MIFARE Classic PICC to demonstrate Value Blocks."); } void loop() { relaystate = digitalRead(relay); // Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory. MFRC522::MIFARE_Key key; for (byte i = 0; i < 6; i++) { key.keyByte[i] = 0xFF; } // Look for new cards if ( ! mfrc522.PICC_IsNewCardPresent()) { return; } // Select one of the cards if ( ! mfrc522.PICC_ReadCardSerial()) { return; } // Now a card is selected. The UID and SAK is in mfrc522.uid. // Dump UID Serial.print("Card UID:"); for (byte i = 0; i < mfrc522.uid.size; i++) { // Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "); // Serial.print(mfrc522.uid.uidByte[i], DEC); } Serial.println(); // Dump PICC type byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); // Serial.print("PICC type: "); //Serial.println(mfrc522.PICC_GetTypeName(piccType)); if ( piccType != MFRC522::PICC_TYPE_MIFARE_MINI && piccType != MFRC522::PICC_TYPE_MIFARE_1K && piccType != MFRC522::PICC_TYPE_MIFARE_4K) { //Serial.println("This sample only works with MIFARE Classic cards."); return; } // defining Cards here if( ((mfrc522.uid.uidByte[0] == 192) && (mfrc522.uid.uidByte[1] == 47) && (mfrc522.uid.uidByte[2] == 254) && (mfrc522.uid.uidByte[3] == 121))) { digitalWrite(relay, !relaystate); // Serial.println(relaystate); delay(2000); } if((relaystate == 0)&& (flag == 0) ) { // Serial.println("led on"); digitalWrite(buzzer, HIGH); delay(500); digitalWrite(buzzer, LOW); delay(500); digitalWrite(buzzer, HIGH); delay(500); digitalWrite(buzzer, LOW); delay(500); digitalWrite(buzzer, HIGH); delay(500); digitalWrite(buzzer, LOW); delay(500); flag = 1; } if((relaystate == 1)&& (flag == 1) ) { // Serial.println("led off"); digitalWrite(buzzer, HIGH); delay(500); digitalWrite(buzzer, LOW); delay(500); flag = 0; } else Serial.println("unregistered user"); } |