Ignition System Using Fingerprint And Alcohol Sensor
Step-by-Step Guide:Ignition System Using Fingerprint
Introduction
In this article, we will Explain how to create a bike ignition system using the Fingerprint R307 sensor, And MQ3 Alcohol sensor, With Arduino. This system Controls the car or bike irrigation system if the fingerprint will match then the iration system will start otherwise is not start.
Component Need
S.N | Component | Quantity | Link To Buy |
1 | Arduino Nano | 1 | |
2 | 16×2 LCD Display With I2C | 1 | |
3 | R-307 Fingerprint Sensor | 1 | |
4 | MQ-3 Sensor | 1 | |
5 | 1 channel Relay Module | 1 | |
6 | Push Button | 4 | |
7 | LED | 3 | |
8 | Zero PCB | 1 | |
9 | 9v Power supply | 1 |
Overview
- The project aims to protect the bike and cars to avoid accidents.
- This Project is soo many features, the system Will ensure that only authorized users who have valid fingerprints and are not Drink alcohol can start the bike.
- The project is various hardware and software components included in making the project. The hardware components are Arduino Nano, an R-307 fingerprint sensor module, an MQ-3 alcohol sensor, a 5v one-channel relay module, LEDs, and Push buttons.
- The Arduino Nano board controller and the R-307 fingerprint sensor module captures and verifies fingerprints. The MQ-3 alcohol sensor Find out the alcohol in the vicinity of the bike.
Circuit Diagram
Fingerprint R307 Sensor
- VCC: Connect 5V to the Arduino.
- GND: Connect to GND to the Arduino.
- RX: Connect digital pin 2 to the Arduino.
- TX: Connect digital pin 3 to the Arduino.
- INT: Not connected.
- RST: Not connected.
MQ3 Alcohol Sensor
- VCC: Connect 5V to the Arduino.
- GND: Connect to GND to the Arduino.
- AO: Connect analog input A0 to the Arduino.
- DO: Not used in the provided code.
16×2 LCD Display with I2C
- Connect the I2C data (SDA) and clock (SCL) lines to the corresponding A4 and A5 pins on the Arduino Nano board.
- The I2C backpack usually includes pull-up resistors, so external resistors are not required.
Other Components
- Connect the pins
enroll Push Button (4)
,delPush Button (5)
,up Push Button(6)
,down Push Button(7)
,openLed(8)
,closeLed (9)
,redled (10)
,relay Module (11)
, andAlcohol Sensor (A0)
to the respective digital and analog pins on the Arduino Nano board.
Source Code
Important Library
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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
//Prateek //http://justdoelectronics.com #include <LiquidCrystal_I2C.h> #include <Wire.h> LiquidCrystal_I2C lcd(0x27, 16, 2); #include <SoftwareSerial.h> SoftwareSerial fingerPrint(2, 3); #include <Adafruit_Fingerprint.h> uint8_t id; Adafruit_Fingerprint finger = Adafruit_Fingerprint(&fingerPrint); #define enroll 4 #define del 5 #define up 6 #define down 7 #define openLight 8 #define closeLight 9 #define redled 10 #define relay 11 #define sensor A0 void setup() { delay(1000); pinMode(enroll, INPUT_PULLUP); pinMode(up, INPUT_PULLUP); pinMode(down, INPUT_PULLUP); pinMode(del, INPUT_PULLUP); pinMode(openLight, OUTPUT); pinMode(relay, OUTPUT); pinMode(closeLight, OUTPUT); pinMode(sensor, INPUT); pinMode(redled, OUTPUT); lcd.init(); lcd.backlight(); lcd.setCursor(0, 0); lcd.begin(16, 2); lcd.print(" Welcome To"); lcd.setCursor(0, 1); lcd.print("JustDoElectronics"); delay(2000); lcd.clear(); lcd.print("JustDoElectronic"); lcd.setCursor(0, 1); lcd.print("Prateek"); delay(2000); finger.begin(57600); Serial.begin(9600); lcd.clear(); lcd.print("Finding Module"); lcd.setCursor(0, 1); delay(1000); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); lcd.clear(); lcd.print("Found Module "); delay(1000); } else { Serial.println("Did not find fingerprint sensor :("); lcd.clear(); lcd.print("module not Found"); lcd.setCursor(0, 1); lcd.print("Check Connections"); while (1) ; } } void loop() { float adcValue = 0; for (int i = 0; i < 10; i++) { adcValue += analogRead(sensor); delay(10); //Prateek //http://justdoelectronics.com } float v = (adcValue / 10) * (5.0 / 1024.0); float mgL = 0.67 * v; Serial.print("BAC:"); Serial.print(mgL); Serial.print(" mg/L"); //Prateek //http://justdoelectronics.com if (mgL > 1.3) { Serial.println(" Drunk"); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Driver Drink"); lcd.setCursor(0, 1); lcd.print("Is Not Allowed"); digitalWrite(redled, HIGH); digitalWrite(relay, LOW); digitalWrite(openLight, LOW); //Prateek //http://justdoelectronics.com while (1) ; } else { Serial.println(" Normal"); digitalWrite(redled, LOW); } lcd.setCursor(0, 0); lcd.print("Press UP/Down "); lcd.setCursor(0, 1); lcd.print("to start System"); digitalWrite(closeLight, HIGH); if (digitalRead(up) == 0 || digitalRead(down) == 0) { for (int i = 0; i < 5; i++) { lcd.clear(); lcd.print("Place Finger"); delay(2000); int result = getFingerprintIDez(); if (result >= 0) { digitalWrite(openLight, HIGH); digitalWrite(relay, HIGH); digitalWrite(closeLight, LOW); lcd.clear(); lcd.print("Allowed"); lcd.setCursor(0, 1); lcd.print("Gete Opened "); digitalWrite(closeLight, HIGH); // digitalWrite(openLight, LOW); //digitalWrite(relay, LOW); lcd.setCursor(0, 1); lcd.print("Gate Closed "); return; } } } checkKeys(); delay(1000); } void checkKeys() { if (digitalRead(enroll) == 0) { lcd.clear(); lcd.print("Please Wait"); delay(1000); while (digitalRead(enroll) == 0) ; //Prateek //http://justdoelectronics.com Enroll(); } else if (digitalRead(del) == 0) { lcd.clear(); lcd.print("Please Wait"); delay(1000); delet(); } } void Enroll() { int count = 0; lcd.clear(); lcd.print("Enroll Finger "); lcd.setCursor(0, 1); lcd.print("Location:"); while (1) { lcd.setCursor(9, 1); lcd.print(count); if (digitalRead(up) == 0) { count++; if (count > 25) count = 0; delay(500); } else if (digitalRead(down) == 0) { count--; if (count < 0) count = 25; delay(500); } else if (digitalRead(del) == 0) { id = count; getFingerprintEnroll(); return; } else if (digitalRead(enroll) == 0) { return; } } } void delet() { int count = 0; lcd.clear(); lcd.print("Delete Finger "); lcd.setCursor(0, 1); lcd.print("Location:"); while (1) { lcd.setCursor(9, 1); lcd.print(count); if (digitalRead(up) == 0) { count++; if (count > 25) count = 0; delay(500); } else if (digitalRead(down) == 0) { count--; if (count < 0) count = 25; delay(500); } else if (digitalRead(del) == 0) { id = count; deleteFingerprint(id); return; } else if (digitalRead(enroll) == 0) { return; } } } uint8_t getFingerprintEnroll() { int p = -1; lcd.clear(); lcd.print("finger ID:"); lcd.print(id); lcd.setCursor(0, 1); lcd.print("Place Finger"); delay(2000); while (p != FINGERPRINT_OK) { p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); lcd.clear(); lcd.print("Image taken"); break; case FINGERPRINT_NOFINGER: Serial.println("No Finger"); lcd.clear(); lcd.print("No Finger"); break; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); lcd.clear(); lcd.print("Comm Error"); break; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); lcd.clear(); lcd.print("Imaging Error"); break; default: Serial.println("Unknown error"); lcd.clear(); lcd.print("Unknown Error"); break; } } // OK success! p = finger.image2Tz(1); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); lcd.clear(); lcd.print("Image converted"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); lcd.clear(); lcd.print("Image too messy"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); lcd.clear(); lcd.print("Comm Error"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); lcd.clear(); lcd.print("Feature Not Found"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); lcd.clear(); lcd.print("Feature Not Found"); return p; default: Serial.println("Unknown error"); lcd.clear(); lcd.print("Unknown Error"); return p; } Serial.println("Remove finger"); lcd.clear(); lcd.print("Remove Finger"); delay(2000); p = 0; while (p != FINGERPRINT_NOFINGER) { p = finger.getImage(); } Serial.print("ID "); Serial.println(id); p = -1; Serial.println("Place same finger again"); lcd.clear(); lcd.print("Place Finger"); lcd.setCursor(0, 1); lcd.print(" Again"); while (p != FINGERPRINT_OK) { p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); break; case FINGERPRINT_NOFINGER: Serial.print("."); break; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); break; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); break; default: Serial.println("Unknown error"); return; } } // OK success! p = finger.image2Tz(2); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); return p; default: Serial.println("Unknown error"); return p; } // OK converted! Serial.print("Creating model for #"); Serial.println(id); p = finger.createModel(); if (p == FINGERPRINT_OK) { Serial.println("Prints matched!"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_ENROLLMISMATCH) { Serial.println("Fingerprints did not match"); return p; } else { Serial.println("Unknown error"); return p; } Serial.print("ID "); Serial.println(id); p = finger.storeModel(id); if (p == FINGERPRINT_OK) { Serial.println("Stored!"); lcd.clear(); lcd.print("Stored!"); delay(2000); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_BADLOCATION) { Serial.println("Could not store in that location"); return p; } else if (p == FINGERPRINT_FLASHERR) { Serial.println("Error writing to flash"); return p; } else { Serial.println("Unknown error"); return p; } } int getFingerprintIDez() { uint8_t p = finger.getImage(); if (p != FINGERPRINT_OK) return -1; p = finger.image2Tz(); if (p != FINGERPRINT_OK) return -1; p = finger.fingerFastSearch(); if (p != FINGERPRINT_OK) { lcd.clear(); lcd.print("Finger Not Found"); lcd.setCursor(0, 1); lcd.print("Try Later"); delay(2000); return -1; } // found a match! Serial.print("Found ID #"); Serial.print(finger.fingerID); return finger.fingerID; } uint8_t deleteFingerprint(uint8_t id) { uint8_t p = -1; lcd.clear(); lcd.print("Please wait"); p = finger.deleteModel(id); if (p == FINGERPRINT_OK) { Serial.println("Deleted!"); lcd.clear(); lcd.print("Figer Deleted"); lcd.setCursor(0, 1); lcd.print("Successfully"); delay(1000); } else { Serial.print("Something Wrong"); lcd.clear(); lcd.print("Something Wrong"); lcd.setCursor(0, 1); lcd.print("Try Again Later"); delay(2000); return p; } } |
Video
Conclusion
In this article, we created a bike ignition system for the purpose of security and safety. The system confirms that only authorized individuals with clean alcohol readings can start the bike. This project demonstrates the inclusion the various sensors and modules into everyday devices to provide advanced features and functions.
Arduino Based Projects
Hi bro
I cant clearly see the nano board in circuit diagram
So can u plz send that seperatly to my mail
Plz