My Arduino fun projects: Part2: (UPDATED: with full code and schematics): Fingerprint scanner for exam roomsteemCreated with Sketch.

in technology •  8 years ago 


This is an UPDATE for My Arduino fun projects: Part2: Fingerprint scanner which enrols and authenticate users then takes a picture and uploads it to Dropbox to include all the coding and schematics.


I will breakdown the project into fewer parts and conclude by combining all the parts as a final design.

Parts to be discussed:


LMB162G - LCD

I used a sixteen characters by two rows (16 x 2) LMB162G LCD display.

Wiring:

Code:

Note: To configure LCD in coding LiquidCrystal (rs, enable, d4, d5, d6, d7) therefore LiquidCrystal lcd(12, 11, 5, 2, 3, 4)


Fingerprint scanner


Image credit
You can store up to 1000 finger prints on the on board memory.

Wiring:



Code:

There are two sketches:

More information:
Wiring and specification: https://www.adafruit.com/products/751
Library: https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library


ATMega328

I used ATMega328 (Arduino UNO) because I had problems getting the finger print working on the YUN but it can be included. ATMega is connected on top of Arduino YUN pins as a shield. When a finger is successfully authenticated pin 13 will turn from HIGH (1) be LOW (0) which is directly connected to the YUN. The YUN will then start with the process of taking a photo. Once that photo has been uploaded to Dropbox the YUN will then turn pin 13 back to HIGH (1) for the servo to open for a sort delay.


Arduino YUN


Arduino YUN is based on the ATmega32u4 microcontroller and also the Atheros AR9331 processor which support Linux (OpenWRT) therefore you can run your powerful Python scripts. There is a built in WIFI and also Ethernet to connect to the internet, a slot for a micro SD card and USB port (which I used to connect a USB webcam).

Connecting Yun to the internet via Wifi

I simply connected to the Yun Wifi with my computer and ensured the computer its on dynamic IP not static IP and you need find the Yun IP under Wifi properties if the standard IP (192.168.240.1) is not working and password is arduino.

Image credit

Select configuration:

Image credit

Under Wifi parameters select your Wifi hotspot:

Image credit
Then configure & restart...the Yun will then connect to the selected hotspot/router after restarting.

Installing the USB Webcam and drivers:


Image credit

I choose a Logitech USB camera (most of them will still work) but it must be compatible with the USB Video Class (UVC) protocol.Here is a list of compatible cameras:

Image credit
Also insert the micro SD into the Yun.
I used Putty to SSH into the Linux side of the Yun. I simply connected to the Yun Wifi with my computer again using its standard IP (192.168.240.1) .

Image credit
Note: standard logins: root and password is arduino
Install the following:
Update your Yun

  • opkg update
    Install UVC camera drivers
  • opkg install kmod-video-uvc
    Install fswebcam to take pictures
  • opkg install fswebcam
    Install mjpg streaming library
  • opkg install mjpg-streamer

You can now manually take a sample photo:
Simply go to the SD card folder:

  • cd /mnt/sda1
    Then take the picture and store it in the SD card (but note photo going to Dropbox must be converted first to Base64,will be explained):
  • fswebcam name.jpg

Temboo and Dropbox

To upload photos to Dropbox I used Temboo.
Under Temboo choreos select: Dropbox, FilesAndMetadata, UploadFile and simply follow the simple steps.
At the end you need to obtain (which you cannot share with anyone):

  • yourTembooUsername
  • yourTembooAppName
  • yourTembooKey
  • yourappSecretKey
  • youraccessTokenKey
  • accessTokenSecretKey
  • yourappKey

The original Arduino Yun and Python scripts can be found on Github https://github.com/openhomeautomation/arduino-yun-camera which I modified for my project and also the Temboo Python SDK libraries.

The Temboo Python SDK must be placed in the SD card of the Yun with a folder "temboo".

Full explanation of the Python script and Yun sketch:
https://learn.adafruit.com/wireless-security-camera-arduino-yun/software-configuration


Servo


Image credit
Servo motor is representing a Electronic Entry Gate. Once the photo has been taken an successfully uploaded to Dropbox the servo will open for a second (desired delay) then closes again.

Image credit
Safety measures can be added like an Infrared led (IR) and sensor (IR receiver) to check if the person has passed then closes the servo immediately (back to the original position).

Wiring:

Code:


Final sketch:

Final coding is just combination of all the codes explained above.

Arduino UNO (ATMega) Fingerprint sketch (it is too long its posted on Github):
https://github.com/Yapele/Fingerprint-scanner-for-exam-room/blob/master/finger_lcd_access/finger_lcd_access.ino
Note I added a switch in order to move between the Fingerprint "enroll" and "authentication". It helps a lot to avoid uploading the "enrolling" sketch first to register a fingerprint then upload the "authentication" sketch to give access.

Arduino Yun sketch:


Python script (do not share your original login keys):

The full Arduino sketches have been uploaded on Github

Feel free to use it and have fun with it

Kindly upvote and follow me: @mokluc….I will upload another project soon: My Arduino fun projects

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!