Basics project 056b ESP8266 ESP-12E module, DY50 Fingerprint sensor, 3.3VDC relay – fingerprint lock system


Basics: Project 056b

Project name:  ESP8266 ESP-12E module, DY50 Fingerprint sensor, 3.3VDC relay – fingerprint lock system

Tags: Arduino, ESP8266 ESP-12E module, Nodemcu v3, Lolin, DY50, Fingerprint sensor, 3.3VDC relay module, buzzer

Attachments: enroll sketch, relaycontrol sketch, library1, library2

In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):

1. Arduino IDE ( you can download it from here  )

2. Jumper cables  F-F, F-M

A6 GSM GPRS module

3. Micro USB cable 1 pc

A6 GSM GPRS module

4. ESP8266 ESP-12E module with micro USB cable 1pc

A6 GSM GPRS module

5. Active buzzer 1 pc

active buzzer

6. Breadboard 1 pc

breadboard

7. 3.3 VDC relay module 1 pc

3.3 vdc relay module

8. DY50 Fingerprint sensor 1 pc

fingerprint sensor

General

We will learn how to build the Biometric Door Lock using Fingerprint Sensor, 3.3VDC relay module and ESP8266 ESP-12E module.

Understanding the Fingerprint sensor

You can read more about it here.

Understanding the relay module

You can read more about it here.

Understanding the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)

You can read more about it here.

Signals and connections of the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)

A6 GSM GPRS module

TX – transmit pin. GPIO pin

RX  – receive pin.  GPIO pin

3V3 (or 3V or 3.3V)- power supply pin (3-3.6V). 

GND ( or G) – ground pin.

RST – reset pin. Keep it on high (3.3V) for normal operation. Put it on 0V to reset the chip.

EN – Chip enable. Keep it on high (3.3V) for normal operation.

Vin – External power supply 5VDC.

D0-D8 – GPIO (General Purpose Input Output) pins 

D5-D8 – SPI interface

D1-D2– I²C/TWI Interface

SC (or CMD) – (Chip Select) – the pin that the master can use to enable and disable specific devices. GPIO pin

SO (or SDO) – Master In Slave Out (MISO) – SPI communication. The Slave line for sending data to the master. GPIO pin

SK (or CLK) – SCK (Serial Clock) – SPI communication.The clock pulses which synchronize data transmission generated by the master. GPIO pin

S1 (or SD1) – Master Out/Slave In (MOSI). SPI communication. The Master line for sending data to the peripherals. GPIO pin

S2 (or SD2) – GPIO pin

S3 (or SD3) – GPIO pin

VU (or VUSB) – external power 5VDC.

A0 – ADC output.

RSV – reserved

Signals and connections of the relay module

We use normally closed configuration. You can read more about it here.

It has three pins: VCC -3.3VDC power supply pin, Gnd (G) – ground pin, In1 – signal input pin and terminal block with 3 connections: NO – normally open, NC – normally closed, C – common.

Signals and connections of the Fingerprint sensor DY50

GND– ground pin, RX -receive pin used for serial communication, TX – transmit pin used for serial communication, 3V3 – power supply pin 3.3VDC

Signals and connections of the active buzzer

Active piezo buzzer pin marked with (+) sign should be connected to Nodemcu board digital pin which sends a signal, the other pin of active piezo buzzer should be connected to Nodemcu board GND.

Wiring

FINGERPRINT SENSOR

Fingerprint sensor Nodemcu 1.0

GND G (GND)

3V3 3V (3V3)

RX D8 (GPIO15)

TX D7 (GPIO13)

Nodemcu 1.0 3V3 relay module

G (GND) GND

3V VCC

D1 (GPIO5) In1

Nodemcu 1.0 Active buzzer

G (GND) –

D2 (GPIO4) +

Step by Step instruction

1. Adding ESP8266 platform to Arduino IDE

The Arduino environment has to be set up to make it compatible with the ESP8266 ESP-12E module. We are using PC with Windows 7 64 bit OS.

Download and install the Arduino IDE. You can download it here 

Open Arduino IDE. 

Open the Preferences window from the Arduino IDE. Go to File -> Preferences.

A6 GSM GPRS module

Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field and click the “OK” button. If you already have a URL in there, and want to keep it, you can separate multiple URLs by placing a comma between them. (Arduino 1.6.5 added an expanded text box, separate links in here by line.)

A6 GSM GPRS module

Open Boards manager. Go to Tools -> Board -> Boards Manager…

A6 GSM GPRS module

There should be a couple new entries in addition to the standard Arduino boards. Look for esp8266. or scroll down to the ESP8266 entry (usually at the bottom). Select the ESP8266 entry. When you click it an install option will appear. Select the latest version and click install

A6 GSM GPRS module

The board definitions and tools for the ESP8266 include a whole new set of gcc, g++, and other reasonably large, compiled binaries, so it may take a few minutes to download and install (the archived file is ~110MB). Once the installation has completed, an Arduino-blue “INSTALLED” will appear next to the entry.

A6 GSM GPRS module
A6 GSM GPRS module

2. Uploading sketch to ESP8266 ESP-12E development board

If you’re using an ESP-12E NodeMCU Kit, uploading the sketch is very simple, since it has built-in programmer. 

Before use ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3), you need to download the manufacture’s driver (CH340)  for this chip and install it in your PC. Here is the link. See the description of driver installation package below: CH340 / CH341 USB to serial WINDOWS driver installation package that supports 32/64 bit Windows 10 / 8.1 / 8/7 / VISTA / XP, SERVER 2016/2012/2008/2003, 2000 / ME / 98, through Microsoft digital signature authentication, support USB to 3-wire and 9-wire serial port, with the product release To the end user. Applicable scope: CH340G, CH340C, CH340B, CH340E, CH340T, CH340R, CH341A, CH341T, CH341H chips.

If you have CP2102 chip then  you need to download the manufacture’s driver for this chip and install it in your PC. Driver for MacWindowsLinux or more.. 

  1. Do wiring.
  2. Open Arduino IDE.
  3. Plug your ESP8266 ESP-12E module into your PC USB port.
  4. Choose your NodeMCU board. Go to Tools -> Board -> NodeMCU 1.0 (ESP-12E Module)
  5. Select the correct com port.
  6. There are basically two requirements for using the optical fingerprint sensor. First is you’ll need to enroll fingerprints – that means assigning ID #’s to each print so you can query them later. Once you’ve enrolled all your prints, you can easily ‘search’ the sensor, asking it to identify which ID (if any) is currently being photographed.Verify and upload the enroll sketch to your ESP8266 ESP-12E module.
  7. After uploading the code open the Arduino IDE Serial monitor at 115200 bps. Press onboard RST button. You will be asked to enter a number between 1 and 127 (this number will be the identifier of your fingerprint). Write number “1” and click on “Send” button. Now the system will be waiting to you to put your finger in the sensor…
  8. Put the finger you want to save the fingerprint in the sensor. Then you will be asked to put the same finger in the sensor again (to check if it match). If the prints match your fingerprint will be stored with the respective ID# 1 that you enter previously.
  9. Repeat the Step 7 and Step 8 to store a different fingerprint if required. You will need to modify the sketch as it’s using the ID#1 only.
  10. Verify and upload the relaycontrol sketch to your ESP8266 ESP-12E module.
  11. After uploading the code open the Arduino IDE Serial monitor at 115200 bps. Press onboard RST button. The system will be waiting for you to put the saved fingerprint on the sensor. If you use the finger saved with ID# 1 and the sensor recognize it with a confidence above 100, the solenoid lock attached to 3.3VDC relay module will open for 6 seconds (you can change it in skech – passDelay).
esp-12e fingerprint sensor
esp-12e fingerprint sensor
esp-12e fingerprint sensor
esp-12e fingerprint sensor

Summary

We have learnt how to build the Biometric Door Lock using Fingerprint Sensor, 3.3VDC relay module and ESP8266 ESP-12E module. You can add the LEDs and/or LCD to display the status of the system. You can also extend this project by adding IFTTT applet to sends email to your email address when the door status changes.

Thank you for reading and supporting us.

Libraries:

  • All libraries attached on the begining of the project description.
  • EspSoftwareSerial library. Download, unzip  and add to libraries in our PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. You can read more about it here.
  • Adafruit Fingerprint Sensor library. Download, unzip  and add to libraries in our PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. You can read more about it here.

Project resources:

  • See attachments on the beginning of this project description

AcoptexCom

Leave a Reply

Your email address will not be published.